query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Add a text to the navbar.
public function text ($text, $options = []) { $tag = $this->_extractOption ('tag', $options, 'p') ; $options = $this->addClass ($options, 'navbar-text') ; $text = preg_replace_callback ('/<a([^>]*)?>([^<]*)?<\/a>/i', function ($matches) { $attrs = preg_replace_callback ('/class="(.*)?"/', function ($m) { $cl = $this->addClass (['class' => $m[1]], 'navbar-link') ; return 'class="'.$cl['class'].'"' ; }, $matches[1], -1, $count) ; if ($count == 0) { $attrs .= ' class="navbar-link"' ; } return '<a'.$attrs.'>'.$matches[2].'</a>' ; }, $text); return $this->Html->tag($tag, $text, $options) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add( $text ) {\n\t\t$this->page->append( $text );\n\t}", "function navbar()\r\n {\r\n }", "function printItemNavbar( $text, $link, $actual, $index ) {\n\n // seta a classe\n $cl = $index == $actual ? 'active' : '';\n\n // imprime o item\n echo \"<a href='\".site_url( $link ).\"' class='nav-link $cl'>$text</a>\"; \n}", "Public function Anavbar(){\n\t\n\t}", "public function navbar() {\n $items = $this->page->navbar->get_items();\n $breadcrumbs = array();\n foreach ($items as $item) {\n $item->hideicon = true;\n $breadcrumbs[] = $this->render($item);\n }\n $divider = '<span class=\"divider\">/</span>';\n $list_items = '<li>'.join(\" $divider</li><li>\", $breadcrumbs).'</li>';\n $title = '<span class=\"accesshide\">'.get_string('pagepath').'</span>';\n return $title . \"<ul class=\\\"breadcrumb\\\">$list_items</ul>\";\n }", "public function add_text($text)\n {\n }", "function addText($text);", "public function setHTML()\n {\n // Tanken är att logiken för att sätta HTML-koden för navbaren ligger i denna metod.\n\n\n $this->htmlNavbar = $this->getHTML();\n\n }", "function myText(){\n\t\n\n\techo '<h1>before subForums</h1>';\n\t\n\n}", "function appendText ($text) {\r\n $this->content .= $text;\r\n }", "function pushHeadline ($text) {\n\t\t$this->_roof[\"cuerpo\"][] = $text;\n\t}", "public function nav($nav)\n { \n $this->sBody.=$nav;\n }", "function flexfour_submenu_add_dropdown($text){\n $replace = array(\n //List of menu item classes that should be changed to \"active\"\n \n\t\t\t\t'sub-menu' =>'dropdown',\n );\n $text = str_replace(array_keys($replace), $replace, $text);\n return $text;\n }", "public function setNavigationText($prev, $next) {\n\t\t$this->prevMonthNavTxt = $prev;\n\t\t$this->nextMonthNavTxt = $next;\n\t}", "public function updateNavbar()\n {\n if(! array_key_exists ( 'navbar', $this->options['paths'] ) )\n {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/navbar.blade.php';\n $target = base_path($this->options['paths']['navbar']);\n $hook = '<!-- bread_navbar -->';\n\n $this->updateFileContent($target, $hook, $file);\n }", "public function header($text)\n {\n return '\n\n\t<!-- MAIN Header in page top -->\n\t<h1 class=\"t3js-title-inlineedit\">' . htmlspecialchars($text) . '</h1>\n';\n }", "public function addMenuItem() {\n add_menu_page(__('Visual Chat', 'WP_Visual_Chat'), 'Visual Chat', 'visual_chat', 'vcht-console', array($this, 'viewChatBackend'), 'dashicons-format-chat');\n }", "public function setTitle(string $text = \"untitled\");", "public function navbar() {\n global $CFG;\n $navbar = $this->page->navbar;\n if (!isloggedin() || isguestuser()) {\n $items = $navbar->get_items();\n foreach ($items as $i) {\n if ($i->type == navbar::NODETYPE_LEAF && $i->key == 'courses') {\n $i->action = new moodle_url($CFG->wwwroot . '/theme/savoir/pages/opencatalog.php');\n }\n }\n }\n return $this->render_from_template('core/navbar', $navbar);\n }", "protected function _showText($text) {}", "public function addLabel($text){\n $name=\"label\".$this->labelID;\n $this->labelID++;\n $this->items[$name]['type']=\"label\";\n $this->items[$name]['text']=$text;\n }", "public function subhead($text) {\n\t\treturn \"<h4 class='subhead'>$text</h4>\";\n\t}", "public static function text($content = '', $right = false)\n {\n $classes = ['navbar-text'];\n if ($right) $classes[] = 'navbar-right';\n $content = '<p class=\"' . implode(\" \", $classes) . '\">' . $content . '</p>';\n return $content;\n }", "protected function navbar()\n\t{\n\t\tif($this->action->Id == 'show')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn parent::navbar();\n\t}", "public function addText(string $text)\n {\n $contentConfig = [\n 'text' => $text\n ];\n\n $contentItem = new ContentItem($contentConfig);\n\n $this->contentItems->addContentItemToCollection($contentItem);\n }", "public function addText( $options ){\n\n // text exists\n if( isset( $options['text'] ) ){\n // add text\n echo __( $options['text'], $this->common->getSetting( 'text-domain' ) );\n }\n // text exists\n }", "function _addToTOC($text, $level, Doku_Renderer &$renderer){\n global $conf;\n\n if (($level >= $conf['toptoclevel']) && ($level <= $conf['maxtoclevel'])){\n /** @var $renderer Doku_Renderer_xhtml */\n $hid = $renderer->_headerToLink($text, 'true');\n $renderer->toc[] = array(\n 'hid' => $hid,\n 'title' => $text,\n 'type' => 'ul',\n 'level' => $level - $conf['toptoclevel'] + 1\n );\n }\n return $hid;\n }", "function setHeaderText($value) {\n $this->header_text = $value;\n}", "static function add_title(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::title, [\r\n\t\t\t'label' => 'Title',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'The name of the role.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '25',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "public function setLabel( $text ) {\r\n $node = new TextNode( $text );\r\n $this->addChild( $node );\r\n }", "public function about(){\n\t\t$data \t\t\t\t\t\t= $this->data;\n\t\t$data['menu']\t\t\t\t= \"about\";\n\t\techo $this->blade->nggambar('website.about.index',$data);\n\t}", "public function show(Navbar $navbar)\n {\n }", "function replace_hi_greeting( $wp_admin_bar ) {\n\t$my_account = $wp_admin_bar->get_node( 'my-account' );\n\t$newtitle = str_replace( 'Hi,', 'Welcome', $my_account->title );\n\t$wp_admin_bar->add_node( array(\n\t\t'id' => 'my-account',\n\t\t'title' => $newtitle\n\t) );\n}", "public function showText($text) {}", "public function add_text($content)\n\t{\n\t\tarray_push($this->form_elements, array($content, 0, 'text'));\n\t}", "private function _subheader($text){\n echo '[-] ' . $text . PHP_EOL;\n }", "private function _header($text){\n echo '[*] ' . $text . PHP_EOL;\n }", "function menuDinamicSetText($menu, $text){\r\n\t\r\n\t$arr = explode($text);\r\n\t\r\n\tforeach ($arr as $el){\r\n\t\t\r\n\t\t$item = explode('|', $el);\r\n\t\t$caption = $item[0];\r\n\t\t$x = new TMenuItem($menu);\r\n\t\t$x->caption = $caption;\r\n\t\tif ($item[1]){\r\n\t\t\t$x->loadPicture($item[1]);\r\n\t\t}\r\n\t\tif ($item[2]){\r\n\t\t\t$x->onClick = $item[2];\r\n\t\t}\r\n\t\t$menu->addItem($x);\r\n\t}\r\n}", "function createNavBar($data, $displayGreeting = false, $helpLink = ''){\n\nglobal $base_url;\n\nprint \"<table width=100% class=\\\"yellowBorder\\\">\";\nprint \"<tr class=\\\"lightYellow\\\"><td width=10%>\"; //<b>NavBar : </b>\";\n\n$items = explode(\"|\", $data);\n\n$array_count = count($items);\n\nfor($i = 0; $i < $array_count; $i++){\n $piece = explode(\":\", $items[$i]);\n\n if($i == $array_count - 1){\n print \"<b>$piece[1]</b>\";\n }\n else{\n print \"<a class=\\\"menuLink\\\" href=\\\"$piece[0]\\\">$piece[1]</a>\";\n print \" > \";\n }\n}\nprint \"</td>\";\n\nif($displayGreeting){\n print \"<td align=center width=80%>\";\n print \"<b>Welcome \" . $_SESSION[\"fullname\"] . \"</b>\";\n print \"</td>\";\n}\n\nprint \"<td width=10% align=\\\"right\\\"><a class=menuLink target=\\\"_blank\\\" href=\\\"$base_url/help.php#$helpLink\\\">Help</a> :: <a class=\\\"menuLink\\\" href=\\\"$base_url/logout.php\\\">logout</a>\";\nprint \"</td></tr></table>\";\n}", "public function show(Navbar $navbar)\n {\n //\n }", "public function updateJsNavbar()\n {\n if(! array_key_exists( 'js_navbar', $this->options['paths'] )) {\n return;\n }\n $target = base_path($this->options['paths']['js_navbar']);\n $hook = '/* bread_js_navbar_link */';\n $file = base_path($this->options['paths']['stubs']) . '/resources/assets/js/components/navbar.js';\n $this->updateFileContent($target, $hook, $file);\n }", "public function laba_rugi_bulanan() {\n\n $this->layout_lib->template_with_custom_navbar('analisa/navbar-sub-laba-rugi-bulanan', 'analisa/laba-rugi-bulanan');\n\n }", "public function run() {\n\t\t\n\t\techo CHtml::openTag('nav', $this->htmlOptions);\n\t\techo '<div class=\"' . $this->getContainerCssClass() . '\">';\n\t\t\n\t\techo '<div class=\"navbar-header\">';\n\t\tif($this->collapse) {\n\t\t\t$this->controller->widget('booster.widgets.TbButton', array(\n\t\t\t\t'label' => '<span class=\"icon-bar\"></span><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span>',\n\t\t\t\t'encodeLabel' => false,\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'navbar-toggle',\n\t\t\t\t\t'data-toggle' => 'collapse',\n\t\t\t\t\t'data-target' => '#'.self::CONTAINER_PREFIX.$this->id,\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t}\n\t\t\n\t\tif ($this->brand !== false) {\n\t\t\tif ($this->brandUrl !== false) {\n\t\t\t\tif($this->toggleSideBar){\n\t\t\t\t\techo \t\t\n\t\t\t\t\t'<button id=\"sidebar-toggle\">\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\techo CHtml::openTag('a', $this->brandOptions) . $this->brand . '</a>';\n\t\t\t} else {\n\t\t\t\tunset($this->brandOptions['href']); // spans cannot have a href attribute\n\t\t\t\techo CHtml::openTag('span', $this->brandOptions) . $this->brand . '</span>';\n\t\t\t}\n\t\t}\n\t\techo '</div>';\n\t\t\n\t\techo '<div class=\"collapse navbar-collapse\" id=\"'.self::CONTAINER_PREFIX.$this->id.'\">';\n\t\tforeach ($this->items as $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\techo $item;\n\t\t\t} else {\n\t\t\t\tif (isset($item['class'])) {\n\t\t\t\t\t$className = $item['class'];\n\t\t\t\t\tunset($item['class']);\n\n\t\t\t\t\t$this->controller->widget($className, $item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</div></div></nav>';\n\n\t\t$this->registerClientScript();\n\t}", "function bethel_add_menu_subtitles ($string) {\n\tif (substr($string, 3, 7) == 'title=\"') {\n\t\t$title = substr($string, 10, strpos($string, '\"', 11)-10);\n\t\t$string = substr($string,0,-4).\"<br/><span class=\\\"subtitle\\\">{$title}</span></a>\";\n\t}\n\treturn $string;\n}", "public function setTitle($value);", "function artspace_aboutmenu() {\n\n\t$locations = array(\n\t\t'orange' => __( 'Top About Menu', 'text_domain' ),\n\t);\n\tregister_nav_menus( $locations );\n\n}", "protected function actionHeader() {\n Navigation::activateItem($this->navlink);\n $this->setTabNavigationIcon('black');\n $this->addSubNavigation(_('Lesen'), 'show');\n if (Utils\\hasPermission($this->edit_permission)) {\n $this->addSubNavigation(_('Bearbeiten'), 'edit');\n }\n }", "public function addCaption($text)\n {\n $this->captionCount++;\n $this->captionStarted = $this->timer->elapsedAsSubripTime();\n $this->captionText = $text;\n }", "function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\n}", "public function AccueilNavBar() {\n\n\t\t$Countotal = $this -> CountActeur();\n\n\t\treturn $this -> render(\"RuffeCardUserGestionBundle:Administrateur:GestionAccueil.html.twig\", array('Count' => $Countotal));\n\n\t}", "function toc_additem($id, $text, $level) {\n global $conf;\n\n //handle TOC\n if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']) {\n $this->toc[] = html_mktocitem($id, $text, $level - $conf['toptoclevel'] + 1);\n }\n }", "public function onNavigationBar($event) {\n if ($this->user) {\n // add the profile links\n Navigation::addBar('default', array('title' => 'View Profile', 'slug' => 'account/profile', 'icon' => 'cog'));\n\n // add the admin links\n if (Sentry::getUser()->hasAccess('admin')) {\n Navigation::addBar('default', array('title' => 'View Logs', 'slug' => 'logviewer', 'icon' => 'wrench'));\n Navigation::addBar('default', array('title' => 'Caching', 'slug' => 'caching', 'icon' => 'tachometer'));\n Navigation::addBar('default', array('title' => 'CloudFlare', 'slug' => 'cloudflare', 'icon' => 'cloud'));\n Navigation::addBar('default', array('title' => 'Queuing', 'slug' => 'queuing', 'icon' => 'random'));\n }\n\n // add the view users link\n if (Sentry::getUser()->hasAccess('mod')) {\n Navigation::addBar('default', array('title' => 'View Users', 'slug' => 'users', 'icon' => 'user'));\n }\n\n // add the create user link\n if (Sentry::getUser()->hasAccess('admin')) {\n Navigation::addBar('default', array('title' => 'Create User', 'slug' => 'users/create', 'icon' => 'star'));\n }\n\n // add the create page link\n if (Sentry::getUser()->hasAccess('edit')) {\n Navigation::addBar('default', array('title' => 'Create Page', 'slug' => 'pages/create', 'icon' => 'pencil'));\n }\n\n // add the create post link\n if (Config::get('cms.blogging')) {\n if (Sentry::getUser()->hasAccess('blog')) {\n Navigation::addBar('default', array('title' => 'Create Post', 'slug' => 'blog/posts/create', 'icon' => 'book'));\n }\n }\n\n // add the create event link\n if (Config::get('cms.events')) {\n if (Sentry::getUser()->hasAccess('edit')) {\n Navigation::addBar('default', array('title' => 'Create Event', 'slug' => 'events/create', 'icon' => 'calendar'));\n }\n }\n }\n }", "public function render_navbar($items, $active = NULL) {\n $this->config['type_class'] = 'navbar-nav';\n return $this->render($items, $active); \n }", "function organique_single_add_to_cart_text() {\n\t\treturn __( 'Add to shopping cart', 'organique_wp' );\n\t}", "function addText($key, $text);", "public function get_title() {\n return esc_html__( 'Nav menu', 'Alita-extensions' );\n }", "public function define_navbar_txt_activate($p_state)\r\n\t\t{\r\n\t\t\t$this->c_navbar_txt_activate = $p_state;\r\n\t\t}", "public function render()\n\t{\n\t\treturn view('components.navbar');\n\t}", "function display_header_text()\n {\n }", "public function setText($value)\n\t{\n\t\t$this->setViewState('Text',$value,'');\n\t}", "public function setLabel($text) {\n $this->label = '<label for=\"'.$this->id.'\">'.$text.'</label>';\n }", "public function setLabel($text) {\n $this->label = '<label for=\"'.$this->id.'\">'.$text.'</label>';\n }", "function admin_footer_text($text)\n {\n }", "public function menu_html()\n {\n echo '<h1>'.get_admin_page_title().'</h1>';\n echo '<p>Bienvenue sur la page d\\'accueil de la lettre d\\'informations.</p>';\n }", "function bethel_filter_menu_items() {\n\tadd_filter ('walker_nav_menu_start_el', 'bethel_add_menu_subtitles');\n}", "public function _top_nav_link()\n\t{\n\t\t$top_nav = Event::$data;\n\t\t\n\t\t//fetch flickrwijit settings from db\n\t\t$flickrwijit_settings = ORM::factory('flickrwijit',1);\n\t\t\n\t\tif($flickrwijit_settings->block_position == 1 ) {\n\t\t\n\t\t\techo ($top_nav == \"flickrwijit\") ? \n\t\t\t\tKohana::lang('flickrwijit.flickrwijit_top_nav') : \n\t\t\t\t\"<a href=\\\"\".url::site().\"flickrwijit\\\">\".\n\t\t\t\tKohana::lang('flickrwijit.flickrwijit_top_nav').\"</a>\";\n\t\n\t\t}\n\t}", "function change_post_menu_label() {\n global $menu;\n $menu[5][0] = 'Blog';\n echo '';\n}", "function register_my_menu() {\n register_nav_menu('main-menu',__( 'Navegador Primario' ));\n }", "public function i_follow_page_in_tab_bar($nodetext) {\n $xpath = \"//ul[contains(@class,'nav-tabs')]//li//a[contains(@title, '\".$nodetext.\"')]\";\n $this->execute('behat_general::i_click_on', [$xpath, 'xpath_element']);\n }", "public function add_registration_link_text() {\n\t\t\tprintf(\n\t\t\t\t'<p class=\"ast-woo-form-actions\">\n\t\t\t\t\t%1$s\n\t\t\t\t\t<a href=\"#ast-woo-register\" data-type=\"do-register\" class=\"ast-woo-account-form-link\">\n\t\t\t\t\t\t%2$s\n\t\t\t\t\t</a>\n\t\t\t\t</p>',\n\t\t\t\tapply_filters( 'astra_addon_woo_account_register_heading', __( 'Not a member?', 'astra-addon' ) ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\tapply_filters( 'astra_addon_woo_account_register_string', __( 'Register', 'astra-addon' ) ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t);\n\t\t}", "function nav_main() {\n\n\techo '\n\t\n\t\t<ul>\n\t\t\t<li><a href=\"index.php?page=home\">Home</a></li>\n\t\t\t<li><a href=\"index.php?page=gallery\">Gallery</a></li>\n\t\t\t<li><a href=\"index.php?page=blog\">Blog</a></li>\n\t\t\t<li><a href=\"index.php?page=newpage\">New Page</a></li>\n\t\t\t<li><a href=\"index.php?page=contact\">Contact Us</a></li>\n\t\t</ul>\n\t\t\n\t';\t\n\t\n}", "public function myfoo( $text ) {\n\t\t$text .= ' bar!';\n\t\treturn $text;\n\t}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "function thiredtheme_menu_item()\n {\n register_nav_menus(\n array(\n 'header'=>__('header menu'),\n 'footer'=>__('footer menu'))); \n }", "public function writeMenu() {}", "public function render()\n {\n return view('components.navbar-nav');\n }", "function profile_tab_testname() {\n\tglobal $bp;\n\tbp_core_new_nav_item(\n\t\tarray( \n\t\t\t'name' => 'Test', \n\t\t\t'slug' => 'test', \n\t\t\t'screen_function' => 'test_screen', \n\t\t\t'position' => 40,\n\t\t\t'parent_url' => bp_loggedin_user_domain() . '/test/',\n\t\t\t'parent_slug' => $bp->profile->slug,\n\t\t\t'default_subnav_slug' => 'test',\n\t\t) \n\t);\n}", "function ShowNavBar()\n{\n $navBar = \"\";\n //Navigation Start\n $navBar .= \"<nav class=\\\"navbar navbar-default navbar-sticky bootsnav\\\">\";\n $navBar .=\"<div class=\\\"container\\\">\";\n // Début Header Navigation\n $navBar .= \"<div class=\\\"navbar-header\\\">\";\n $navBar .=\"<button type=\\\"button\\\" class=\\\"navbar-toggle\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbar-menu\\\">\";\n $navBar .= \"<i class=\\\"fa fa-bars\\\"></i>\";\n $navBar .= \"</button>\";\n $navBar .= \"<a class=\\\"navbar-brand\\\" href=\\\"index.php\\\"><img src=\\\"./img/logo.png\\\" class=\\\"logo\\\" alt=\\\"Logo du site\\\"></a>\";\n $navBar .=\"</div>\";\n // Fin Header Navigation\n\n\n $navBar .= \"<div class=\\\"collapse navbar-collapse\\\" id=\\\"navbar-menu\\\">\";\n $navBar .= \"<ul class=\\\"nav navbar-nav navbar-left\\\" data-in=\\\"fadeInDown\\\" data-out=\\\"fadeOutUp\\\">\";\n $navBar .= \"<li \".SetActivePage(\"index\") . \"><a href=\\\"index.php\\\">Accueil</a></li>\";\n //Affiche les liens de connexion et d'inscription si l'utilisateur n'est pas connecté\n if (!IsUserLoggedIn()) {\n $navBar .= \"<li \" .SetActivePage(\"login\") . \">\";\n $navBar .=\"<a href=\\\"login.php\\\">Se connecter</a>\";\n $navBar .=\"</li>\";\n $navBar .= \"<li \" .SetActivePage(\"signup\"). \">\";\n $navBar .= \"<a href=\\\"signup.php\\\">S'inscrire</a>\";\n $navBar .= \"</li>\";\n }\n //Sinon affiche les liens correspondant au type de l'utilisateur\n else \n {\n switch (GetUserType()) \n {\n //Affiche les liens correspondant au type Chercheur\n case \"Chercheur\":\n $navBar .= \"<li \" .SetActivePage(\"annonces\") . \">\";\n $navBar.= \"<a href=\\\"annonces.php\\\">Annonces</a>\";\n $navBar.= \"</li>\";\n $navBar.= \"<li \" .SetActivePage(\"wishlist\") . \">\";\n $navBar.= \"<a href=\\\"wishlist.php?idU=\".GetUserId().\"\\\">Ma Wishlist</a>\";\n $navBar.= \"</li>\";\n break;\n //Affiche les liens correspondant au type Annonceur\n case \"Annonceur\":\n $navBar .= \"<li \";\n if (isset($_GET['idU']))\n $navBar .= SetActivePage(\"annonces\");\n $navBar .= \">\";\n $navBar.=\"<a href=\\\"annonces.php?idU=\" . GetUserId() . \"\\\">Mes Annonces</a>\";\n $navBar.=\"</li>\";\n $navBar.=\"<li \" .SetActivePage(\"creer-annonce\"). \">\";\n $navBar.=\"<a href=\\\"creer-annonce.php\\\">Créer une annonce</a>\";\n $navBar.=\"</li>\";\n break;\n //Affiche les liens correspondant au type Administrateur\n case \"Admin\":\n $navBar .= \"<li \";\n if(isset($_GET['gestion']) && $_GET['gestion'] == \"utilisateurs\") \n $navBar .=SetActivePage(\"administration\"); \n $navBar .= \">\";\n $navBar.=\"<a href=\\\"administration.php?gestion=utilisateurs\\\">Gérer les utilisateurs</a>\";\n $navBar.=\"</li>\";\n $navBar.=\"<li \";\n if(isset($_GET['gestion']) && $_GET['gestion'] == \"motscles\") $navBar .= SetActivePage(\"administration\"); \n $navBar .= \">\";\n $navBar.=\"<a href=\\\"administration.php?gestion=motscles\\\">Gérer les mots-clés</a>\";\n $navBar.=\" </li>\";\n break;\n }\n \n $navBar .= \"</ul>\";\n $navBar.=\"<ul class=\\\"nav navbar-nav navbar-right\\\" data-in=\\\"fadeInDown\\\" data-out=\\\"fadeOutUp\\\">\"; \t\n $navBar.=\"<li><a href=\\\"logout.php\\\">Se déconnecter</a></li>\";\n }\n $navBar .= \"<li \".SetActivePage(\"faq\").\">\";\n $navBar .= \"<a href=\\\"faq.php\\\">Aide</a>\";\n $navBar.= \"</li>\";\n $navBar .= \"</ul>\";\n $navBar.=\"</div>\";\n $navBar.= \"</div>\" ;\n $navBar.=\"</nav>\";\n\n //Echo le contenu HTML de la barre de navigation\n echo $navBar;\n}", "function edit_footer_text_admin () {\n echo '<span id=\"footer-thankyou\">Contact Database by <a href=\"https://www.supint.com/\" target=\"_blank\">Superlative</a></span>\n\t\t <p id=\"footer-upgrade\"></p>';\n}", "static function show_text($text) {\n\n // Echo Some Text\n echo ' & here is the static method! '.$text;\n\n // Show Documentation Link\n echo ' - '.MOD_CONSTANT.' see your <a href=\"/guide/modulename\">Module Documentation</a>';\n\n }", "function add_Main_Nav() {\n\tregister_nav_menu('header-menu',__( 'Header Menu' ));\n}", "public function add()\n\t{\n\t\tPhpfox::getComponent('language.admincp.phrase.add', array('sReturnUrl' => $this->get('return'), 'sVar' => $this->get('phrase'), 'bNoJsValidation' => true), 'controller');\n\t}", "function quadro_site_about() {\n\tglobal $quadro_options;\n\tif ( esc_attr($quadro_options['about_text']) != '' ) {\n\t\techo '<h2 class=\"site-description\">' . esc_attr($quadro_options['about_text']) . '</h2>';\n\t}\n}", "function display_title(){\n\techo \"Menu Page\";\n}", "public function setBodyText($text);", "private function displayNav()\n {\n\n $links = array(\n 'home',\n 'browse',\n 'about',\n 'contact',\n );\n\n //Navbar\n $html = '<div id=\"navbar\">' . \"\\n\";\n $html .= '<ul>' . \"\\n\";\n\n // Loop through the links\n foreach ($links as $link) {\n\n $html .= '<li><a href=\"index.php?page=' . $link . '\"';\n\n if ($link == $_GET['page']) {\n $html .= ' class=\"active\"';\n }\n\n $html .= '>';\n\n if ($this->model->userLoggedIn && $link == 'home') {\n $html .= 'My Profile';\n } else {\n $html .= ucfirst($link);\n }\n\n $html .= '</a></li>' . \"\\n\";\n\n }\n\n $html .= '</ul>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n\n return $html;\n }", "function glass_change_post_menu_label() {\n\tglobal $menu;\n\tglobal $submenu;\n\t$menu[5][0] = 'News';\n\t$submenu['edit.php'][5][0] = 'News';\n\t$submenu['edit.php'][10][0] = 'Add News';\n\t$submenu['edit.php'][16][0] = 'News Tags';\n\techo '';\n}", "function atarr_do_copyright_text() {\n\n\t// Grab our customizer settings.\n\t$copyright_text = get_theme_mod( 'atarr_copyright_text' );\n\n\t// Stop if there's nothing to display.\n\tif ( ! $copyright_text ) {\n\t\treturn false;\n\t}\n\n\tob_start(); ?>\n\n\t<span class=\"copyright-text\">&#169; <?php echo intval( date( 'Y' ) ); ?> <?php echo wp_kses_post( $copyright_text ); ?></span>\n\t<?php\n\t\twp_nav_menu( array(\n\t\t\t'theme_location' => 'footer',\n\t\t\t'menu_id' => 'footer-menu',\n\t\t) );\n\t?>\n\n\t<?php\n\treturn ob_get_clean();\n}", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function setTopAxisTitle($text = '')\n {\n $this->axis_data[3]['t'] = $text;\n }", "public function gridAddNavPageItem($name = '', $value = ''){\n $this->appendVar('PAGES', array('name' => $name, 'value' => $value));\n $this->setVar('APPLY_TAG', __('Go'));\n }", "function h_add_menu(string $title, array $args) {\n h_add_menus([\n $title => $args\n ]);\n}", "public function sobre() {\n $this->template->set_title( 'Work for all - Sobre' );\n\n // renderiza a pagina\n\t\t$this->template->render( 'sobre' );\n }", "function addText()\r\n {\r\n return null; //PEAR::raiseError(\"No addText method exists\", true);\r\n }", "function getTitle(){\n\t\techo \"Log in\";\n\t}", "public function setText($text)\r\n {\r\n $this->text = $text;\r\n }", "public function addTab(Event $event)\n {\n $sectionNav = $event->getParam('section_nav');\n $sectionNav['teams'] = 'Teams'; // @translate\n $event->setParam('section_nav', $sectionNav);\n }", "public function set_title($text){\n $this->title=$text;\n }" ]
[ "0.61842436", "0.6087025", "0.60653627", "0.60146594", "0.5924701", "0.58487624", "0.5842211", "0.5810246", "0.5786524", "0.578005", "0.57748324", "0.575047", "0.57363844", "0.57216185", "0.56886643", "0.5604146", "0.55924135", "0.55720085", "0.5536469", "0.5516573", "0.55043435", "0.54605764", "0.5444584", "0.54317284", "0.5383693", "0.5355949", "0.5340653", "0.5331936", "0.530497", "0.5292324", "0.528225", "0.52807707", "0.52799755", "0.5265531", "0.5262757", "0.52598673", "0.5233219", "0.5214186", "0.520484", "0.5197217", "0.51811", "0.51740324", "0.51583683", "0.5152504", "0.51415247", "0.5139082", "0.51385593", "0.5138053", "0.5114562", "0.5114268", "0.5111421", "0.51104397", "0.50947064", "0.5074955", "0.50705826", "0.50655794", "0.5060102", "0.5059212", "0.50402266", "0.5036061", "0.5032624", "0.5032624", "0.50298053", "0.50287426", "0.50224954", "0.50079596", "0.5005381", "0.49995506", "0.4998883", "0.49945036", "0.49917018", "0.4985083", "0.49832276", "0.49824914", "0.49824914", "0.4982482", "0.49823102", "0.49767697", "0.49760124", "0.49751368", "0.4972096", "0.4971193", "0.49706262", "0.496661", "0.496395", "0.496174", "0.49606708", "0.49579144", "0.4957356", "0.4953308", "0.49527046", "0.49522153", "0.4949638", "0.49483594", "0.49475062", "0.49389198", "0.4936906", "0.49365053", "0.49316636", "0.49238294" ]
0.62489104
0
Add a serach form to the navbar.
public function searchForm ($model = null, $options = []) { $align = $this->_extractOption ('align', $options, 'left') ; unset ($options['align']) ; $options = $this->addClass($options, ['navbar-form', 'navbar-'.$align]) ; return $this->Form->searchForm($model, $options) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addForm() {\n $this->view->displayForm();\n }", "function add_search_form($items, $args) {\nif( $args->theme_location == 'menu-principal' )\n\t $items .= '<li class=\"search\">\n\t\t\t\t\t<a class=\"search_icon\">\n\t\t\t\t\t\t<span class=\"spicewpsearch_icon\"></span>\n\t\t\t\t\t</a>\n\t\t\t\t\t<div style=\"display:none;\" class=\"spicewpsearchform\">'. get_search_form(false) .'</div>\n\t\t\t\t</li>';\n return $items;\n}", "function navbar()\r\n {\r\n }", "function techmarket_navbar_search() {\n\t\ttechmarket_get_template( 'sections/navbar-search.php' );\n\t}", "public function formLogin() {\n $this->view->addForm();\n }", "public function create()\n {\n return view(\"backend.navbars.create\");\n }", "public function __construct()\n {\n parent::__construct();\n\n // creates the form\n $this->form = new BootstrapFormBuilder(self::$formName);\n\n // define the form title\n $this->form->setFormTitle('Avaliações');\n\n $inscricao_evento_id = new TDBUniqueSearch('inscricao_evento_id', 'eventtus', 'Evento', 'id', 'id','nome asc' );\n\n $inscricao_evento_id->setSize('100%');\n $inscricao_evento_id->setMinLength(0);\n $inscricao_evento_id->setMask('{nome}');\n\n $row1 = $this->form->addFields([new TLabel('Evento', null, '14px', null),$inscricao_evento_id]);\n $row1->layout = ['col-sm-6'];\n\n // keep the form filled during navigation with session data\n $this->form->setData( TSession::getValue(__CLASS__.'_filter_data') );\n\n $btn_ongenerate = $this->form->addAction('Gerar', new TAction([$this, 'onGenerate']), 'fa:search #ffffff');\n $btn_ongenerate->addStyleClass('btn-primary'); \n\n // vertical box container\n $container = new TVBox;\n $container->style = 'width: 100%';\n $container->add(TBreadCrumb::create(['Cadastros','Avaliações']));\n $container->add($this->form);\n\n parent::add($container);\n\n }", "function form($instance) {\n\t\techo '<p>Place on any sidebar to display upcoming webinars.</p>';\n\t}", "public function index() {\n $content = $this->lcopun->copun_add_form();\n $this->template->full_admin_html_view($content);\n }", "public function open(){\n\n $form = '<form ';\n $class = 'active-form';\n\n RMTemplate::get()->add_script(\n 'forms/active-form.js',\n 'rmcommon',\n array(\n 'location' => 'footer'\n )\n );\n\n RMTemplate::get()->add_style(\n 'active-form.css',\n 'rmcommon',\n array(\n 'location' => 'footer'\n )\n );\n\n foreach ( $this->attributes as $attr => $value ){\n\n switch ( $attr ){\n case 'submit-via':\n $class .= $value == 'ajax' ? ' ajax-form' : '';\n break;\n case 'validation':\n $class .= $value == 'local' ? ' validate-form' : '';\n RMTemplate::get()->add_script('jquery.validate.min.js', 'rmcommon', array('directory' => 'include', 'location' => 'footer'));\n break;\n case 'class':\n $class .= ' ' . $value;\n break;\n default:\n $form .= $attr . '=\"' . $value . '\"';\n break;\n }\n\n }\n\n $form .= ' class=\"' . $class . '\">';\n\n echo $form;\n\n }", "Public function Anavbar(){\n\t\n\t}", "function scribbles_add_search_form() {\n\n\tget_template_part( 'templates/parts/search' );\n\n}", "public function show(CaretakerForm $caretakerForm)\n {\n //\n }", "public function form()\n\t{\n\t?>\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t<?php foreach( (array) $this->InstanceRegistred as $id => $args ) : ?>\n\t\t\t<tr>\n\t\t\t\t<th><?php echo $args['title'];?></th>\n\t\t\t\t<td>\n\t\t\t\t<?php \n\t\t\t\t\twp_dropdown_pages(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'name' \t\t\t\t=> $args['name'],\n\t\t\t\t\t\t\t'post_type' \t\t=> $args['post_type'],\n\t\t\t\t\t\t\t'selected' \t\t\t=> $args['selected'],\n\t\t\t\t\t\t\t'sort_column' \t\t=> $args['listorder'],\n\t\t\t\t\t\t\t'show_option_none' \t=> $args['show_option_none']\t\t\t\t\t\t\t\n\t\t\t\t\t\t)\n\t\t\t\t\t);\t\t\t\t\n\t\t\t\t?>\t\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php endforeach;?>\n\t\t</tbody>\n\t</table>\n\t<?php\t\t\n\t}", "protected function navbar()\n\t{\n\t\tif($this->action->Id == 'show')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn parent::navbar();\n\t}", "public function run() {\n\t\t\n\t\techo CHtml::openTag('nav', $this->htmlOptions);\n\t\techo '<div class=\"' . $this->getContainerCssClass() . '\">';\n\t\t\n\t\techo '<div class=\"navbar-header\">';\n\t\tif($this->collapse) {\n\t\t\t$this->controller->widget('booster.widgets.TbButton', array(\n\t\t\t\t'label' => '<span class=\"icon-bar\"></span><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span>',\n\t\t\t\t'encodeLabel' => false,\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'navbar-toggle',\n\t\t\t\t\t'data-toggle' => 'collapse',\n\t\t\t\t\t'data-target' => '#'.self::CONTAINER_PREFIX.$this->id,\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t}\n\t\t\n\t\tif ($this->brand !== false) {\n\t\t\tif ($this->brandUrl !== false) {\n\t\t\t\tif($this->toggleSideBar){\n\t\t\t\t\techo \t\t\n\t\t\t\t\t'<button id=\"sidebar-toggle\">\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\techo CHtml::openTag('a', $this->brandOptions) . $this->brand . '</a>';\n\t\t\t} else {\n\t\t\t\tunset($this->brandOptions['href']); // spans cannot have a href attribute\n\t\t\t\techo CHtml::openTag('span', $this->brandOptions) . $this->brand . '</span>';\n\t\t\t}\n\t\t}\n\t\techo '</div>';\n\t\t\n\t\techo '<div class=\"collapse navbar-collapse\" id=\"'.self::CONTAINER_PREFIX.$this->id.'\">';\n\t\tforeach ($this->items as $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\techo $item;\n\t\t\t} else {\n\t\t\t\tif (isset($item['class'])) {\n\t\t\t\t\t$className = $item['class'];\n\t\t\t\t\tunset($item['class']);\n\n\t\t\t\t\t$this->controller->widget($className, $item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</div></div></nav>';\n\n\t\t$this->registerClientScript();\n\t}", "public function index() {\n $content = $this->llocation->location_add_form();\n $this->template->full_admin_html_view($content);\n }", "public function configureServicesForm()\n {\n echo Twig::getTemplateContent(\n 'install/configureServicesForm.twig',\n array()\n );\n }", "public function addform() {\n require_once 'modeles/etudiant_modele.php';\n require_once 'vues/etudiants/etudiants_addform_vue.php';\n }", "function content() {\n echo \"\n <form action='http://{$_SERVER['SERVER_NAME']}/mailmaid/subscriber/add' method='post'>\n <input name='token' type='hidden' value='{$this->params['token']}'>\n <label for='username'>Name</label>\n <input name='name' placeholder='Name' id='name' type='text' required>\n <label for='description'>Description</label>\n <input name='description' placeholder='Description (Optional)' id='description' type='text'>\n <input type='submit' value='Create List'>\n </form>\n \";\n }", "function show_forms()\n {\n }", "public function show(Navbar $navbar)\n {\n }", "public function index()\n {\n $this->permission->check_label('add_variant')->create()->redirect();\n\n $content = $this->lvariant->variant_add_form();\n $this->template_lib->full_admin_html_view($content);\n }", "function showInputForm()\n {\n $user = common_current_user();\n\n $profile = $user->getProfile();\n\n $this->elementStart('form', array('method' => 'post',\n 'id' => 'form_ostatus_sub',\n 'class' => 'form_settings',\n 'action' => $this->selfLink()));\n\n $this->hidden('token', common_session_token());\n\n $this->elementStart('fieldset', array('id' => 'settings_feeds'));\n\n $this->elementStart('ul', 'form_data');\n $this->elementStart('li');\n $this->input('profile',\n // TRANS: Field label for a field that takes an OStatus user address.\n _m('Subscribe to'),\n $this->profile_uri,\n // TRANS: Tooltip for field label \"Subscribe to\".\n _m('OStatus user\\'s address, like [email protected] or http://example.net/nickname.'));\n $this->elementEnd('li');\n $this->elementEnd('ul');\n // TRANS: Button text.\n $this->submit('validate', _m('BUTTON','Continue'));\n\n $this->elementEnd('fieldset');\n\n $this->elementEnd('form');\n }", "public function index()\n {\n $data['title'] = $this->config->item('title');\n $this->show_form($data);\n }", "function gigya_share_bar_pane_edit_form($form, &$form_state) {\n $conf = $form_state['conf'];\n $form += gigya_field_formatter_settings_form(array('type' => 'gigya_sharebar'), array('display' => array('default' => array('settings' => $conf))), 'default', $form, $form_state);\n $ctxs = array();\n foreach ($form_state['contexts'] as $ctx) {\n $ctxs[] = $ctx->keyword;\n }\n $token_list = theme('token_tree', array('token_types' => $ctxs, 'global_types' => FALSE));\n $form['tokens_list']['#markup'] = $token_list;\n return $form;\n}", "public function show(Navbar $navbar)\n {\n //\n }", "function holistic_nav_widget() {\n\tregister_widget( 'Holistic_Nav_Widget' );\n}", "public function create()\n {\n return view('navbar.create');\n }", "public function setAsStaticForm() {\n\t\treturn $this->form_tag(implode('<br />', $this->_elements));\n\t}", "public function form( $instace ){\n echo '<p><strong>Widget ini belum bisa diubag secara Manual!</strong><br> Hubungi developer untuk melakukan perubahan</p>'; \n }", "public function showAddMenu()\n {\n return view('Admin.Bakery.pages.addMenu');\n }", "function buildForm(){\n\t\t# menampilkan form\n\t}", "protected function form()\n {\n return Admin::form(MenuTag::class, function (Form $form) {\n\n $form->display('id', 'ID');\n\n $form->select('tag_id', 'Tag')\n ->options(\\App\\Tag::all()->pluck('name', 'id'));\n\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n\n $form->saved(function () {\n Cache::forget('menu-tags');\n });\n });\n }", "public function showForm()\n {\n //show random movies in the frontpage\n $movies = Movie::inRandomOrder()->limit(10)->get();\n return view('search.form', ['movies' => $movies]);\n }", "function form($instance) {\n $instance = wp_parse_args(\n (array)$instance,\n array(\n 'Navigation ID' => '',\n 'display' => 'collections',\n 'page' => '',\n )\n);\n include(plugin_dir_path(__FILE__) . '/views/admin.php' );\n}", "protected function addShowForm() \n {\n return view('dashboard.article.add');\n }", "public function form( $instance ) {\n\t\t global $jobcareer_form_fields, $jobcareer_html_fields;\n\t\t$title = isset( $instance['title'] ) ? $instance['title'] : '';\n\t\t$nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';\n\n\t\t// Get menus\n\t\t$menus = wp_get_nav_menus();\n\n\t\t// If no menus exists, direct the user to go and create some.\n\t\t?>\n\t\t<p class=\"nav-menu-widget-no-menus-message\" <?php if ( ! empty( $menus ) ) { echo ' style=\"display:none\" '; } ?>>\n\t\t\t<?php\n\t\t\tif ( isset( $GLOBALS['wp_customize'] ) && $GLOBALS['wp_customize'] instanceof WP_Customize_Manager ) {\n\t\t\t\t$url = 'javascript: wp.customize.panel( \"nav_menus\" ).focus();';\n\t\t\t} else {\n\t\t\t\t$url = admin_url( 'nav-menus.php' );\n\t\t\t}\n\t\t\t?>\n\t\t\t<?php echo sprintf( __( 'No menus have been created yet. <a href=\"%s\">Create some</a>.', 'jobcareer' ), esc_attr( $url ) ); ?>\n\t\t</p>\n\t\t<div class=\"nav-menu-widget-form-controls\" <?php if ( empty( $menus ) ) { echo ' style=\"display:none\" '; } ?>>\n\t\t\t\n\t\t\t\n\t\t\t<?php\n\t\t\t $title = isset($instance['title']) ? $title = $instance['title']:'';\n\t\t\t $cs_opt_array = array(\n 'name' => esc_html__('Title', 'jobcareer'),\n 'desc' => '',\n 'hint_text' => esc_html__(\"Enter your element title here.\", 'jobcareer'),\n 'echo' => true,\n 'field_params' => array(\n 'std' => esc_attr($title),\n 'cust_id' => '',\n 'cust_name' => jobcareer_special_char($this->get_field_name('title')),\n 'return' => true,\n ),\n );\n\n $jobcareer_html_fields->cs_text_field($cs_opt_array);\n\t\t\t?>\n\t\t\t\n\t\t\t\n\t\t\t<?php\n\t\t\tif(!empty($menus)):\n\t\t\t$cs_menu_all=array();\t\n\t\t\tforeach ( $menus as $menu ) : \n\t\t\t\t\t$cs_menu_all[$menu->slug]=$menu->name;\n\t\t\t\t\t\n\t\t\t\t\tendforeach;\n\t\t\t//$cs_title = isset($instance['description']) ? esc_attr($instance['description']) : '';\n $cs_menu_label = isset($instance['nav_menu']) ? esc_attr($instance['nav_menu']) : '';\n\t\t\t\n\t\t\t$cs_opt_array = array(\n 'name' => esc_html__('Select Menu:', 'jobcareer'),\n 'desc' => '',\n 'hint_text' => '',\n 'echo' => true,\n 'field_params' => array(\n 'std' => $cs_menu_label,\n 'id' => jobcareer_special_char($this->get_field_id('select_view')),\n 'cust_name' => jobcareer_special_char($this->get_field_name('nav_menu')),\n 'classes' => 'dropdown',\n 'options' => $cs_menu_all,\n 'return' => true,\n ),\n );\n\n echo jobcareer_special_char($jobcareer_html_fields->cs_select_field($cs_opt_array));\n\t\t\tendif;\n\t\t\t\n\t\t\t?>\n\t\t\t\n\t\t\t\n\t\t</div>\n\t\t<?php\n\t}", "public function index()\n\t{\n\t\t$content = $this->lcustomer->customer_add_form();\n\t\t$this->template->full_admin_html_view($content);\n\t}", "protected function setLoginBar()\n {\n $this->loginBar = new FormBuilder(\"login\", \"login\", \"post\");\n $loginTitle = new Comment(\"Member Login:\");\n $loginTitle->setBold();\n $loginTitle->setUnderlined();\n $this->loginBar->add($loginTitle);\n\n $this->loginBar->buildComment(\"username: \", false)\n ->buildTextField(\"username\")\n ->buildComment(\"password: \", false)\n ->buildPasswordField(\"password\", \"password\", \"\", true)\n ->buildButton(\"Log In\", \"submit\", \"submit\")\n ->buildComment(\"Don't have an account?\");\n \n $register = new Link(\"register\");\n $register->setText(\"Register New Account\");\n $register->setLineBreak(true);\n $forgot = new Link(\"forgotpass\");\n $forgot->setText(\"Forgot Password?\");\n \n $this->loginBar->add($register);\n $this->loginBar->add($forgot);\n $this->setDivision($this->loginBar);\n }", "public function addFilterFormInput(): void;", "public function form()\n { ?>\n\n <form method=\"post\" action=\"\" enctype=\"multipart/form-data\">\n <table class=\"form-table\">\n <tbody>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Roles', 'wpsearchconsole'); ?></th>\n <td>\n <?php foreach ($this->roles as $key => $role) :\n\n $role_obj = get_role($key);\n $role_caps = $role_obj->capabilities;\n\n $name = ($key ? $key : false);\n $checked = (array_key_exists($this->capability, $role_caps) ? 1 : 0);\n $show = ($role ? $role : false);\n $disabled = ($key == 'administrator' ? ' disabled=\"disabled\"' : false);\n\n $this->role_check($name, $checked, $disabled, $role);\n\n endforeach; ?>\n </td>\n </tr>\n </tbody>\n </table>\n <?php submit_button(__('Give Access', 'wpsearchconsole'), 'primary', 'wpsearchconsole_give_access', false); ?>\n </form>\n <?php\n }", "public function navbar() {\n global $CFG;\n $navbar = $this->page->navbar;\n if (!isloggedin() || isguestuser()) {\n $items = $navbar->get_items();\n foreach ($items as $i) {\n if ($i->type == navbar::NODETYPE_LEAF && $i->key == 'courses') {\n $i->action = new moodle_url($CFG->wwwroot . '/theme/savoir/pages/opencatalog.php');\n }\n }\n }\n return $this->render_from_template('core/navbar', $navbar);\n }", "public function indexAction() {\n // (first) sub form\n if (!$form = $this->getCurrentSubForm()) {\n $form = $this->getNextSubForm();\n }\n\n //Zend_Debug::dump($form);\n //$form->setDecorators(array(array('ViewScript', array('viewScript' => 'formScript.phtml'))));\n //$this->view->form = $this->getForm()->prepareSubForm($form);\n $form = $this->getForm()->prepareSubForm($form);\n $this->view->form = $form;\n }", "public function form(): void {\n include \"admin\" . DS . \"form.php\";\n }", "public function addMetaFieldsToAddForm()\n\t{\n\t\t$interval = $this->getMetaFields('interval');\n\t\t$animation = $this->getMetaFields('animation');\n\n\t\t?>\n\t\t\t<div class=\"form-field\">\n\t\t\t\t<label for=\"interval\">Tijd tussen slides</label>\n\t\t\t\t<input name=\"interval\" id=\"interval\" type=\"text\" value=\"<?php echo $interval;?>\" size=\"40\">\n\t\t\t\t<p class=\"description\">De tijd tussen slides in milliseconden (1000ms = 1s).</p>\n\t\t\t</div>\n\t\t\t<div class=\"form-field\">\n\t\t\t\t<label for=\"animation\">Animatie</label>\n\t\t\t\t<select name=\"animation\" id=\"animation\">\n\t\t\t\t\t<option <?php selected($animation, 'slide'); ?> value=\"slide\">Slide</option>\n\t\t\t\t\t<option <?php selected($animation, 'fade'); ?> value=\"fade\">Fade</option>\n\t\t\t\t</select>\n\t\t\t\t<p class=\"description\">Selecteer de animatie die gebruikt wordt door de slideshow.</p>\n\t\t\t</div>\n\t\t<?php\n\t}", "public function admin_add_new() {\n ?>\n <div class=\"wrap\">\n <h2><?php _e('Add New Form', 'swpm-form-builder'); ?></h2>\n <?php\n include_once( SWPM_FORM_BUILDER_PATH . 'includes/admin-new-form.php' );\n ?>\n </div>\n <?php\n }", "function form($instance) {\n\t\techo '<p>Place on any sidebar to display Twitter feed.</p>';\n\t}", "protected function form()\n {\n return Admin::form(Series::class, function (Form $form) {\n\n $form->display('id', 'ID');\n $form->select('brand_id', '所属品牌')->options(Brand::getSeletOptions());\n $form->text('name', '车系名称');\n\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "function item_form()\n\t{\n\t\t$its = new item_search($this->pg);\n\t\t$its->action = $_SESSION['root_admin'].'utilities/preorder.php';\n\t\t$its->form_head();\n\t\t$its->upc();\n\t\t$its->title();\n\t\t$its->platform();\n\t\t$its->form_foot('upc');\n\t}", "public function create()\n {\n return view('backend.seos.form', [\n 'nameAction' => 'Новое правило SEO',\n 'controllerPathList' => self::$path,\n 'controllerAction' => 'add',\n 'controllerEntity' => new SEO()\n ]);\n }", "public function indexAction() {\n\t\t $this->view->form = $form;\n\t}", "protected function loadForm(): void\n {\n $rbtHiddenValues = [\n ['label' => BL::lbl('Hidden'), 'value' => 1],\n ['label' => BL::lbl('Published'), 'value' => 0],\n ];\n $internalLinks = BackendSpotlightsModel::getInternalLinks();\n\n // create form\n $this->form = new BackendForm('add');\n\n $this->form->addText('title', null, null, 'form-control title', 'form-control danger title');\n $this->form->addEditor('text');\n $this->form->addText('link', null, null);\n $this->form->addDropdown('categories', $this->categories);\n $this->form->addImage('image');\n $this->form->addRadiobutton('hidden', $rbtHiddenValues, 0);\n $this->form->addText('link_title');\n $this->form->addCheckbox('external_link');\n $this->form->addText('external_url');\n $this->form->addDropdown('internal_url', $internalLinks, '',\n false,\n 'chzn-select'\n )->setDefaultElement('');\n\n // meta\n $this->meta = new BackendMeta($this->form, null, 'title', true);\n\n }", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: run demo');\r\n\r\n $this->addElement('static', 'progressBar',\r\n 'Your progress meter looks like:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('reset','process'));\r\n }", "public function form()\r\n {\r\n $this->switch('field_select_create', Support::trans('main.select_create'))\r\n ->default(admin_setting('field_select_create'));\r\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 searchForm()\n {\n $dimensionsOptions = $this->GoogleApi->getDimensionsOptions();\n $operatorOptions = $this->GoogleApi->getOperatorOptions();\n $this->set(\n compact(\n 'dimensionsOptions',\n 'operatorOptions'\n )\n );\n }", "function gtags_add_tags_form() {\n\tglobal $show_group_add_form;\n\tif ($show_group_add_form) return;\n\t$show_group_add_form = true;\n\t?>\n\t<p class=\"editfield\">\n\t\t<label for=\"group-tags\">Mots-clés</label>\n\t\t<input type=\"text\" name=\"group-tags\" id=\"group-tags\" value=\"<?php gtags_group_tags() ?>\" />\n\t\tSéparez les mots-clés par des virgules\n\t\t<?php gtags_show_tags_chooser(); ?>\n\t\t\n\t</p>\n\t<?php\n}", "public function showRegistrationForm()\n {\n $navList = Nav::getMenuTree(Nav::orderBy('sort', 'asc')->get()->toArray());\n $categories = Category::getMenuTree(Category::orderBy('sort', 'asc')->select('id', 'name', 'pid')->get()->toArray());\n View::share([\n 'nav_list' => $navList,\n 'category_list' => $categories,\n ]);\n return view('auth.register');\n }", "function extra_tablenav( $which ) {\r\r\n\t\t\t\t\r\r\n\t\tif( $which == 'top' ) {\r\r\n\t\t\techo '<label class=\"description\">' . __( 'Search' ) . ':</label> <input type=\"text\" name=\"log_s\" id=\"\" placeholder=\"' . __( 'Search in logs', 'sc_chat' ) . '\" value=\"'. ( ( !empty( $_REQUEST['log_s'] ) ) ? $_REQUEST['log_s'] : '' ) . '\" />';\r\r\n\t\t}\r\r\n\t\t\r\r\n\t}", "public function begin ( \\r8\\Form $form )\n {\n $this->fields = new \\r8\\Template\\Collection;\n }", "public function addForm()\n {\n $this->getState()->template = 'displaygroup-form-add';\n $this->getState()->setData([\n 'help' => $this->getHelp()->link('DisplayGroup', 'Add')\n ]);\n }", "public function register_menu()\n {\n return view('admin.menu_builder.register_menu');\n }", "function tos_menu() {\n\t\tadd_options_page(\n\t\t\t'AdControl',\n\t\t\t'AdControl',\n\t\t\t'manage_options',\n\t\t\t'adcontrol',\n\t\t\tarray( $this, 'userdash_tos' )\n\t\t);\n\t}", "public function getDashboardCinemaForm()\n {\n return view('backend.mediatypes.cinemas.cinema-addform', ['cinema_options' => $this->cinema_options,\n 'cinema_category'=> $this->cinema_category,\n 'additionlsAds' => $this->additionlsAds]\n );\n }", "function searchBox() {\n\t\tglobal $wgUseTwoButtonsSearchForm; ?>\n\t\t<form action=\"<?php $this->text('wgScript'); ?>\" class=\"searchform\">\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchInput(array('id' => 'searchInput', 'class' => 'form-control')); ?>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchButton('go', array( 'class' => 'btn btn-primary' )); ?>\n\t\t\t</div>\n\t\t</form><?php\n\t}", "function inline_archive_search_form() {\n\n\techo '<div class=\"archive-search clear\">';\n\t\techo '<h2 class=\"search\">';\n\t\t\techo apply_filters( 'inline_search_archives_text', __( 'You can also search the site using the form below:', 'inline' ) );\n\t\techo '</h2>';\n\t\t\n\t\t\tget_search_form();\n\t\t\t\n\techo '</div><!--end .archive-search-->';\n\n}", "public function getSelectForm(){\n \treturn View::make('Checklist.SelectForm',array(\n \t\t'MainMenu' => View::make('Menu.MainMenu',array(\n \t\t\t'MoreMenu' => Util::getMenu()\n \t\t)),\n \t\t'Areas' => Util::getSelectAreas(),\n \t\t'Tiendas' => Util::getSelectTiendas()\n \t));\n }", "function oneshop_admin()\r\n{\r\n\t// Add a new submenu under Options:\r\n\tadd_menu_page('Custom Forms For 1ShoppingCart.com', 'Signup Form', 7, '1shop_custom_forms', 'oneshop_custom_forms_settings');\r\n}", "public function addForm()\n {\n return view('postsAdmin._postsAdmin_addForm');\n }", "protected function form()\n {\n return Admin::form(Headline::class, function (Form $form) {\n\n $form->display('id', 'ID');\n\n $form->text('title', 'Judul');\n $form->trumbowyg('excerpt','Summary');\n $form->image('image','Photo')->move('/headline');\n $form->trumbowyg('content','Content')->attribute(['id' => 'trumbowyg']);;\n\n //DPD use mutli select\n $form->select('daerah_id','DPD')->options(Daerah::all()->pluck('name', 'id')); \n\n $states = [\n 'on' => ['value' => 1, 'text' => 'enable', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => 'disable', 'color' => 'danger'],\n ];\n $form->text('uri','External Url');\n $form->switch('publish','Publish')->states($states);\n $form->hidden('author_id')->value(Admin::user()->id);\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "public function addform()\n {\n \n //$this->session_manager->validateFashion(__METHOD__);\n \n $data['cate'] = $this->promo->promoSliderOptionCuisine($by_id=null,$platform=1);\n $data['promo_duration'] = $this->promo->promoDurationOption();\n $data['admin_info'] = $this->promo->adminInfo();\n \n $data['title_type']= 'New Promo Form';\n $data ['content_file']= 'promo_new';\n $data['pageheader'] = \"Add Promo\";\n $data['breadCrumbs'] = '<li class=\"breadcrumb-item\"><a href=\"'.site_url(\"jollofadmin/promos\").'\">Promos</a></li> <li class=\"breadcrumb-item active\">Add Promo</li>';\n $data['mainmenu'] = \"promos\";\n $this->load->view('jollof_admin/layout', $data);\n }", "public function formNavBar(){\n $lang = 'en'; //<--- Assessment 1: 2 - Basic variable type, scope (only accessible in this method)\n if($this->locale === 'hi'){\n $lang = 'hi';\n }\n echo \"<div class='ui inverted menu'>\n <a class='\".$this->home.\" item'\n href='../../pages/landingPage/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"Home\"].\n \"</a>\n <a class='\".$this->viewPosts.\" item' \n href='../../pages/viewAllPosts/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"View-Posts\"].\n \"</a>\n <a class='\".$this->myPosts.\" item' \n href='../../pages/viewUserPosts/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"User-Posts\"].\n \"</a>\n <a class='\".$this->newPost.\" item' \n href='../../pages/newPost/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"New-Post\"].\n \"</a>\n <div class='right menu'>\";\n\n\n if($this->session==='Login')\n {\n echo \"<a class='\".$this->login.\" item'\n href='../../pages/loginPage/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][$this->session].\n \"</a>\";\n }\n else {\n echo \"<a class='\".$this->login.\" item'\n href='?logout=1'>\".\n $this->ini_array[$this->locale][$this->session].\n \"</a>\";\n }\n\n\n if(!(isset($_SESSION['loggedIn'])&&($_SESSION['loggedIn']))){\n echo \"<a class='\".$this->register.\" item' \n href='../../pages/registrationPage/\".$lang.\".php'>\".\n $this->ini_array[$this->locale][\"Register\"].\n \"</a>\";\n }\n echo \"</div>\n </div>\";\n }", "public function addMenuItem() {\n add_menu_page(__('Visual Chat', 'WP_Visual_Chat'), 'Visual Chat', 'visual_chat', 'vcht-console', array($this, 'viewChatBackend'), 'dashicons-format-chat');\n }", "public function addform()\n\t{\n\t\t\t$this->setMethod('get');\n\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($_GET);\n\t\t\t//echo \"</pre>\";\n\t\t\t$this->addElement('radio', 'Status', array(\n\t\t\t\t'required' => true,\n 'separator' => '&nbsp;',\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t'1' => IN_PROGRESS,\n\t\t\t\t\t'2' => 'Closed'\n\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t\t'separator' => '',\n\t\t\t\t'value' => '1' //key of multiOption\n\t\t\t));\n\n\t\t\n\t\t\n\t\t$this->addElement ( \n 'multiCheckbox', 'Functional_type', \n array (\n \n\t\t//'setrequired' => true,\n 'multiOptions' => array(\n '1' => 'Pre Installation',\n '2' => 'Installation',\n '3' => 'Post Installation'\n \n ),\n 'separator' => '',\n\t\t\t\t\t//'value' => '2' // select these 2 values\n )\n);\n\t\n\t\t\t\t\n\t\t\t$this->addElement('submit', 'submit', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t\t\t'label' => 'Submit',\n\t\t\t));\n\t\t\t\n\t\t\t// And finally add some CSRF protection\n\t\t\t$this->addElement('hash', 'csrf', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t));\t\n\t}", "public function addTab(Event $event)\n {\n $sectionNav = $event->getParam('section_nav');\n $sectionNav['teams'] = 'Teams'; // @translate\n $event->setParam('section_nav', $sectionNav);\n }", "public function controlNav()\n\t\t{\n\t\t\tif(isset($_SESSION['validar']))\n\t\t\t{\n\t\t\t\t\n\n\t\t\t\techo '<li class=\"nav-item\">\n\t \t\t<a href=\"index.php?action=dashboard\" class=\"nav-link\">\n\t \t\t\t<i class=\"nav-icon fa fa-dashboard\"></i>\n\t \t\t\t<p>Dashboard</p>\n\t \t\t</a>\n\t \t\t </li>\n\t \t\t <li class=\"nav-item\">\n\t \t\t<a href=\"index.php?action=alumnas\" class=\"nav-link\">\n\t \t\t\t<i class=\"nav-icon fa fa-user-plus\"></i>\n\t \t\t\t<p>Alumnas</p>\n\t \t\t</a>\n\t \t\t </li>\n\t \t\t <li class=\"nav-item\">\n\t \t\t<a href=\"index.php?action=grupos\" class=\"nav-link\">\n\t \t\t\t<i class=\"nav-icon fa fa-users\"></i>\n\t \t\t\t<p>Grupos</p>\n\t \t\t</a>\n\t \t\t </li>\n\t \t\t <li class=\"nav-item\">\n\t \t\t<a href=\"index.php?action=lugares_admin\" class=\"nav-link\">\n\t \t\t\t<i class=\"nav-icon fa fa-ticket\"></i>\n\t \t\t\t<p>Lugares</p>\n\t \t\t</a>\n\t \t\t </li>\n\n\t \t\t <li class=\"nav-item\">\n\t\t\t\t <a onclick=\"confirmarSesion();\" href=\"index.php\" class=\"nav-link\">\n\t\t\t\t <i class=\"nav-icon fa fa-sign-out\"></i>\n\t\t\t\t \t<p>Logout</p>\n\t\t\t\t </a>\n\t\t\t\t </li>';\n\t\t\t \n\t\t\t}\n\t\t\t\n\t\t}", "public function configure() {\n\n\n\n $this->setWidgets(array(\n 'prueba' => new sfWidgetFormInputText()));\n \n $this->setWidgets(array(\n 'autocompletar' => new sfWidgetFormChoiceAutocomplete(array(\n 'choices'=>array('uno','dos','tres','cuatro'),\n 'source'=>array('uno','dos')\n \n ))));\n \n \n\n\n\n $this->widgetSchema->setLabels(array(\n \n 'prueba' => 'Prueba',\n 'autocompletar'=> 'Autocompletar'\n ));\n \n $this->embedForm('logo',new LoginForm());\n\n }", "public function optin_form_list()\n {\n // lightbox/modal display should be default.\n $optin_type = 'lightbox';\n\n echo '<div class=\"mailoptin-optin-themes mailoptin-optin-clear\">';\n OptinThemesRepository::listing_display_template($optin_type);\n echo '</div>';\n }", "function getNavBar(){\r\n $barContent = \"\";\r\n \r\n $barContent .= '<ul class=\"nav navbar-nav\">';\r\n\t$barContent .= '<li><a class=\"active\" href=\"index.php\"><b>Home</b></a></li>';\r\n\t$barContent .= '<li><a class=\"active\" href=\"#\" onClick=\"ContactHandler()\"><b>Contact Info</b></a></li>';\r\n $barContent .= '</ul>';\r\n \r\n\t//$barContent .= '<li><a href=\"#\" onClick=\"QRHandler()\"><b>CreateQR</b></a></li>';\r\n\t//$barContent .= '<li><a href=\"#\" onClick=\"EventHandler()\"><b>Events</b></a></li>';\r\n\t//$barContent .= '<li><a href=\"#\" onClick=\"PastEventHandler()\"><b>Events</b></a></li>';\r\n \r\n $barContent .= '<ul class=\"nav navbar-nav navbar-right\">';\r\n if(isUserLoggedIn())\r\n {\r\n\t\t$barContent .= '<li><a href=\"#\" onclick=\"javascript: performLogout()\"><b>Logout</b></a></li>';\r\n\t}\r\n else {\r\n $barContent .= '<div class=\"navbar-collapse collapse\"><form class=\"navbar-form navbar-right\" onSubmit=\"return false;\">' .\r\n\t\t\t\t\t\t\t'<div class=\"form-group\"><input type=\"text\" name=\"loginUsername\" id=\"loginUsername\" class=\"form-control\" placeholder=\"Email/User\"> </div>' .\r\n\t\t\t\t\t\t\t'<div class=\"form-group\"><input type=\"password\" name=\"password\" id=\"password\" class=\"form-control\" placeholder=\"Password\"> </div>' .\r\n\t\t\t\t\t\t\t'&nbsp;&nbsp;<button class=\"btn btn-success\" type=\"submit\" onclick=\"attemptLogin()\"><i class=\"glyphicon glyphicon-share icon-white\"></i>&nbsp;&nbsp;<b>Sign in</b></button>' .\r\n\t\t\t\t\t\t\t'&nbsp;&nbsp;<button class=\"btn btn-primary\" onClick=\"showRegistrationModal()\"/><i class=\"glyphicon glyphicon-user icon-white\"></i>&nbsp;&nbsp;<b>Sign Up!</b></button>' .\r\n\t\t\t\t\t\t'</form></div>';\r\n }\r\n $barContent .= '</ul>';\r\n\r\n return $barContent;\r\n}", "protected function form() {\n\t\treturn Admin::form(WhtSpiderLogModel::class,function (Form $form) {\n\t\t\t$directors = [\n\t\t\t\t'成功' => 1,\n\t\t\t\t'失败' => 0,\n\t\t\t];\n\t\t\t$form->select('status','状态')->options($directors);\n\t\t\t$form->setAction('采集');\n\t\t});\n\t}", "public function addMenu()\n {\n $wpMenu = [\n [\n 'Bolsista',\n 'Bolsista',\n 'edit_pages',\n 'bolsista',\n $this,\n 'doAction',\n 'dashicons-format-aside',\n 2\n ]\n ];\n $wpSubMenu = [];\n $this->addMenuItem($wpMenu, $wpSubMenu);\n }", "public function add_options_html() {\n\n $has_nav = ( count( $this->pre_tabs ) > 1 ) ? true : false;\n $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';\n $ajax_class = ( $this->args['ajax_save'] ) ? ' csf-save-ajax' : '';\n $sticky_class = ( $this->args['sticky_header'] ) ? ' csf-sticky-header' : '';\n $wrapper_class = ( $this->args['framework_class'] ) ? ' '. $this->args['framework_class'] : '';\n\n echo '<div class=\"csf csf-theme-'. $this->args['theme'] .' csf-options'. $wrapper_class .'\" data-slug=\"'. $this->args['menu_slug'] .'\" data-unique=\"'. $this->unique .'\">';\n\n $notice_class = ( ! empty( $this->notice ) ) ? ' csf-form-show' : '';\n $notice_text = ( ! empty( $this->notice ) ) ? $this->notice : '';\n\n echo '<div class=\"csf-form-result csf-form-success'. $notice_class .'\">'. $notice_text .'</div>';\n\n $error_class = ( ! empty( $this->errors ) ) ? ' csf-form-show' : '';\n\n echo '<div class=\"csf-form-result csf-form-error'. $error_class .'\">';\n if( ! empty( $this->errors ) ) {\n foreach ( $this->errors as $error ) {\n echo '<i class=\"csf-label-error\">!</i> '. $error .'<br />';\n }\n }\n echo '</div>';\n\n echo '<div class=\"csf-container\">';\n\n echo '<form method=\"post\" action=\"\" enctype=\"multipart/form-data\" id=\"csf-form\">';\n\n echo '<input type=\"hidden\" class=\"csf-section-id\" name=\"csf_transient[section]\" value=\"1\">';\n wp_nonce_field( 'csf_options_nonce', 'csf_options_nonce' );\n\n echo '<div class=\"csf-header'. esc_attr( $sticky_class ) .'\">';\n echo '<div class=\"csf-header-inner\">';\n\n echo '<div class=\"csf-header-left\">';\n echo '<h1>'. $this->args['framework_title'] .'</h1>';\n echo '</div>';\n\n echo '<div class=\"csf-header-right\">';\n\n echo ( $has_nav && $this->args['show_all_options'] ) ? '<div class=\"csf-expand-all\" title=\"'. esc_html__( 'show all options', 'csf' ) .'\"><i class=\"fa fa-outdent\"></i></div>' : '';\n\n echo ( $this->args['show_search'] ) ? '<div class=\"csf-search\"><input type=\"text\" placeholder=\"'. esc_html__( 'Search option(s)', 'csf' ) .'\" /></div>' : '';\n\n echo '<div class=\"csf-buttons\">';\n echo '<input type=\"submit\" name=\"'. $this->unique .'[_nonce][save]\" class=\"button button-primary csf-save'. $ajax_class .'\" value=\"'. esc_html__( 'Save', 'csf' ) .'\" data-save=\"'. esc_html__( 'Saving...', 'csf' ) .'\">';\n echo ( $this->args['show_reset_section'] ) ? '<input type=\"submit\" name=\"csf_transient[reset_section]\" class=\"button button-secondary csf-reset-section csf-confirm\" value=\"'. esc_html__( 'Reset Section', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'\">' : '';\n echo ( $this->args['show_reset_all'] ) ? '<input type=\"submit\" name=\"csf_transient[reset]\" class=\"button button-secondary csf-warning-primary csf-reset-all csf-confirm\" value=\"'. esc_html__( 'Reset All', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'\">' : '';\n echo '</div>';\n\n echo '</div>';\n\n echo '<div class=\"clear\"></div>';\n echo '</div>';\n echo '</div>';\n\n echo '<div class=\"csf-wrapper'. $show_all .'\">';\n\n if( $has_nav ) {\n echo '<div class=\"csf-nav csf-nav-options\">';\n\n echo '<ul>';\n\n $tab_key = 1;\n\n foreach( $this->pre_tabs as $tab ) {\n\n $tab_error = $this->error_check( $tab );\n $tab_icon = ( ! empty( $tab['icon'] ) ) ? '<i class=\"'. $tab['icon'] .'\"></i>' : '';\n\n if( ! empty( $tab['subs'] ) ) {\n\n echo '<li class=\"csf-tab-depth-0\">';\n\n echo '<a href=\"#tab='. $tab_key .'\" class=\"csf-arrow\">'. $tab_icon . $tab['title'] . $tab_error .'</a>';\n\n echo '<ul>';\n\n foreach ( $tab['subs'] as $sub ) {\n\n $sub_error = $this->error_check( $sub );\n $sub_icon = ( ! empty( $sub['icon'] ) ) ? '<i class=\"'. $sub['icon'] .'\"></i>' : '';\n\n echo '<li class=\"csf-tab-depth-1\"><a id=\"csf-tab-link-'. $tab_key .'\" href=\"#tab='. $tab_key .'\">'. $sub_icon . $sub['title'] . $sub_error .'</a></li>';\n\n $tab_key++;\n }\n\n echo '</ul>';\n\n echo '</li>';\n\n } else {\n\n echo '<li class=\"csf-tab-depth-0\"><a id=\"csf-tab-link-'. $tab_key .'\" href=\"#tab='. $tab_key .'\">'. $tab_icon . $tab['title'] . $tab_error .'</a></li>';\n\n $tab_key++;\n }\n\n }\n\n echo '</ul>';\n\n echo '</div>';\n\n }\n\n echo '<div class=\"csf-content\">';\n\n echo '<div class=\"csf-sections\">';\n\n $section_key = 1;\n\n foreach( $this->pre_sections as $section ) {\n\n $onload = ( ! $has_nav ) ? ' csf-onload' : '';\n $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class=\"csf-icon '. $section['icon'] .'\"></i>' : '';\n\n echo '<div id=\"csf-section-'. $section_key .'\" class=\"csf-section'. $onload .'\">';\n echo ( $has_nav ) ? '<div class=\"csf-section-title\"><h3>'. $section_icon . $section['title'] .'</h3></div>' : '';\n echo ( ! empty( $section['description'] ) ) ? '<div class=\"csf-field csf-section-description\">'. $section['description'] .'</div>' : '';\n\n if( ! empty( $section['fields'] ) ) {\n\n foreach( $section['fields'] as $field ) {\n\n $is_field_error = $this->error_check( $field );\n\n if( ! empty( $is_field_error ) ) {\n $field['_error'] = $is_field_error;\n }\n\n $value = ( ! empty( $field['id'] ) && isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : '';\n\n CSF::field( $field, $value, $this->unique, 'options' );\n\n }\n\n } else {\n\n echo '<div class=\"csf-no-option csf-text-muted\">'. esc_html__( 'No option provided by developer.', 'csf' ) .'</div>';\n\n }\n\n echo '</div>';\n\n $section_key++;\n }\n\n echo '</div>';\n\n echo '<div class=\"clear\"></div>';\n\n echo '</div>';\n\n echo '<div class=\"csf-nav-background\"></div>';\n\n echo '</div>';\n\n if( ! empty( $this->args['show_footer'] ) ) {\n\n echo '<div class=\"csf-footer\">';\n\n echo '<div class=\"csf-buttons\">';\n echo '<input type=\"submit\" name=\"csf_transient[save]\" class=\"button button-primary csf-save'. $ajax_class .'\" value=\"'. esc_html__( 'Save', 'csf' ) .'\" data-save=\"'. esc_html__( 'Saving...', 'csf' ) .'\">';\n echo ( $this->args['show_reset_section'] ) ? '<input type=\"submit\" name=\"csf_transient[reset_section]\" class=\"button button-secondary csf-reset-section csf-confirm\" value=\"'. esc_html__( 'Reset Section', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'\">' : '';\n echo ( $this->args['show_reset_all'] ) ? '<input type=\"submit\" name=\"csf_transient[reset]\" class=\"button button-secondary csf-warning-primary csf-reset-all csf-confirm\" value=\"'. esc_html__( 'Reset All', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'\">' : '';\n echo '</div>';\n\n echo ( ! empty( $this->args['footer_text'] ) ) ? '<div class=\"csf-copyright\">'. $this->args['footer_text'] .'</div>' : '';\n\n echo '<div class=\"clear\"></div>';\n echo '</div>';\n\n }\n\n echo '</form>';\n\n echo '</div>';\n\n echo '<div class=\"clear\"></div>';\n\n echo ( ! empty( $this->args['footer_after'] ) ) ? $this->args['footer_after'] : '';\n\n echo '</div>';\n\n }", "public function add (){\n $this->layout='dashboard';\n $this->addLeaves();\n }", "public function add()\n\t{\n\t\t// Add a Sub-Nav Link\n\t\tEvent::add('ushahidi_action.nav_admin_settings', array($this, '_settings_link'));\n\t\tEvent::add('ushahidi_action.nav_main_top', array($this, '_top_nav_link'));\t\t\n\t\t// Only add the events if we are on the main controller\n\t\tif (Router::$controller == 'main')\n\t\t{\n\t\t\tswitch (Router::$method)\n\t\t\t{\n\n\t\t\t\t// Hook into the main dashboard\n\t\t\t\tcase 'index':\n\t\t\t\t\tplugin::add_stylesheet('flickrwijit/media/css/style');\n\t\t\t\t\tplugin::add_stylesheet('../media/css/picbox/picbox');\n\t\t\t\t\tplugin::add_javascript('../media/js/picbox');\n\t\t\t\t\tEvent::add('ushahidi_action.main_sidebar', array($this, '_display_flickrwiji'));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telseif (Router::$controller == 'flickrwijit')\n\t\t{ \t\n\t\t\t// Add Flickrwijit to settings page\n\t\t\tswitch(Router::$method) \n\t\t\t{\n\t\t\t\tcase 'index':\n\t\t\t\t\t\n\t\t\t\t\t//Hook js and css files into flickrwijit page\n\t\t\t\t\tplugin::add_stylesheet('flickrwijit/media/css/style');\n\t\t\t\t\tplugin::add_stylesheet('../media/css/picbox/picbox');\n\t\t\t\t\tplugin::add_javascript('../media/js/picbox');\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function searchForm(){\n\t echo '<input type=\"text\" id=\"myInput\" title=\"Mit Esc-Taste eingabe löschen\" placeholder=\"Suche..\">';?>\n\t\t<script>\n\t\t\t$(\"#myInput\").on(\"focus\", function() //1 click inside the form folds it together\n\t\t\t{\n\t\t\t\tvar value = this.value.toLowerCase().trim();\n\t\t\t\t$(\"#talents li\").hide(200);\n\t\t\t\t $(\"h2.tal_header\").removeClass('active');\n\t\t\t})\n\t\t\t \n\t\t\t$(\"#myInput\").on(\"keyup\", function() //watch search input\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tvar value = this.value.toLowerCase().trim();\n\t\t\t\t\tif(value.length > 1 ) //must be more than 1 key\n\t\t\t\t\t{\n\t\t\t\t\t\t$(\"#talents li\").addClass('show').filter(function() {\t\t\t\t\t \n\t\t\t\t\t\t\treturn $(this).text().toLowerCase().trim().indexOf(value) == -1;\n\t\t\t\t\t\t}).removeClass('show');\n\t\t\t\t\t }\n\t\t\t\t\t else \n\t\t\t\t\t {\n\t\t\t\t\t\t $(\"#talents li\").removeClass('show');\n\t\t\t\t\t }\n\t\t\t\t});\n\t\t</script><?php\n }", "function add_my_forms( $forms ) {\n $forms['form_slug'] = \"Coinwink\";\n return $forms;\n}", "public function form()\r\n {\r\n $this->tab(admin_trans('menu.titles.email_test'), function () {\r\n $this->text('to', admin_trans('email-test.labels.to'))->required();\r\n $this->text('title', admin_trans('email-test.labels.title'))->default('这是一条测试邮件')->required();\r\n $this->editor('body', admin_trans('email-test.labels.body'))->default(\"这是一条测试邮件的正文内容<br/><br/>正文比较长<br/><br/>非常长<br/><br/>测试测试测试\")->required();\r\n });\r\n }", "public function addSiteFormElement(Event $event){\n $form = $event->getTarget();\n $form->add([\n 'name' => 'team',\n 'type' => TeamSelect::class,\n 'options' => [\n 'label' => 'Teams', // @translate\n 'chosen' => true,\n ],\n 'attributes' => [\n 'multiple' => true,\n 'id' => 'team_selected'\n ],\n ]);\n\n }", "public function create()\n {\n $this->data[\"form\"] = \"add\";\n return view(\"admin.pages.services\",$this->data);\n }", "public function new_sidebar() {\n\t\t?>\n\t\t<form method=\"post\" action=\"options.php\" id=\"add-new-sidebar\">\n\t\t\t<?php settings_fields( 'ups_sidebars_options' ); ?>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\">Name</th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input id=\"ups_sidebars[add_sidebar]\" class=\"text\" type=\"text\" name=\"ups_sidebars[add_sidebar]\" value=\"\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<p class=\"submit\" style=\"padding: 0;\">\n\t\t\t\t<input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Add Sidebar', self::TEXT_DOMAIN) ?>\" />\n\t\t\t</p>\n\t\t</form>\n\t\t<?php\n\t}", "public function addform()\n\t{\n\t\t\t$this->setMethod('post');\n\n\t\t\t\n\t\t\t$this->addElement('radio', 'status', array(\n\t\t\t\t'required' => true,\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t'1' => IN_PROGRESS,\n\t\t\t\t\t'2' => 'Closed'\n\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t'value' => '1' //key of multiOption\n\t\t\t));\n\t\t\n\t\t\n\n\t\t\t$this->addElement('textarea', 'Comment', array( \n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'maxlength' =>'50',\n\t\t\t\t\t\n\t\t\t\t\t'class' => 'validate[required] text-input',\n\t\t\t\t\t'decorators'=>Array(\n\t\t\t\t\t\t'ViewHelper','Errors'\n\t\t\t\t\t),\t\t \n\t\t\t));\n\n\t\t\t\n\n\t\t\t\n\n\n\t\n\t\t\t\t\n\t\t\t$this->addElement('submit', 'submit', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t\t\t'label' => 'Submit',\n\t\t\t));\n\t\t\t\n\t\t\t// And finally add some CSRF protection\n\t\t\t$this->addElement('hash', 'csrf', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t));\t\n\t}", "public function addPage()\n {\n $placements = array(\n array('id' => 'ads.leftbar.banner', 'name' => $this->translate->translate('Left Side')),\n array('id' => 'ads.rightbar.banner', 'name' => $this->translate->translate('Right Side'))\n );\n $this->putitem(\"placements\", $placements);\n\n $view_types = array(\n array('id' => 'serial', 'name' => 'Serial'),\n array('id' => 'carrousel', 'name' => 'Carroussel')\n );\n $this->putitem(\"view_types\", $view_types);\n\n parent::addPage();\n }", "public function show(form $form)\n {\n //\n }", "public function form(){\n\t\t$highlight = $this->highlight;\n\n\t\treturn view('admin.mediahighlight.form', compact('highlight'));\n\t}", "private function StartForm(){\r\n\t\t\t$this->formHTML .= \"<form method=\\\"{$this->method}\\\" action=\\\"{$this->action}\\\"\";\r\n\t\t\tif($this->enctype){\r\n\t\t\t\t$this->formHTML .= \" enctype=\\\"{$this->enctype}\\\"\";\r\n\t\t\t}\r\n\t\t\t$this->formHTML .= \" name=\\\"{$this->formName}\\\" class=\\\"c{$this->formName}\\\" id=\\\"i{$this->formName}\\\"\";\r\n\t\t\t$this->formHTML .= \">\";\r\n\t\t}", "public function ServiceAreasPageForm()\n\t{\n\t\t$fields = Forms\\FieldList::create();\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('FirstName')) $fields->push( Forms\\TextField::create(\"FirstName\", \"First Name\") );\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('LastName')) $fields->push( Forms\\TextField::create(\"LastName\", \"Last Name\") );\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('Address')) $fields->push( Forms\\TextField::create(\"Address\", \"Address\") );\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('Address2')) $fields->push( Forms\\TextField::create(\"Address2\", \"Address (line 2)\") );\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('City')) $fields->push( Forms\\TextField::create(\"City\", \"City\") );\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('State')) $fields->push( Forms\\DropdownField::create(\"State\", \"State\", FormUtilities::GetStates())\n\t\t\t->setValue(\"PA\")\n\t\t\t->setEmptyString('-- Select --') );\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('ZipCode')) $fields->push( Forms\\TextField::create(\"ZipCode\", \"Zip Code\") );\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('Email')) $fields->push( Forms\\EmailField::create(\"Email\", \"Email Address\") );\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('Phone')) $fields->push( Forms\\TextField::create(\"Phone\", \"Phone Number\") );\n\t\tif ($this->getParentServiceAreasPage()->isFieldEnabled('Comments')) $fields->push( Forms\\TextareaField::create(\"Comments\", \"Comments\") );\n\t\t\t \n\t\t// create a form action\n\t\t$actions = Forms\\FieldList::create(\n\t\t\tForms\\FormAction::create(\"SubmitServiceAreasForm\", \"Submit\")\n\t\t);\n\t\t\n\t\t$validator = FormUtilities::RequiredFields($fields,$this->getParentServiceAreasPage()->getRequiredFields());\n\t\t\n\t\treturn Forms\\Form::create(\n\t\t\t$this, \n\t\t\t\"ServiceAreasPageForm\", \n\t\t\t$fields, \n\t\t\t$actions,\n\t\t\t$validator\n\t\t);\n\t}", "function ShowNavBar()\n{\n $navBar = \"\";\n //Navigation Start\n $navBar .= \"<nav class=\\\"navbar navbar-default navbar-sticky bootsnav\\\">\";\n $navBar .=\"<div class=\\\"container\\\">\";\n // Début Header Navigation\n $navBar .= \"<div class=\\\"navbar-header\\\">\";\n $navBar .=\"<button type=\\\"button\\\" class=\\\"navbar-toggle\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbar-menu\\\">\";\n $navBar .= \"<i class=\\\"fa fa-bars\\\"></i>\";\n $navBar .= \"</button>\";\n $navBar .= \"<a class=\\\"navbar-brand\\\" href=\\\"index.php\\\"><img src=\\\"./img/logo.png\\\" class=\\\"logo\\\" alt=\\\"Logo du site\\\"></a>\";\n $navBar .=\"</div>\";\n // Fin Header Navigation\n\n\n $navBar .= \"<div class=\\\"collapse navbar-collapse\\\" id=\\\"navbar-menu\\\">\";\n $navBar .= \"<ul class=\\\"nav navbar-nav navbar-left\\\" data-in=\\\"fadeInDown\\\" data-out=\\\"fadeOutUp\\\">\";\n $navBar .= \"<li \".SetActivePage(\"index\") . \"><a href=\\\"index.php\\\">Accueil</a></li>\";\n //Affiche les liens de connexion et d'inscription si l'utilisateur n'est pas connecté\n if (!IsUserLoggedIn()) {\n $navBar .= \"<li \" .SetActivePage(\"login\") . \">\";\n $navBar .=\"<a href=\\\"login.php\\\">Se connecter</a>\";\n $navBar .=\"</li>\";\n $navBar .= \"<li \" .SetActivePage(\"signup\"). \">\";\n $navBar .= \"<a href=\\\"signup.php\\\">S'inscrire</a>\";\n $navBar .= \"</li>\";\n }\n //Sinon affiche les liens correspondant au type de l'utilisateur\n else \n {\n switch (GetUserType()) \n {\n //Affiche les liens correspondant au type Chercheur\n case \"Chercheur\":\n $navBar .= \"<li \" .SetActivePage(\"annonces\") . \">\";\n $navBar.= \"<a href=\\\"annonces.php\\\">Annonces</a>\";\n $navBar.= \"</li>\";\n $navBar.= \"<li \" .SetActivePage(\"wishlist\") . \">\";\n $navBar.= \"<a href=\\\"wishlist.php?idU=\".GetUserId().\"\\\">Ma Wishlist</a>\";\n $navBar.= \"</li>\";\n break;\n //Affiche les liens correspondant au type Annonceur\n case \"Annonceur\":\n $navBar .= \"<li \";\n if (isset($_GET['idU']))\n $navBar .= SetActivePage(\"annonces\");\n $navBar .= \">\";\n $navBar.=\"<a href=\\\"annonces.php?idU=\" . GetUserId() . \"\\\">Mes Annonces</a>\";\n $navBar.=\"</li>\";\n $navBar.=\"<li \" .SetActivePage(\"creer-annonce\"). \">\";\n $navBar.=\"<a href=\\\"creer-annonce.php\\\">Créer une annonce</a>\";\n $navBar.=\"</li>\";\n break;\n //Affiche les liens correspondant au type Administrateur\n case \"Admin\":\n $navBar .= \"<li \";\n if(isset($_GET['gestion']) && $_GET['gestion'] == \"utilisateurs\") \n $navBar .=SetActivePage(\"administration\"); \n $navBar .= \">\";\n $navBar.=\"<a href=\\\"administration.php?gestion=utilisateurs\\\">Gérer les utilisateurs</a>\";\n $navBar.=\"</li>\";\n $navBar.=\"<li \";\n if(isset($_GET['gestion']) && $_GET['gestion'] == \"motscles\") $navBar .= SetActivePage(\"administration\"); \n $navBar .= \">\";\n $navBar.=\"<a href=\\\"administration.php?gestion=motscles\\\">Gérer les mots-clés</a>\";\n $navBar.=\" </li>\";\n break;\n }\n \n $navBar .= \"</ul>\";\n $navBar.=\"<ul class=\\\"nav navbar-nav navbar-right\\\" data-in=\\\"fadeInDown\\\" data-out=\\\"fadeOutUp\\\">\"; \t\n $navBar.=\"<li><a href=\\\"logout.php\\\">Se déconnecter</a></li>\";\n }\n $navBar .= \"<li \".SetActivePage(\"faq\").\">\";\n $navBar .= \"<a href=\\\"faq.php\\\">Aide</a>\";\n $navBar.= \"</li>\";\n $navBar .= \"</ul>\";\n $navBar.=\"</div>\";\n $navBar.= \"</div>\" ;\n $navBar.=\"</nav>\";\n\n //Echo le contenu HTML de la barre de navigation\n echo $navBar;\n}", "function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\n}", "public function get_add(){\n return View::make('stance.add')->with('title', 'Submit a Stance')->with('subtitle', 'Try to make your views official party Stances');;\n }" ]
[ "0.6047477", "0.58284336", "0.5738976", "0.56589955", "0.5631364", "0.56055796", "0.5585889", "0.55814785", "0.5566831", "0.55440766", "0.55274457", "0.5517016", "0.5504683", "0.5503433", "0.5472094", "0.54703414", "0.54465395", "0.5439266", "0.5425039", "0.542043", "0.5418768", "0.54075724", "0.5389524", "0.53807074", "0.5368296", "0.5364093", "0.53523964", "0.534884", "0.53435117", "0.5336437", "0.533059", "0.53217894", "0.5318462", "0.53159106", "0.52832615", "0.5282757", "0.52802616", "0.5278194", "0.527249", "0.52617097", "0.52401537", "0.52257544", "0.52197695", "0.52176976", "0.5214711", "0.5209987", "0.51996464", "0.5196651", "0.51958305", "0.5190286", "0.51812255", "0.5176238", "0.5154563", "0.51488954", "0.5144016", "0.5140175", "0.51366293", "0.5129484", "0.512626", "0.5124796", "0.512242", "0.5114548", "0.5113107", "0.5112525", "0.5110083", "0.51062286", "0.5105674", "0.51038104", "0.50986254", "0.5095616", "0.507885", "0.5076439", "0.50735015", "0.5068457", "0.5061", "0.505794", "0.50518763", "0.5051826", "0.50493026", "0.5048752", "0.5043718", "0.5041129", "0.5040134", "0.50395274", "0.50361043", "0.5034943", "0.503272", "0.50251734", "0.5022114", "0.5017085", "0.50136226", "0.50120384", "0.50077516", "0.50069326", "0.50058526", "0.500578", "0.5000713", "0.50000274", "0.49905926", "0.49845922" ]
0.5033412
86
Start a new menu, 2 levels: If not in submenu, create a dropdown menu, oterwize create hover menu.
public function beginMenu ($name = null, $url = null, $options = [], $linkOptions = [], $listOptions = []) { $res = ''; if ($this->_level == 0) { $options = is_array($name) ? $name : [] ; $options = $this->addClass ($options, ['nav', 'navbar-nav']); $res = $this->Html->tag('ul', null, $options) ; } else { $linkOptions += [ 'data-toggle' => 'dropdown', 'role' => 'button', 'aria-haspopup' => 'true', 'aria-expanded' => 'false', 'escape' => false ] ; $link = $this->Html->link ($name.(array_key_exists ('caret', $linkOptions) ? $linkOptions['caret'] : '<span class="caret"></span>'), $url ? $url : '#', $linkOptions); $options = $this->addClass ($options, 'dropdown') ; $listOptions = $this->addClass ($listOptions, 'dropdown-menu') ; $res = $this->Html->tag ('li', null, $options).$link.$this->Html->tag ('ul', null, $listOptions); } $this->_level += 1 ; return $res ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create_menu() {\n\t\tif ( get_network()->site_id !== get_current_blog_id() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//create new top-level menu\n\t\tadd_management_page(\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t'manage_options',\n\t\t\t'sync-newsletter',\n\t\t\tarray( $this, 'display_submenu_page' ),\n\t\t\t6\n\t\t);\n\t}", "public function create_menu()\n\t{\n\t\t$obj = $this; // PHP 5.3 doesn't allow $this usage in closures\n\n\t\t// Add main menu page\n\t\tadd_menu_page(\n\t\t\t'Testimonials plugin', // page title\n\t\t\t'Testimonials', // menu title\n\t\t\t'manage_options', // minimal capability to see it\n\t\t\t'jststm_main_menu', // unique menu slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('main_menu'); // render main menu page template\n\t\t\t},\n\t\t\tplugins_url('images/theater.png', dirname(__FILE__)), // dashboard menu icon\n\t\t\t'25.777' // position in the dahsboard menu (just after the Comments)\n\t\t);\n\t\t// Add help page\n\t\tadd_submenu_page(\n\t\t\t'jststm_main_menu', // parent page slug\n\t\t\t'Testimonials plugin help', // page title\n\t\t\t'What is this?', // menu title\n\t\t\t'manage_options', // capability\n\t\t\t'jststm_help', // slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('help_page');\n\t\t\t}\n\t\t);\n\t}", "public static function wpa_add_menu() {\n add_menu_page('Main Menu','Home','manage_options','Sub-menu');\n add_submenu_page('Sub-menu','User List','User List','manage_options','menu-list',array( __CLASS__,'wpa_page_file_path'));\n add_submenu_page('Sub-menu','Add User','Add User','manage_options','menu-add',array(__CLASS__,'wpa_page_file_path'));\n }", "public function create_submenu() {\n\t\tadd_submenu_page(\n\t\t\t'options-general.php',\n\t\t\t__('CHAOS Client','wpchaosclient'),\n\t\t\t__('CHAOS','wpchaosclient'),\n\t\t\t'manage_options',\n\t\t\t$this->menu_page,\n\t\t\tarray(&$this,'create_submenu_page')\n\t\t);\n\t}", "function addMenu()\n{\n add_menu_page (\"Members and Email\", \"Members / Email\", 4, \"members-email-1\", \"MeMenu\" );\n add_submenu_page(\"members-email-1\", \"Email List\", \"Email\", 4, \"members-email-sub-1\", \"MeMenuSub1\");\n add_submenu_page(\"members-email-1\", \"Tracking\", \"Tracking Scripts\", 4, \"tracking-scripts-1\", \"MeMenuSub2\");\n\n\n}", "public static function createMenu(){\n $perms = Security::getPermsFromConnectedUser() ?? [];\n\n $menuData = self::$_menuData;\n\n $actualUri = self::$_actualUri;\n $menuListBuilder = [];\n $html = '';\n foreach ($menuData as $link => $data) {\n if (!empty($data['menuData'])){\n //TODO : check the min-status\n if ($data['menuData']['visible'] \n && (\n array_key_exists(\"all_perms\", $perms) \n || array_key_exists($link, $perms)\n || $link === '/admin/dashboard'\n || $link === '/'\n )) {\n $subSectionSelected = false;\n\n //Create the sub-menu\n $htmlChildren = '';\n if (!empty($data['menuData']['children'])) {\n $htmlChildren = '<ul>';\n foreach ($data['menuData']['children'] as $id => $linkChild) {\n if (array_key_exists(\"all_perms\", $perms) \n || array_key_exists($linkChild, $perms)) {\n if ($actualUri === $linkChild) {\n $subSectionSelected = true;\n }\n $classChildren = $actualUri == $linkChild ? ' class=\"selected\"' : '';\n $htmlChildren .= '<li' . $classChildren . '><a href=\"' . $linkChild . '\">' . $menuData[$linkChild]['label'] . '</li>';\n }\n }\n $htmlChildren .= '</ul>';\n }\n\n $class = ' class=\"'\n . ($actualUri == $link ? 'selected ' : '')\n . ($subSectionSelected ? 'subChildrenSelected ' : '')\n . '\"';\n\n $html = '<li' . $class . '><a href=\"' . $link . '\">'\n . '<img src=\"' . Routing::getBaseUrl() . '/public/images/icons/' . $data['menuData']['icon'] . '.png\" alt=\"\" class=\"icon iconWhite\"><p>' . $data['label'] . '</p></a>'\n . '</a>';\n\n //Adding the sub-menu\n $html .= $htmlChildren;\n\n $html .= '</li>';\n if (array_key_exists($data['menuData']['listId'], $menuListBuilder)) {\n $menuListBuilder[$data['menuData']['listId']] .= $html;\n } else {\n $menuListBuilder[$data['menuData']['listId']] = $html;\n }\n }\n }\n }\n\n $html = '';\n foreach ($menuListBuilder as $listId => $htmlValue) {\n $html.= '<ul id=\"'.$listId.'\">'.$htmlValue.'</ul>';\n }\n\n $htmlMenu = '<nav id=\"back-mainPage-menu\" class=\"d-none d-lg-flex\">'\n . $html . '</nav>'\n . '<nav id=\"back-mainPage-menuResponsive\" class=\"d-block d-lg-none hidden\">'\n . $html . '</nav>';\n echo $htmlMenu;\n }", "public function makeMenu() {}", "function boj_menuexample_create_menu() {\r\n\t\r\n\t//create a submenu under Settings\r\n\tadd_options_page( 'Leo Plugin Settings Page', 'Menu Example Settings', 'manage_options', 'settings-submenu', 'boj_menuexample_settings_page' );\r\n\t\r\n}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n if( !$this->mega_menu_active ) {\n\n\n $indent = str_repeat(\"\\t\", $depth);\n\n $output .= \"\\n$indent<ul class=\\\"sub-menu\\\">\\n\";\n }\n }", "public function add_admin_menu() {\n\n extract( $this->args );\n\n if( $menu_type === 'submenu' ) {\n\n $menu_page = call_user_func( 'add_submenu_page', $menu_parent, $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );\n\n } else {\n\n $menu_page = call_user_func( 'add_menu_page', $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ), $menu_icon, $menu_position );\n\n if( ! empty( $this->args['show_sub_menu'] ) && count( $this->pre_tabs ) > 1 ) {\n\n // create submenus\n $tab_key = 1;\n foreach ( $this->pre_tabs as $section ) {\n\n call_user_func( 'add_submenu_page', $menu_slug, $section['title'], $section['title'], $menu_capability, $menu_slug .'#tab='. $tab_key, '__return_null' );\n\n if( ! empty( $section['subs'] ) ) {\n $tab_key += ( count( $section['subs'] )-1 );\n }\n\n $tab_key++;\n\n }\n\n remove_submenu_page( $menu_slug, $menu_slug );\n\n }\n\n if( ! empty( $menu_hidden ) ) {\n remove_menu_page( $menu_slug );\n }\n\n }\n\n add_action( 'load-'. $menu_page, array( &$this, 'add_page_on_load' ) );\n\n }", "public function add_menus()\n {\n }", "function setup_menus() {\n\t$icon = '';\n\tadd_menu_page('Site Features', 'Site Features', 'publish_pages', 'pop_site_features', '', $icon, 36);\n\tadd_submenu_page('pop_site_features','','','publish_pages','pop_site_features','homepage_touts_page');\n\tadd_submenu_page('pop_site_features', 'Homepage Features', 'Homepage Features', 'publish_pages', 'pop_homepage_features', 'homepage_features_page');\n\tadd_submenu_page('pop_site_features', 'Homepage Ticker', 'Homepage Ticker', 'publish_pages', 'pop_homepage_ticker', 'homepage_ticker_page');\n\tadd_submenu_page('pop_site_features', 'Homepage Touts', 'Homepage Touts', 'publish_pages', 'pop_homepage_touts', 'homepage_touts_page');\n\tadd_submenu_page('pop_site_features', 'Movement Touts', 'Movement Touts', 'publish_pages', 'pop_movement_touts', 'movement_touts_page');\n\tadd_submenu_page('pop_site_features', 'PoP & Local Events', 'PoP & Local Events', 'publish_pages', 'pop_events', 'movement_events_page');\n\tadd_submenu_page('pop_site_features', 'Season of 1000', 'Season of 1000 Promises', 'publish_pages', 'season1000', 'season_1000_page');\n}", "protected function createMenu(){\n $menu_name = static::MENU_NAME;\n $menu_tree = \\Drupal::menuTree();\n $parameters = $menu_tree->getCurrentRouteMenuTreeParameters($menu_name);\n \n // if tree is not empty, create the menu\n if ($tree = $menu_tree->load($menu_name, $parameters)){\n $manipulators = [ // Only show links that are accessible for the current user.\n ['callable' => 'menu.default_tree_manipulators:checkAccess'],\n // Use the default sorting of menu links.\n ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],\n ];\n\n $tree = $menu_tree->transform($tree, $manipulators);\n return $menu_tree->build($tree);\n }\n\n // return false if tree is empty\n return false;\n }", "function bethel_add_submenu_to_post() {\n\tglobal $post;\n\t$menu_items = get_menu_items_for_current_page();\n\tif ($menu_items && sizeof($menu_items) > 1) {\n\t\techo '<ul class=\"bethel-subpages-nav\">';\n\t\tforeach ($menu_items as $menu_item) {\n\t\t\techo '<li'.($menu_item->object_id == $post->ID ? ' class=\"current-item\"' : '').\">\";\n\t\t\techo \"<a href=\\\"{$menu_item->url}\\\">{$menu_item->title}</a>\";\n\t\t\techo '</li>';\n\t\t}\n\t\techo '</ul>';\n\t} elseif (is_page() && $post->post_parent) {\n $menu_items = get_pages (array('parent' => $post->post_parent, 'sort_order' => 'menu_order', 'hierarchical' => false));\n if ($menu_items && sizeof($menu_items) > 1) {\n echo '<ul class=\"bethel-subpages-nav\">';\n foreach ($menu_items as $menu_item) {\n echo '<li'.($menu_item->ID == $post->ID ? ' class=\"current-item\"' : '').\">\";\n echo '<a href=\"'.get_permalink($menu_item->ID).\"\\\">{$menu_item->post_title}</a>\";\n echo '</li>';\n }\n echo '</ul>';\n }\n }\n}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n\n\t\t$indent = str_repeat( \"\\t\", $depth );\n\t\t$submenu = ($depth > 0) ? ' sub-menu' : '';\n\t\t$output\t .= \"\\n$indent<ul class=\\\"dropdown-menu$submenu depth_$depth\\\">\\n\";\n\n\t}", "function cjpopups_admin_menu_page(){\n\t\tglobal $menu;\n\t\t$main_menu_exists = false;\n\t\tforeach ($menu as $key => $value) {\n\t\t\tif($value[2] == 'cj-products'){\n\t\t\t\t$main_menu_exists = true;\n\t\t\t}\n\t\t}\n\t\tif(!$main_menu_exists){\n\t\t\t$menu_icon = cjpopups_item_path('admin_assets_url', 'img/menu-icon.png');\n\t\t\tadd_menu_page( 'CSSJockey', 'CSSJockey', 'manage_options', 'cj-products', 'cjpopups_cj_products', $menu_icon);\n\t\t}\n\t\t$menu_icon = cjpopups_item_path('admin_assets_url', 'img/menu-icon.png');\n\t add_submenu_page( 'cj-products', cjpopups_item_info('page_title'), cjpopups_item_info('menu_title'), 'manage_options', cjpopups_item_info('page_slug'), 'cjpopups_admin_page_setup');\n\t do_action('cjpopups_admin_menu_hook');\n\t //remove_submenu_page( 'cj-products', 'cj-products' );\n}", "function addSubMenus() {\n \tif($this->checkPermissions()) {\n\t\t \t$first_item_parent = $this->isTeacherFeatures() ? 'lepress-my-subscriptions' : 'lepress';\n\t\t \tadd_submenu_page('lepress', __(\"Manage my subscriptions\", lepress_textdomain),__(\" My subscriptions\", lepress_textdomain).'<span id=\"lepress-student-subs-count\"></span>',3, $first_item_parent,array(&$this, 'getSubMenuPageContent' ));\n\t\t \tadd_submenu_page('lepress', __(\"Manage assignments\", lepress_textdomain),__(\"Assignments\", lepress_textdomain).'<span id=\"lepress-student-assignments-count\"></span>',3, 'lepress-assignments',array(&$this, 'getSubMenuPageContent' ));\n\t\t \t//add_submenu_page('lepress', __(\"Manage groups\", lepress_textdomain),__(\"My groups\", lepress_textdomain),3, 'lepress-groups',array(&$this, 'getSubMenuPageContent' ));\n \t}\n }", "function start_lvl( &$output, $depth = 0, $args = [] ) {\n\t\t$tabs = str_repeat( \"\\t\", $depth );\n\t\t// If we are about to start the first submenu, we need to give it a dropdown-menu class\n\t\tif ( $depth == 0 || $depth == 1 ) { // really, level-1 or level-2, because $depth is misleading here (see note above)\n\t\t\t$output .= \"\\n{$tabs}<ul class=\\\"dropdown-menu\\\">\\n\";\n\t\t} else {\n\t\t\t$output .= \"\\n{$tabs}<ul>\\n\";\n\t\t}\n\t\treturn;\n\t}", "function beginSubMenu() {\n\t\treturn html_ao('ul', array('class' => 'submenu'));\n\t}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n $indent = str_repeat(\"\\t\", $depth);\n $output .= \"\\n$indent<ul class=\\\"vertical menu\\\" data-submenu>\\n\";\n }", "static function create_menu() {\n add_submenu_page('plugins.php', 'Luminous Settings', 'Luminous settings',\n 'administrator', 'luminous-handle', 'luminouswp::settings_view');\n }", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\t$indent = str_repeat(\"\\t\", $depth);\n\t\t$output .= \"\\n$indent<ul class=\\\"vertical menu\\\" data-submenu>\\n\";\n\t}", "function WPLMS_menu_MainMenu(){\n\n add_menu_page('WP LMS School', 'WP LMS School', 'administrator',WPLMS_PLUGIN_ID,'WPLMS_dashboard');\n add_submenu_page(WPLMS_PLUGIN_ID,'Students', 'Students', 'administrator','students','WPLMS_students');\n add_submenu_page(WPLMS_PLUGIN_ID,'Add Course', 'Add Course', 'administrator','course','WPLMS_addcourse');\n add_submenu_page(WPLMS_PLUGIN_ID,'Add Modules', 'Add Modules', 'administrator','modules','WPLMS_addmodule');\n\n add_submenu_page(WPLMS_PLUGIN_ID, false, '<span class=\"wpcw_menu_section\" style=\"display: block; margin: 1px 0 1px -5px; padding: 0; height: 1px; line-height: 1px; background: #CCC;\"></span>', 'manage_options', '#', false);\n\n add_submenu_page(WPLMS_PLUGIN_ID,'Quiz Summary', 'Quiz Summary', 'administrator','WPLMS_quizSummary','WPLMS_quizSummary');\n add_submenu_page(WPLMS_PLUGIN_ID,'Question Pool', 'Question Pool', 'administrator','WPLMS_questionPool','WPLMS_questionPool');\n\n //No Menu\n //add_submenu_page(WPLMS_PLUGIN_ID,'Add Quiz', 'Add Quiz', 'administrator', 'add_quiz', 'WPLMS_addQuiz');\n\n add_submenu_page(null,'Stud','Student Courses', 'administrator','studentCourses','WPLMS_studentcourses');\n add_submenu_page(null,'Add Question', 'Add Question', 'administrator', 'add_question', 'WPLMS_addQuestion');\n //add_submenu_page(null,'Add Quiz', 'Add Quiz', 'administrator', 'WPLMS_addQuiz', 'WPLMS_addQuiz');\n\n\n //add_submenu_page('onlineschool','Packages', 'Packages', 'administrator','addpackage','addpackage_code');\n //add_submenu_page('onlineschool','Sets', 'Sets', 'administrator','sets','sets_code');\n //add_submenu_page('options.php','Students', 'Student Courses', 'administrator','studentCourses','studentCourses_code');\n}", "function mnu_EchoSubMenu($menustructure, $pageid, $level, $bHasSubmenu)\n{\n\n global $usr;\n\n if (!$bHasSubmenu) {\n for ($i = 0, $bSubmenu = false; ($i < count($menustructure)) && ($bSubmenu == false); $i++) {\n if (isset($menustructure[$i]['submenu'])) {\n $bSubmenu = true;\n }\n }\n }\n\n if (!$bHasSubmenu) {\n $cssclass = 'group';\n } else {\n if ($level == 1) {\n $cssclass = 'group';\n } else {\n $cssclass = 'subgroup';\n }\n }\n\n for ($i = 0; $i < count($menustructure); $i++) {\n if (!isset($menustructure[$i]['newwindow']))\n $menustructure[$i]['newwindow'] = false;\n if ($menustructure[$i]['newwindow'] == true)\n $target_blank = \"target='_blank'\";\n else\n $target_blank = \"\";\n if ($menustructure[$i]['visible'] == true) {\n if (!isset($menustructure[$i]['icon']))\n $menustructure[$i]['icon'] = false;\n if ($menustructure[$i]['icon']) {\n $icon = 'style=\"background-image: url(' . $menustructure[$i]['icon'] . '-18.png);background-repeat:no-repeat;\"';\n } else\n $icon = \"\";\n if (!isset($menustructure[$i]['onlylogged']))\n $menustructure[$i]['onlylogged'] = false;\n if ($menustructure[$i]['onlylogged'] == true && $usr == false) {\n continue;\n }\n\n if ($menustructure[$i]['siteid'] === $pageid || is_array($menustructure[$i]['siteid']) && in_array($pageid, $menustructure[$i]['siteid'])) {\n echo '<li class=\"' . $cssclass . ' ' . $cssclass . '_active \"><a ' . $target_blank . ' href=\"' . $menustructure[$i]['filename'] . '\">' . htmlspecialchars($menustructure[$i]['menustring'], ENT_COMPAT, 'UTF-8') . '</a></li>' . \"\\n\";\n } else {\n echo '<li class=\"' . $cssclass . '\"><a ' . $icon . ' ' . $target_blank . ' href=\"' . $menustructure[$i]['filename'] . '\">' . htmlspecialchars($menustructure[$i]['menustring'], ENT_COMPAT, 'UTF-8') . '</a></li>' . \"\\n\";\n }\n\n if (isset($menustructure[$i]['submenu'])) {\n mnu_EchoSubMenu($menustructure[$i]['submenu'], $pageid, $level + 1, true);\n }\n }\n }\n}", "function fsgs_navigation_custom_menu_item(custom_menu_item $menunode, $parent, $pmasternode) {\n global $PAGE, $CFG;\n\n static $submenucount = 0;\n\n if ($menunode->has_children()) {\n $submenucount++;\n $url = $CFG->wwwroot;\n if ($menunode->get_url() !== null) {\n $url = new moodle_url($menunode->get_url());\n } else {\n $url = null;\n }\n if ($parent > 0) {\n $masternode = $pmasternode->add(fsgs_local_navigation_get_string($menunode->get_text()), $url, navigation_node::TYPE_CONTAINER);\n $masternode->title($menunode->get_title());\n } else {\n $masternode = $PAGE->navigation->add(fsgs_local_navigation_get_string($menunode->get_text()), $url, navigation_node::TYPE_CONTAINER);\n $masternode->title($menunode->get_title());\n $masternode->showinflatnavigation = true;\n }\n foreach ($menunode->get_children() as $menunode) {\n fsgs_navigation_custom_menu_item($menunode, $submenucount, $masternode);\n }\n } else {\n $url = $CFG->wwwroot;\n if ($menunode->get_url() !== null) {\n $url = new moodle_url($menunode->get_url());\n } else {\n $url = null;\n }\n if ($parent) {\n $childnode = $pmasternode->add(navigation_get_string($menunode->get_text()), $url, navigation_node::TYPE_CUSTOM);\n $childnode->title($menunode->get_title());\n } else {\n $masternode = $PAGE->navigation->add(fsgs_local_navigation_get_string($menunode->get_text()), $url, navigation_node::TYPE_CONTAINER);\n $masternode->title($menunode->get_title());\n $masternode->showinflatnavigation = true;\n }\n }\n\n return true;\n}", "public function menu( )\n {\n\n if( $this->view->isType( View::SUBWINDOW ) )\n {\n $view = $this->view->newWindow('WebfrapMainMenu', 'Default');\n }\n else if( $this->view->isType( View::MAINTAB ) )\n {\n $view = $this->view->newMaintab('WebfrapMainMenu', 'Default');\n $view->setLabel('Explorer');\n }\n else\n {\n $view = $this->view;\n }\n\n $view->setTitle('Webfrap Main Menu');\n\n $view->setTemplate( 'webfrap/menu/modmenu' );\n\n $modMenu = $view->newItem( 'modMenu', 'MenuFolder' );\n $modMenu->setData( DaoFoldermenu::get('webfrap/root',true) );\n\n }", "function createAboutUsMenu () {\n $menu_name = __('About Us',CARE_TEXTDOMAIN);\n $menu_exists = wp_get_nav_menu_object( $menu_name );\n\n if( !$menu_exists) {\n $menu_id = wp_create_nav_menu($menu_name);\n\n // Set up default menu items\n wp_update_nav_menu_item($menu_id, 0, array(\n 'menu-item-title' => __('About Care',CARE_TEXTDOMAIN),\n // 'menu-item-classes' => 'home',\n 'menu-item-url' => home_url( '/about-care-centre/' ), \n 'menu-item-status' => 'publish'));\n }\n}", "function ShowMainHorMenu()\n{\n\t$str1=\"select * from menu where vermenu=1 order by menuorder\";\n\t$result=mysql_query($str1) or\n\t\tdie(mysql_error());\n\t$submenucount=0;\n\t$mid=0;\n\techo('<DIV class=ddsmoothmenu id=main-nav><UL>');\n\twhile($row=mysql_fetch_array($result))\n\t{\n\t\tif ($row['parent']==0)\n\t\t{\n\t\t\tif ($submenucount>0) //Ket thuc menu con, bat dau muc menu moi\n\t\t\t{\n\t\t\t\techo('</UL>');\n\t\t\t\techo('</LI>');\n\t\t\t}\t\n\t\t\tif ($row['menutype']==3) //Muc khong co lien ket\n\t\t\t{\n\t\t\t\techo('<LI><A href=\"\">'.$row['menutitle'].'</A>');\n\t\t\t\t$submenucount=0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/////////////////////////Cac muc chinh\n\t\t\t\t\n\t\t\t\techo('<LI><A title=\"\" href=\"'.PageLink($row['menutype'],$row['menuid'],$row['parent'],$row['link']));\n\t\t\t\techo('\">'.$row['menutitle'].'</A> </LI>');\n\t\t\t\t$submenucount=0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/////////////////////////// Cac muc con\n\t\t\tif ($submenucount==0)///Muc con dau tien\n\t\t\t{\n\t\t\t\techo('<UL>');\n\t\t\t\techo('<LI><A id=\"cat'.$mid.'\" title=\"\" href=\"'.PageLink($row['menutype'],$row['menuid'],$row['parent'],$row['link']));\n\t\t\t\techo('\">'.$row['menutitle'].'</A> </LI>');\n\t\t\t\t$submenucount++;\n\t\t\t\t$mid++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo('<LI><A id=\"cat'.$mid.'\" title=\"\" href=\"'.PageLink($row['menutype'],$row['menuid'],$row['parent'],$row['link']));\n\t\t\t\techo('\">'.$row['menutitle'].'</A> </LI>');\n\t\t\t\t$submenucount++;\n\t\t\t\t$mid++;\n\t\t\t}\t\n\t\t}\n\t}\n\tmysql_free_result($result);\n\techo('</UL></DIV>');\n}", "function jigoshop_admin_menu() {\n\tglobal $menu;\n\t\n\t$menu[] = array( '', 'read', 'separator-jigoshop', '', 'wp-menu-separator jigoshop' );\n\t\n add_menu_page(__('Jigoshop'), __('Jigoshop'), 'manage_options', 'jigoshop' , 'jigoshop_dashboard', jigoshop::plugin_url() . '/assets/images/icons/menu_icons.png', 55);\n add_submenu_page('jigoshop', __('Dashboard', 'jigoshop'), __('Dashboard', 'jigoshop'), 'manage_options', 'jigoshop', 'jigoshop_dashboard'); \n add_submenu_page('jigoshop', __('General Settings', 'jigoshop'), __('Settings', 'jigoshop') , 'manage_options', 'settings', 'jigoshop_settings');\n add_submenu_page('jigoshop', __('System Info','jigoshop'), __('System Info','jigoshop'), 'manage_options', 'sysinfo', 'jigoshop_system_info');\n add_submenu_page('edit.php?post_type=product', __('Attributes','jigoshop'), __('Attributes','jigoshop'), 'manage_options', 'attributes', 'jigoshop_attributes');\n}", "function create_admin_menu()\n {\n add_menu_page(\n 'Mattevideo Exercises', //page title\n 'Mattevideo Exercises', //menu title\n 'manage_options', //capabilities\n 'mattevideo_exercise', //menu slug\n array($this, 'mattevideo_exercise') //function\n );\n add_submenu_page('mattevideo_exercise', //parent slug\n 'Create Exercise', //page title\n 'Create Exercise', //menu title\n 'manage_options', //capability\n 'create_exercise', //menu slug\n array($this, 'create_exercise')); //function\n }", "function erp_build_menu( $items, $active, $component, $dropdown = false ) {\n\n\n //check capability\n $items = array_filter( $items, function( $item ) {\n if ( !isset( $item['capability'] ) ) {\n return false;\n }\n return current_user_can( $item['capability'] );\n } );\n\n //sort items for position\n uasort( $items, function ( $a, $b ) {\n return $a['position'] > $b['position'];\n } );\n\n $html = '<ul class=\"erp-nav -primary erp-hide-print\">';\n\n if ( $dropdown ) {\n $html = '<ul class=\"erp-nav-dropdown\">';\n }\n foreach ( $items as $item ) {\n\n $link = add_query_arg( [ 'page' => 'erp-'.$component, 'section' => $item['slug'] ], admin_url( 'admin.php' ) );\n\n $class = $active == $item['slug'] ? 'active ' : '';\n\n if ( $dropdown ) {\n $link = add_query_arg( [ 'page' => 'erp-' . $component, 'section' => $item['parent'], 'sub-section' => $item['slug'] ], admin_url( 'admin.php' ) );\n $class .= ( !empty( $_GET['sub-section'] ) && $_GET['sub-section'] == $item['slug'] ) ? 'active ' : '';\n }\n\n if ( !empty( $item['direct_link'] ) ) {\n $link = $item['direct_link'];\n }\n\n $submenu = '';\n\n if ( isset( $item['submenu'] ) ) {\n $class.= \"dropdown-nav\";\n $submenu .= erp_build_menu( $item['submenu'], $active, $component, true );\n }\n\n $html .= sprintf( '<li class=\"%s\"><a href=\"%s\">%s</a>%s</li>', $class, $link, $item['title'], $submenu );\n }\n\n $html .= '</ul>';\n\n return $html;\n}", "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 am2_vanity_create_menu() {\n\t//create new top-level menu\n\t//add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );\n\tadd_submenu_page('options-general.php','Vanity URL Settings', 'Vanity URL Settings', 'administrator', 'am2-vanity-settings-page', 'am2_vanity_settings_page' );\n\t//call register settings function\n\tadd_action( 'admin_init', 'register_am2_vanity_settings' );\n}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "function jm_create_menu(){\n\tadd_submenu_page('themes.php', 'Super Themer Options', 'Theme Options', 'manage_options', 'jm_settings_page', 'jm_settings_page');\n\tadd_action('admin_init', 'jm_register_settings');\n}", "function add_sub_menu($arr)\n\t{\n\t\tif (empty($arr[\"parent\"]))\n\t\t{\n\t\t\t$arr[\"parent\"] = $this->menu_id;\n\t\t}\n\t\t$arr[\"sub_menu_id\"] = $arr[\"name\"];\n\t\t$baseurl = $this->cfg[\"baseurl\"];\n\t\t$rv = '<a class=\"menuItem\" href=\"\" onclick=\"return false;\"\n\t\t\t onmouseover=\"menuItemMouseover(event, \\''.$arr[\"sub_menu_id\"].'\\');\">\n\t\t\t\t<span class=\"menuItemText\">'.$arr[\"text\"].'</span>\n\t\t\t\t<span class=\"menuItemArrow\"><img style=\"border:0px\" src=\"'.$baseurl.\n\t\t\t\t'/automatweb/images/arr.gif\" alt=\"\"></span></a>';\n\n\t\tif (isset($this->menus[$arr[\"parent\"]]))\n\t\t{\n\t\t\t$this->menus[$arr[\"parent\"]] .= $rv;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->menus[$arr[\"parent\"]] = $rv;\n\t\t}\n\t\t\n\t\tif (!isset($this->items[$arr[\"name\"]]))\n\t\t{\n\t\t\t$this->items[$arr[\"name\"]] = array();\n\t\t}\n\t\tif (!isset($this->items[$arr[\"parent\"]]))\n\t\t{\n\t\t\t$this->items[$arr[\"parent\"]] = array();\n\t\t}\n\t\t$arr[\"html\"] = html::href(array(\"caption\" => $arr[\"text\"]));\n\t\t$this->items[$arr[\"parent\"]][] = $arr;\n\t}", "public static function GenerateNavbar($menu)\n\t\t{\n\t\t\t$default = array(\n\t\t\t\t'id' => null,\n\t\t\t\t'class' => null,\n\t\t\t\t'wrapper' => 'nav',\n\t\t\t\t'create_url' => function ($url) {\n\t\t\t\t\treturn $url;\n\t\t\t\t},\n\t\t\t);\n\t\t\t\n\t\t\t$menu = array_replace_recursive($default, $menu);\n\t\t\t\n\t\t\t// Function to create urls\n\t\t\t$createUrl = $menu['create_url'];\n\t\t\t\n\t\t\t// Create the ul li menu from the array, use an anonomous recursive function that returns an array of values.\n\t\t\t$createMenu = function ($items, $callback) use (&$createMenu, $createUrl) \n\t\t\t{\n\t\t\t\t$html = null;\n\t\t\t\t$hasItemIsSelected = false;\n\t\t\t\t\n\t\t\t\tforeach ($items as $item) \n\t\t\t\t{\n\t\t\t\t\t// has submenu, call recursivly and keep track on if the submenu has a selected item in it.\n\t\t\t\t\t$submenu = null;\n\t\t\t\t\t$selectedParent = null;\n\t\t\t\t\t$hasSubmenu \t= null; \n\t\t\t\t\t\n\t\t\t\t\tif (isset($item['submenu'])) \n\t\t\t\t\t{\n\t\t\t\t\t\t$hasSubmenu = \" &#9662;\";\n\t\t\t\t\t\tlist($submenu, $selectedParent) = $createMenu($item['submenu']['items'], $callback);\n\t\t\t\t\t\t$selectedParent = $selectedParent ? \"selected-parent \" : null;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (isset($item['url']))\n\t\t\t\t\t\t// Check if the current menuitem is selected\n\t\t\t\t\t\t$selected = $callback($item['url']) ? \"selected \" : null;\n\t\t\t\t\telse\n\t\t\t\t\t\t$selected = NULL; \n\t\t\t\t\t\n\t\t\t\t\t// Is there a class set for this item, then use it\n\t\t\t\t\t$class = isset($item['class']) && ! is_null($item['class']) ? $item['class'] : null;\n\t\t\t\t\t\n\t\t\t\t\t// Prepare the class-attribute, if used\n\t\t\t\t\t$class = ($selected || $selectedParent || $class) ? \" class='{$selected}{$selectedParent}{$class}' \" : null;\n\t\t\t\t\t\n\t\t\t\t\t// Add the menu item\n\t\t\t\t\t$url = isset($item['url']) ? $createUrl($item['url']) : NULL;\n\t\t\t\t\tif (!isset($item['show']) || $item['show'] == TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($url)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$active = (basename($_SERVER['REQUEST_URI']) == $url || (strtok($url,'?') == basename($_SERVER['PHP_SELF']) && $hasSubmenu) ? '' : '');\n\t\t\t\t\t\t\tif ($active == '▸ ') \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($hasSubmenu)\n\t\t\t\t\t\t\t\t\tself::$parent = $item; \n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tself::$child = $item; \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .= \"\\n<li{$class}>$active<a href='{$url}' title='{$item['title']}'>{$item['text']}{$hasSubmenu}</a>{$submenu}</li>\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$html .= \"\\n<li{$class}>{$item['text']}{$hasSubmenu}{$submenu}</li>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// To remember there is selected children when going up the menu hierarchy\n\t\t\t\t\tif ($selected) {\n\t\t\t\t\t\t$hasItemIsSelected = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Return the menu\n\t\t\t\treturn array(\"\\n<ul>$html</ul>\\n\", $hasItemIsSelected);\n\t\t\t};\n\t\t\t\n\t\t\t// Call the anonomous function to create the menu, and submenues if any.\n\t\t\tlist($html, $ignore) = $createMenu($menu['items'], $menu['callback']);\n\t\t\t\n\t\t\t\n\t\t\t// Set the id & class element, only if it exists in the menu-array\n\t\t\t$id = isset($menu['id']) ? \" id='{$menu['id']}'\" : null;\n\t\t\t$class = isset($menu['class']) ? \" class='{$menu['class']}'\" : null;\n\t\t\t$wrapper = $menu['wrapper'];\n\t\t\t\n\t\t\treturn \"\\n<{$wrapper}{$id}{$class}>{$html}</{$wrapper}>\\n\";\n\t\t}", "function _add_post_type_submenus()\n {\n }", "public function createMenu()\n {\n $parent = $this->Menu()->findOneBy(['label' => 'Artikel']);\n\n $this->createMenuItem(\n [\n 'label' => 'Custom sort',\n 'controller' => 'CustomSort',\n 'action' => 'Index',\n 'active' => 0,\n 'class' => 'sprite-blue-document-text-image',\n 'parent' => $parent,\n 'position' => 6,\n ]\n );\n }", "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 }", "public function addMenus()\n {\n // The settings submenu\n add_submenu_page(\n 'comotive-newsletter',\n 'Newsletter &raquo; Einstellungen',\n 'Dienst-Einstellungen',\n 'administrator',\n 'newsletter-settings',\n array($this->core->getSettings(), 'displayBackend')\n );\n\n // Remove first menu, if settings are not ready\n if (!$this->core->isWorkingServiceAvailable() || $this->core->isEditorDeactivated()) {\n global $submenu;\n unset($submenu['comotive-newsletter'][0]);\n }\n }", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n // depth dependent classes\n $indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n $display_depth = ( $depth + 1); // because it counts the first submenu as 0\n $classes = array(\n 'sub-menu',\n ( $display_depth % 2 ? 'menu-odd' : 'menu-even' ),\n ( $display_depth >=2 ? 'sub-sub-menu' : '' ),\n 'menu-depth-' . $display_depth\n );\n $class_names = implode( ' ', $classes );\n \n // build html\n $output .= \"\\n\" . $indent . '<ul class=\"' . $class_names . '\">' . \"\\n\";\n}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n // depth dependent classes\n $indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n $display_depth = ( $depth + 1); // because it counts the first submenu as 0\n $classes = array(\n 'sub-menu',\n ( $display_depth % 2 ? 'menu-odd' : 'menu-even' ),\n ( $display_depth >=2 ? 'sub-sub-menu' : '' ),\n 'menu-depth-' . $display_depth\n );\n $class_names = implode( ' ', $classes );\n \n // build html\n $output .= \"\\n\" . $indent . '<ul class=\"' . $class_names . '\">' . \"\\n\";\n}", "public function add_menu() {\n\t\tadd_submenu_page(\n\t\t\t'edit.php?post_type=blicki',\n\t\t\t__( 'Suggestion Review', 'blicki' ),\n\t\t\t__( 'Suggestion Review', 'blicki' ),\n\t\t\t'edit_others_posts',\n\t\t\t'blicki-show-diff',\n\t\t\tarray( $this, 'admin_suggestion_viewer' )\n\t\t);\n\t\tremove_submenu_page( 'edit.php?post_type=blicki', 'blicki-show-diff' );\n\t}", "public function add_menu() {\n\t\t\tadd_menu_page(\n\t\t\t\t'Amazon Affiliate | Products',\n\t\t\t\t'Products',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\tarray( &$this, 'load_product_page' ),\n\t\t\t\tplugins_url( 'amz-affiliate/img/icon.png' ),\n\t\t\t\t50\n\t\t\t);\n\t\t\tadd_submenu_page(\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\t'Amazon Affiliate | Tables',\n\t\t\t\t'Tables',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/table.php',\n\t\t\t\tarray( &$this, 'load_table_page' )\n\t\t\t);\n\t\t}", "function\ncreateMenu(&$sitemap, $_pos = 1, $_level = 2 )\n{\n\t$timestamp = time();\n\techo '<ul id=\"'. ($_pos === 1 ? 'menu-stucture' : '') .'\">';\n\t$locrr = 0;\n\tfor($i = $_pos; $i < count($sitemap); $i++)\n\t{\n\t\tif($_level !== intval($sitemap[$i] -> level))\n\t\t{\n\t\t\tif(!CMS_BACKEND)\n\t\t\t\t$locrr = ($sitemap[$i-1] -> offspring ?? 1) - 1;\n\t\t\tbreak;\n\t\t}\n\n\t\tif(\n\t\t\t\t($sitemap[$i] -> hidden_state == 0)\n\t\t\t&&\t(empty($sitemap[$i] -> page_auth) || (!empty($sitemap[$i] -> page_auth) && CSession::instance() -> isAuthed($sitemap[$i] -> page_auth) === true))\n\t\t\t||\t(\t($sitemap[$i] -> hidden_state == 5 && $sitemap[$i] -> publish_from < $timestamp)\n\t\t\t\t&&\t($sitemap[$i] -> hidden_state == 5 && $sitemap[$i] -> publish_until > $timestamp && $sitemap[$i] -> publish_until != 0)\n\t\t\t\t)\n\t\t\t|| CMS_BACKEND\n\t\t ); else\n\t\t {\n\t\t\t$i = $i + $sitemap[$i] -> offspring;\n\t\t\tcontinue;\n\t\t }\n\n\t\tif(CMS_BACKEND)\n\t\t\techo '<li><a href=\"'. CMS_SERVER_URL_BACKEND .'pages/view/'. $sitemap[$i] -> page_language .'/'. $sitemap[$i] -> node_id .'\" title=\"'. $sitemap[$i] -> page_title .'\">'. $sitemap[$i] -> page_name .'</a>';\n\t\telse\n\t\t\techo '<li><a href=\"'. CMS_SERVER_URL . URL_LANG_PRREFIX . substr($sitemap[$i] -> page_path, 1) .'\" title=\"'. $sitemap[$i] -> page_title .'\" '. ($sitemap[$i] -> menu_follow == 0 ? 'rel=\"nofollow\"' : '') .'>'. $sitemap[$i] -> page_name .'</a>';\n\n\t\tif($sitemap[$i] -> offspring != 0)\n\t\t{\n\t\t\t$i = createMenu($sitemap, ($i + 1), ($_level + 1));\n\t\t}\n\n\t\techo '</li>';\n\t}\n\techo '</ul>';\n\n\treturn (!$locrr ? $i - 1 : $i + $locrr);\n}", "function v2_mumm_menu_tree__menu_new_main_menu(&$variables) {\n return '<ul>' . $variables['tree'] . '</ul>';\n}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\tif ( $depth == 0 ) {\n\t\t\tif ( $this->is_mega ) {\n\t\t\t\t$output .= '';\n\t\t\t} else {\n\t\t\t\t$output .= '<ul class=\"sub-menu\" ' . $this->style . '>';\n\t\t\t}\n\t\t} else if ( $this->is_mega ) {\n\t\t\t$output .= '';\n\t\t} else {\n\t\t\t$output .= '<ul class=\"sub-menu\">';\n\t\t}\n\t}", "function add_menu() {\n // Add \"Telegram Bot\" menu\n $telegram_logo = \"https://upload.wikimedia.org/wikipedia/commons/8/82/Telegram_logo.svg\";\n add_menu_page(\"Telegram Bot\", \"Telegram Bot\", 4, sanitize_key(\"home\"), \"plugin_home_page\", $telegram_logo);\n \n // Add \"Admin panel\" submenu\n add_submenu_page(sanitize_key(\"home\"), \"Admin panel\", \"Admin panel\", 4, sanitize_key(\"admin\"), \"plugin_admin_panel_page\");\n}", "protected function _menu()\n\t{\n\t\tif (ee()->view->disabled('ee_menu'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tee()->view->cp_main_menu = ee()->menu->generate_menu();\n\t}", "function ambil_menu($type_menu,$parent=0){\n\n $kondisi=array(\n\n \"menu_id\"=>$type_menu,\n \"menu_child_parent\" => $parent,\n \"aktif\" => \"Y\"\n\n );\n //query ke database\n $this->CI->db->order_by(\"posisi\",\"ASC\");\n $query= $this->CI->db->get_where(\"menu_child\",$kondisi);\n\n //cek apakah memiliki hasil\n if($query->num_rows()>0){\n $class=$parent==0?\"nav navbar-nav\":\"dropdown-menu bg-red\";\n $this->menu.=\"<ul class='$class'>\";\n \n foreach ($query->result_array() as $menu) {\n //cek apakah menu sekarang mempunyai submenu atau tidak\n $cek=$this->CI->db->get_where('menu_child',array('menu_child_parent'=>$menu['menu_child_id'],'aktif'=>'Y','menu_id'=>$type_menu));\n\n //jika terdapat sub menu\n if($cek->num_rows()>0){\n\n $this->menu.= \"<li class='dropdown'><a href='$menu[menu_child_url]' target='$menu[menu_child_target]' style='color:#fff;' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'>$menu[menu_child_nama] <span class='caret'></span></a>\";\n //panggil ambil_menu() secara reqursive untuk mengambil sub-menu nya\n $this->ambil_menu($type_menu,$menu['menu_child_id']);\n $this->menu.= \"</li>\";\n\n }\n //jika tidak memiliki sub menu\n else {\n $this->menu.= \"<li><a href='$menu[menu_child_url]' target='$menu[menu_child_target]'>$menu[menu_child_nama]</a>\";\n $this->menu.= \"</li>\";\n }\n\n }\n\n $this->menu.=\"</ul>\";\n\n } else {\n //jika tidak ada hasil.\n return;\n\n }\n\n }", "function wc_multi_warehouse_warehouses_modifymenu() {\n\tadd_menu_page('Warehouses', //page title\n\t'Warehouses', //menu title\n\t'manage_options', //capabilities\n\t'wc_multi_warehouse_warehouses_list', //menu slug\n\t'wc_multi_warehouse_warehouses_list' //function\n\t);\n\n\t//this is a submenu\n\tadd_submenu_page('wc_multi_warehouse_warehouses_list', //parent slug\n\t'Add New Warehouse', //page title\n\t'Add New', //menu title\n\t'manage_options', //capability\n\t'wc_multi_warehouse_warehouses_create', //menu slug\n\t'wc_multi_warehouse_warehouses_create'); //function\n\n\t//this submenu is HIDDEN, however, we need to add it anyways\n\tadd_submenu_page(null, //parent slug\n\t'Update Warehouse', //page title\n\t'Update', //menu title\n\t'manage_options', //capability\n\t'wc_multi_warehouse_warehouses_update', //menu slug\n\t'wc_multi_warehouse_warehouses_update'); //function\n}", "function power_do_nav() {\n\n\t// Do nothing if menu not supported.\n\tif ( ! power_nav_menu_supported( 'primary' ) || ! has_nav_menu( 'primary' ) ) {\n\t\treturn;\n\t}\n\n\t$class = 'menu power-nav-menu menu-primary';\n\tif ( power_superfish_enabled() ) {\n\t\t$class .= ' js-superfish';\n\t}\n\n\tpower_nav_menu(\n\t\t[\n\t\t\t'theme_location' => 'primary',\n\t\t\t'menu_class' => $class,\n\t\t]\n\t);\n\n}", "protected function buildMenu() {\n// $structures = DataSource::factory(Structure::cls());\n// $structures->builder()\n// ->where(\"structure_id=0\")\n// ->order('priority');\n// /** @var Structure[] $aStructures */\n// $aStructures = $structures->findAll();\n// foreach ($aStructures as $oStructure) {\n// $menu->addLeftItem($oStructure->name, $oStructure->path);\n// $this->loadMenuItems($menu->findLeftItemByPath($oStructure->path), $oStructure);\n// }\n//\n// $view = new ViewMMenu();\n// $view->menu = $menu;\n// return $view;\n\n $ViewMainMenu = new ViewMainMenu($this->config['name']);\n $this->setMenuItems($ViewMainMenu->itemsList);\n $currentPath = explode('?', $this->Router->getRoute());\n $ViewMainMenu->currentPath = reset($currentPath);\n\n return $ViewMainMenu;\n }", "public function addMenu()\n {\n $wpMenu = [\n [\n 'Bolsista',\n 'Bolsista',\n 'edit_pages',\n 'bolsista',\n $this,\n 'doAction',\n 'dashicons-format-aside',\n 2\n ]\n ];\n $wpSubMenu = [];\n $this->addMenuItem($wpMenu, $wpSubMenu);\n }", "function wpdmpp_menu()\n {\n add_submenu_page('edit.php?post_type=wpdmpro', __('Orders', \"wpdm-premium-packages\"), __('Orders', \"wpdm-premium-packages\"), WPDMPP_MENU_ACCESS_CAP, 'orders', array( $this, 'wpdmpp_orders' ) );\n add_submenu_page('edit.php?post_type=wpdmpro', __('License Manager', \"wpdm-premium-packages\"), __('License Manager', \"wpdm-premium-packages\"), WPDMPP_MENU_ACCESS_CAP, 'pp-license', array( $this, 'wpdmpp_license' ) );\n add_submenu_page('edit.php?post_type=wpdmpro', __('Coupon Codes', \"wpdm-premium-packages\"), __('Coupon Codes', \"wpdm-premium-packages\"), WPDMPP_MENU_ACCESS_CAP, 'pp-coupon-codes', array( $this, 'wpdmpp_all_coupons' ) );\n add_submenu_page('edit.php?post_type=wpdmpro', __('Payouts', \"wpdm-premium-packages\"), __('Payouts', \"wpdm-premium-packages\"), WPDMPP_MENU_ACCESS_CAP, 'payouts', array( $this, 'wpdmpp_all_payouts' ) );\n }", "function add_menu_subpage(){\n add_submenu_page(\n 'wpex-general',\n __( 'General', 'athen_transl' ),\n __( 'General', 'athen_transl' ),\n 'manage_options',\n ATHEN_THEME_PANEL_SLUG,\n array( $this, 'create_admin_page' )\n );\n }", "public function make($submenuId = 0, $first = true)\n {\n $menu = '';\n\n $parents = $this->user->userPrivParents(\\Session::get('id'), $submenuId);\n\n foreach($parents as $parent)\n {\n $totalChilds = $parent->childs()->where('show_menu', 1)->get()->count();\n\n $link_tar = ($parent->target_blank === 1) ? ' target=\"_blank\"': '';\n\n if ($totalChilds > 0)\n {\n $name = $parent->use_lang == 1 ? trans(\\Conf::langPath().$parent->lang) : $parent->name;\n\n $menu .= '\n <li data-parent=\"true\">\n <a href=\"'.\\URL::to(\\Util::getUrlLang('admin/'.$parent->url_action)).'\" '.$link_tar.'><i class=\"fa fa-'.$parent->url_icon.'\"></i> '.$name.'</a>\n <ul class=\"nav\">';\n $menu .= $this->make($parent->id, false).'\n </ul>\n </li>';\n }\n else\n {\n $name = $parent->use_lang == 1 ? trans(\\Conf::langPath().$parent->lang) : $parent->name;\n\n $menu .= '\n <li>\n <a href=\"'.\\URL::to(\\Util::getUrlLang('admin/'.$parent->url_action)).'\"><i class=\"fa fa-'.$parent->url_icon.'\"></i> '.$name.'</a>\n </li>';\n }\n }\n\n return $menu;\n }", "function polizeipresse_create_admin_menu() {\r\n\tif(current_user_can('manage_options')){\r\n\t\t// Create new top-level menu\r\n\t\tadd_options_page('Polizeipresse-Plugin',\r\n\t\t\t\t\t\t 'Polizeipresse',\r\n\t\t\t\t\t\t 'manage_options',\r\n\t\t\t\t\t\t 'polizeipresse_options',\r\n\t\t\t\t\t\t 'polizeipresse_option_page');\r\n\t}\r\n}", "function buildMenu($array, $args = array(), $has_parent = false ) {\n // extract($args);\n\n if($has_parent){\n echo '<ul class=\"sub\">';\n } else {\n echo '<ul class=\"'.$args['menu_class'].'\" id=\"'.$args['menu_id'].'\">';\n }\n\n foreach ($array as $item) {\n $li_class = (!empty($item['childs'])) ? 'sub-menu' : '';\n\n echo '<li class=\"'.$li_class.'\"><a href=\"'.$item['link'].'\"><i class=\"fa '.$item['icon'].'\"></i> <span>'.$item['title'].'</span>';\n if (!empty($item['childs'])) {\n // close <a> tag before create new ul\n echo \"</a>\";\n buildMenu($item['childs'], array('menu_class' => '', 'menu_id', ''), true );\n }\n echo '</a></li>';\n }\n echo '</ul>';\n}", "function eventoni_create_menu() {\n\n\t//create new top-level menu\n\tadd_menu_page('Eventoni', 'Eventoni', 'administrator', __FILE__, 'eventoni_settings_page');\n\n\t//call register settings function\n\tadd_action( 'admin_init', 'register_mysettings' );\n}", "function wptrader_menu_create_admin_menu() {\r\n\t\t\tglobal $wptrader_main_menu, $wptrader_main, $wptrader_help, $wptrader_main_options, $wptrader_torrent_options, $wptrader_widgets_options, $wptrader_peers_list, $wptrader_free_leech_list;\r\n\t\t\tif (function_exists('add_menu_page')) {\r\n\t\t\t\t$wptrader_main_menu = add_menu_page('WP-Trader Plugin', 'WP-Trader', 8, WP_PLUGIN_FOLDER_NAME, 'wptrader_main', WP_TRADER_PLUGIN_URL . 'admin/css/images/admin_icons/admin_main.png');\r\n\t\t\t}\r\n\t\t\tif (function_exists('add_submenu_page')) {\r\n\t\t\t\t$wptrader_main = add_submenu_page(WP_PLUGIN_FOLDER_NAME, htmlspecialchars(__('WP-Trader: Index','wptrader')), htmlspecialchars(__('Index','wptrader')), 8, WP_PLUGIN_FOLDER_NAME, 'wptrader_main');\r\n\t\t\t\t$wptrader_help = add_submenu_page(WP_PLUGIN_FOLDER_NAME, htmlspecialchars(__('WP-Trader: Help','wptrader')), htmlspecialchars(__('Help','wptrader')), 8, 'wptrader-help', 'wptrader_help');\r\n\t\t\t\t$wptrader_main_options = add_submenu_page(WP_PLUGIN_FOLDER_NAME, htmlspecialchars(__('WP-Trader: Options Main','wptrader')), htmlspecialchars(__('Options Main','wptrader')), 8, 'wptrader-options-main', 'wptrader_main_options');\r\n\t\t\t\t$wptrader_torrent_options = add_submenu_page(WP_PLUGIN_FOLDER_NAME, htmlspecialchars(__('WP-Trader: Options Torrent','wptrader')), htmlspecialchars(__('Options Torrent','wptrader')), 8, 'wptrader-options-torrent', 'wptrader_torrent_options');\r\n\t\t\t\t$wptrader_widgets_options = add_submenu_page(WP_PLUGIN_FOLDER_NAME, htmlspecialchars(__('WP-Trader: Options Widgets','wptrader')), htmlspecialchars(__('Options Widgets','wptrader')), 8, 'wptrader-options-widgets', 'wptrader_widgets_options');\r\n\t\t\t\t$wptrader_peers_list = add_submenu_page(WP_PLUGIN_FOLDER_NAME, htmlspecialchars(__('WP-Trader: Peers List','wptrader')), htmlspecialchars(__('Peers List','wptrader')), 8, 'wptrader-peers-list', 'wptrader_peers_list');\r\n\t\t\t\t$wptrader_free_leech_list = add_submenu_page(WP_PLUGIN_FOLDER_NAME, htmlspecialchars(__('WP-Trader: Free Leech List','wptrader')), htmlspecialchars(__('Free Leech List','wptrader')), 8, 'wptrader-free-leech-list', 'wptrader_free_leech_list');\r\n\t\t\t\t//$wptrader_plugins = add_submenu_page(WP_PLUGIN_FOLDER_NAME, htmlspecialchars(__('WP-Trader: Plugins','wptrader')), htmlspecialchars(__('Plugins','wptrader')), 8, 'wptrader-plugins', 'wptrader_plugins');\r\n\t\t\t}\r\n\t\t\tif (function_exists ('wptrader_admin_styles_scripts')){\r\n\t\t\t\tadd_action( \"admin_print_styles-$wptrader_main_menu\", \"wptrader_admin_styles_scripts\" );\r\n\t\t\t\tadd_action( \"admin_print_styles-$wptrader_main\", \"wptrader_admin_styles_scripts\" );\r\n\t\t\t\tadd_action( \"admin_print_styles-$wptrader_help\", \"wptrader_admin_styles_scripts\" );\r\n\t\t\t\tadd_action( \"admin_print_styles-$wptrader_main_options\", \"wptrader_admin_styles_scripts\" );\r\n\t\t\t\tadd_action( \"admin_print_styles-$wptrader_torrent_options\", \"wptrader_admin_styles_scripts\" );\r\n\t\t\t\tadd_action( \"admin_print_styles-$wptrader_widgets_options\", \"wptrader_admin_styles_scripts\" );\r\n\t\t\t\tadd_action( \"admin_print_styles-$wptrader_peers_list\", \"wptrader_admin_styles_scripts\" );\r\n\t\t\t\tadd_action( \"admin_print_styles-$wptrader_free_leech_list\", \"wptrader_admin_styles_scripts\" );\r\n\t\t\t}\r\n\t\t}", "function add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }", "function start_lvl( &$output, $depth = 0, $args = Array() ) {\n // depth dependent classes\n $indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n $display_depth = ( $depth + 1); // because it counts the first submenu as 0\n $classes = array(\n 'dropdown-menu',\n ( $display_depth % 2 ? 'menu-odd' : 'menu-even' ),\n ( $display_depth >=2 ? '' : '' ),\n 'menu-depth-' . $display_depth\n );\n $class_names = implode( ' ', $classes );\n\n // build html\n\n $output .= \"\\n\" . $indent . '<ul class=\"' . $class_names . '\">' . \"\\n\";\n}", "function add_menu() {\n add_menu_page(\"Polls\", \"Polls\", \"administrator\", \"polls\", \"managePollsPage\");\n}", "function pantomime_register_menu(){\n\tif ( function_exists( 'register_nav_menus' ) ) {\n\t\tregister_nav_menus(\n\t\t\tarray(\n\t\t\t 'main_nav' => 'Main Navigation'\n\t\t\t)\n\t\t);\n\t}\t\n}", "function nt_admin_menus(){\r\n\t\t// \t\t\t\t\t\t\t\t\t\t\tcallable $function = '', string $icon_url = '', int $position = null )\r\n\t\tadd_menu_page(\r\n\t\t\t__( 'Settings', 'newTheme'),\r\n\t\t\t__( 'NewTheme', 'newTheme'),\r\n\t\t\t'edit_theme_options',\r\n\t\t\t'nt_theme_options_page',\r\n\t\t\t'nt_theme_options_function'\r\n\t\t);\t\r\n\r\n\t\t//add_submenu_page( string $parent_slug, string $page_title, string $menu_title, string $capability, string $menu_slug, \r\n\t\t//\t\t\t\t\t\t\tcallable $function = '' )\r\n\t\tadd_submenu_page( \r\n\t\t\t'nt_theme_options_page', \r\n\t\t\t__( 'Settings', 'newTheme'), \r\n\t\t\t__( 'NewTheme options', 'newTheme'),\r\n\t\t\t'edit_theme_options',\r\n\t\t\t'nt_theme_options_page',\r\n\t\t\t'nt_theme_options_function'\r\n \t);\r\n\t}", "public function createProfileMenu()\r\n {\r\n $menu = $this->factory->createItem('root', [\r\n 'childrenAttributes' => ['class' => 'vertical medium-horizontal menu']\r\n ]);\r\n\r\n $menu->addChild(\r\n $this->translator->trans('navigation.profile.main', [], 'MinervaAppBundle'),\r\n ['route' => 'fos_user_profile_show']\r\n );\r\n\r\n $menu->addChild(\r\n $this->translator->trans('navigation.profile.battlenet', [], 'MinervaAppBundle'),\r\n ['route' => 'minerva_user_battlenet_overview']\r\n );\r\n\r\n return $menu;\r\n }", "function add_sub_menu($name, $link, $root_menu, $meta = FALSE)\r\n {\r\n global $wp_admin_bar;\r\n if ( !is_super_admin() || !is_admin_bar_showing() )\r\n return;\r\n \r\n $wp_admin_bar->add_menu( array(\r\n 'parent' => $root_menu,\r\n 'title' => $name,\r\n 'href' => $link,\r\n 'meta' => $meta) );\r\n \r\n }", "function power_do_subnav() {\n\n\t// Do nothing if menu not supported.\n\tif ( ! power_nav_menu_supported( 'secondary' ) ) {\n\t\treturn;\n\t}\n\n\t$class = 'menu power-nav-menu menu-secondary';\n\tif ( power_superfish_enabled() ) {\n\t\t$class .= ' js-superfish';\n\t}\n\n\tpower_nav_menu(\n\t\t[\n\t\t\t'theme_location' => 'secondary',\n\t\t\t'menu_class' => $class,\n\t\t]\n\t);\n\n}", "function owa_dashboard_menu() {\r\n\r\n\tif (function_exists('add_submenu_page')):\r\n\t\tadd_submenu_page('index.php', 'OWA Dashboard', 'Analytics', 1, dirname(__FILE__), 'owa_pageController');\r\n endif;\r\n \r\n return;\r\n\r\n}", "public function add_submenu( $slug, $parent ){\n\t\t\t\n\t\t\t\n\t\t\t//Setup all parameters to run the add_submeu_page\n\t\t\t\n\t\t\t//Buggy in so much as setting will disapper when default menus are removed and replaced by updated menus. \n\t\t\t//Parent Slug\n\t\t\t$parent_slug = ( $this->default_slugs[ $parent ] ) ?? $parent ;\n\t\t\t\t\n\t\t\t//menu_title\n\t\t\t$menu_title = ucwords( str_replace( '_', ' ', $slug ) );\n\t\t\t\n\t\t\t//page_title\n\t\t\t$page_title = $menu_title;\n\t\t\t\n\t\t\t//capability\n\t\t\t$capability = 'edit_users';//( in_array( $slug, $this->access['admin'] ) )? 'edit_users' : 'read_posts';\n\t\t\t\n\t\t\t//Is this necessary, or can we just assign to callable assuming that a sub page would never be a primary default page. \n\t\t\t\n\t\t\t//Menu Slugs can be replaced with PHP files that represent the new page. \n\t\t\t//$menu_slug = 'certificates-lms/view/admin/'.$parent.'/'.$slug.'.php';\n\t\t\tif( !isset( $this->default_slugs[ $slug ] ) ){\n\t\t\t\t//menu slug\n\t\t\t\t$menu_slug = $slug;\n\t\t\t\t//callback \n\t\t\t\t$callable = array( $this, 'menu_callable' );\n\t\t\t}else{\n\t\t\t\t//menu slug\n\t\t\t\t$menu_slug = $this->default_slugs[ $slug ];\n\t\t\t\t//callable NULL 'cuz $menu_slug loads file. See Plugin Dev manual. \n\t\t\t\t$callable = null;\n\t\t\t\n\t\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\tadd_submenu_page(\n\t\t\t\t$parent_slug,\t//string \n\t\t\t\t$page_title,\t//string \n\t\t\t\t$menu_title,\t//string \n\t\t\t\t$capability,\t//string \n\t\t\t\t$menu_slug,\t\t//string \n\t\t\t\t$callable\t//callable \n\t\t\t);\n\t\t\t\n\t\t\t//NOT WORKING AS EXPECTED\n\t\t\tif( isset( $this->default_slugs[ $slug ] ) ){\n\t\t\t\tadd_filter( 'parent_file', function($pf) use( $parent_slug ){\n\t\t\t\t\t\n\t\t\t\t\t//var_dump( $pf );\n\t\t\t\t\t\n\t\t\t\t\treturn 'admin.php?page='.$parent_slug;\n\t\t\t\t\t\n\t\t\t\t}, 999 );\n\t\t\t\t\n\t\t\t}\n\t\t}", "function render_submenu($arrMenu) {\n if (!empty($arrMenu)) {\n foreach ($arrMenu as $key => $menuobj) {\n $path = trim($menuobj['path'], \"/\");\n if (PageAccessManager::GetPageAccess($path) == 'AUTHORIZED') {\n ?>\n <b-dropdown-item to=\"/<?php echo($path); ?>\">\n <?php echo (!empty($menuobj['icon']) ? $menuobj['icon'] : null); ?> \n <?php echo $menuobj['label']; ?>\n <?php\n if (!empty($menuobj['submenu'])) {\n render_menu($menuobj['submenu']);\n }\n ?>\n </b-dropdown-item>\n <?php\n }\n }\n }\n}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\t$indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n\n\t\t$classes = array(\n\t\t\t'sub-menu',\n\t\t\t'nav-sub-menu-'. $this->currentItemID,\n\t\t);\n\t\t$class_names = implode( ' ', $classes );\n\t\n\t\t// Build HTML for output.\n\t\t$output .= \"\\n\" . $indent . '<ul class=\"' . esc_attr( $class_names ) . '\" data-dropdown-content=\"nav-sub-menu-'. $this->currentItemID . '\">' . \"\\n\";\n\t}", "function wimbase_menu_link__main_menu($variables) {\n $element = $variables['element'];\n $sub_menu = '';\n\n if ($element['#below']) {\n // Prevent dropdown functions from being added to management menu so it\n // does not affect the navbar module.\n if ((!empty($element['#original_link']['depth'])) && ($element['#original_link']['depth'] == 1)) {\n // Build parent item for mobile.\n $parent = '<li class=\"mobile parent-subitem\">' . l($element['#title'], $element['#href']) . '</li>';\n\n unset($element['#below']['#theme_wrappers']);\n\n // Add our own wrapper.\n $sub_menu = '<ul class=\"dropdown-menu\">' . $parent . drupal_render($element['#below']) . '</ul>';\n\n // Generate as standard dropdown.\n $element['#attributes']['class'][] = 'parent-dropdown';\n $element['#localized_options']['html'] = TRUE;\n }\n $element['#attributes']['class'] = array_diff($element['#attributes']['class'], ['expanded']);\n }\n\n // On primary navigation menu, class 'active' is not set on active menu item.\n // @see https://drupal.org/node/1896674\n if (($element['#href'] == $_GET['q'] || ($element['#href'] === '<front>' && drupal_is_front_page())) && (empty($element['#localized_options']['language']))) {\n $element['#attributes']['class'][] = 'active';\n }\n\n $output = l($element['#title'], $element['#href'], $element['#localized_options']);\n\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "public function submenu()\n {\n $data = array\n (\n 'submenus' => $this->Submenus_model->list()\n );\n\n $this->layout->view(\"submenu\",$data);\n }", "function h_add_submenu(string $parent_title, array $args) {\n h_add_menus([\n $parent_title => [\n 'position' => \"on $parent_title\",\n 'submenu' => $args\n ]\n ]);\n}", "function setup_menus() {\n\n\telgg_unregister_menu_item('topbar', 'elgg_logo');\n\n\telgg_register_menu_item('topbar', array(\n\t\t'name' => 'logo',\n\t\t'href' => false,\n\t\t'text' => elgg_view('page/elements/topbar_logo'),\n\t\t'item_class' => 'name',\n\t\t'section' => 'title-area',\n\t));\n\n\telgg_register_menu_item('topbar', array(\n\t\t'name' => 'toggle',\n\t\t'href' => '#',\n\t\t'text' => '<span>' . elgg_echo('menu') . '</span>',\n\t\t'item_class' => 'toggle-topbar menu-icon',\n\t\t'priority' => 900,\n\t\t'section' => 'title-area',\n\t));\n\n\tif (elgg_is_admin_logged_in()) {\n\t\t$counter = '';\n\t\t$admin_notices = elgg_get_entities(array(\n\t\t\t'types' => 'object',\n\t\t\t'subtypes' => 'admin_notice',\n\t\t\t'count' => true\n\t\t));\n\t\tif ($admin_notices) {\n\t\t\t$counter = '<span class=\"messages-new\">' . $admin_notices . '</span>';\n\t\t}\n\t\telgg_register_menu_item('topbar', array(\n\t\t\t'name' => 'administration',\n\t\t\t'href' => 'admin',\n\t\t\t'text' => elgg_view_icon('dashboard') . elgg_echo('admin') . $counter,\n\t\t\t'priority' => 100,\n\t\t\t'section' => 'alt',\n\t\t));\n\t}\n}", "function createDefaultMenu(){\n\t// Check if the menu exists\n\t$menu_name = 'Default Menu';\n\t$menu_exists = wp_get_nav_menu_object( $menu_name );\n\n\t// If it doesn't exist, let's create it.\n\tif( !$menu_exists){\n\t $menu_id = wp_create_nav_menu($menu_name);\n\n\t\t// Set up default menu items\n\t wp_update_nav_menu_item($menu_id, 0, array(\n\t 'menu-item-title' => ( 'Home' ),\n\t 'menu-item-classes' => 'home',\n\t 'menu-item-url' => home_url( '/' ),\n\t 'menu-item-status' => 'publish'));\n\n\t wp_update_nav_menu_item($menu_id, 0, array(\n\t 'menu-item-title' => ( 'Custom Page' ),\n\t 'menu-item-url' => home_url( '/custom-page/' ),\n\t 'menu-item-status' => 'publish'));\n\t}\n}", "function mkRegisterMenu() {\n \n register_nav_menu('primary', 'Main Menu');\n \n }", "public function create($options=array('wrap'=>'<ul id=\"menu\">%s</ul>')) {\n\n\t\t$controller\t= str_replace('Admin_Controller_', '', Application_Base::getController());\n\t\t$action\t\t= Application_Base::getAction();\n\t\t$url\t\t= Application_Base::getBaseURL();\n\n\t\t$request\t= new Modules_Request_HTTP();\n\t\t$requestURL\t= $request->getRequestURL();\n\t\t$currentURL\t= str_replace(Application_Base::getRelativePath(), '', $request->getURLPart($requestURL, 'path'));\n\n\t\tif(empty($this->JSON)) {\n\t\t\t$this->gatherJSON();\n\t\t}\n\n\t\tusort($this->JSON, 'Admin_Application_View_MenuHelper::sort');\n\n\t\tif(is_array($this->JSON)) {\n\n\t\t\t$user_id = Modules_Session::getInstance()->getVar('userdata')->user_id;\n\n\t\t\t$menu = '';\n\n\t\t\tforeach($this->JSON AS $cnt => $main) {\n\n\t\t\t#\tif((isset($this->app) && $this->app->getGlobal('access')->check('Admin_Controller_' . $main['controller'])) || !isset($this->app)) {\n\n\t\t\t\t\t\n\n\t\t\t\t\t$active\t= $controller == $main['controller'] ? ' active ':'';\n\t\t\t\t\t$id\t\t= $main['id'] ? ' id=\"'. $main['id'] . '\"' : '';\n\t\t\t\t\t$class\t= $main['class'] ? ' ' . $main['class'] . ' ' : '';\n\t\t\t\t\t$open\t= $main['open'] == \"true\" || in_array($main['title'], $this->open) ? ' open ':'';\n\t\t\t\t\t$hasVisibleChildren = false;\n\n\t\t\t\t\t$mainmenu = '<li ' . $id . ' class=\"' . $active . $class . $open . '\"><a href=\"' . $url . $main['link'] . '\">' . __($main['title']) . '</a>';\n\t\t\t\t\tif(isset($main['sub']) && !empty($main['sub'])) {\n\n\t\t\t\t\t\t$subSection = false;\n\t\t\t\t\t\t$submenu = '<ul>';\n\n\t\t\t\t\t\tforeach($main['sub'] AS $sub) {\n\n\t\t\t\t\t\t\tif($this->access->hasLinkAccess($user_id, $sub['link'])) {\n\n\t\t\t\t\t\t\t\t$active\t= (strtolower($controller . '/' . $action) == strtolower($sub['link']) || strpos(ltrim($currentURL, '/'), ltrim($sub['link'])) === 0) ? 'active':'';\n\t\t\t\t\t\t\t\t$id\t\t= $sub['id'] ? ' id=\"'. $sub['id'] . '\"' : '';\n\t\t\t\t\t\t\t\t$submenu .= '<li ' . $id . ' class=\"' . $active . '\"><a href=\"' . $url . $sub['link'] . '\">' . __($sub['title']) . '</a></li>';\n\t\t\t\t\t\t\t\t$subSection = true;\n\t\t\t\t\t\t\t\t$hasVisibleChildren = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$submenu .= '</ul>';\n\n\t\t\t\t\t\tif($subSection == true) {\n\t\t\t\t\t\t\t$mainmenu .= $submenu;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\t$mainmenu .= '</li>';\n\n\n\t\t\t\t\tif($hasVisibleChildren == true || $this->access->hasLinkAccess($user_id, $main['link'])) {\n\t\t\t\t\t\t$menu .= $mainmenu;\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t#\t}\n\n\t\t\t}\n\n\t\t\tif(isset($options) && isset($options['wrap'])) {\n\t\t\t\t$menu = sprintf($options['wrap'], $menu);\n\t\t\t}\n\n\t\t}\n\t\treturn $menu;\n\t}", "public static function add_admin_menus()\n\t{\n\t}", "public function createBackendMenu(){\n\t\tadd_menu_page( 'Stackoverflow', 'Stackoverflow', 'manage_options', 'stackoverflowStats', array($this, 'settingsPage') );\n\t}", "function cg_create_menu() {\n\tadd_menu_page( \n\t__('CityGrid', EMU2_I18N_DOMAIN),\n\t__('CityGrid', EMU2_I18N_DOMAIN),\n\t0,\n\tCG_PLUGIN_DIRECTORY.'/cg-main.php',\n\t'',\n\tplugins_url('/images/icon.png', __FILE__));\n\t\n\t\n\tadd_submenu_page( \n\tCG_PLUGIN_DIRECTORY.'/cg-main.php',\n\t__(\"Main\", EMU2_I18N_DOMAIN),\n\t__(\"Main\", EMU2_I18N_DOMAIN),\n\t0,\n\tCG_PLUGIN_DIRECTORY.'/cg-main.php'\n\t);\t\n\t\n\tadd_submenu_page( \n\tCG_PLUGIN_DIRECTORY.'/cg-main.php',\n\t__(\"Settings\", EMU2_I18N_DOMAIN),\n\t__(\"Settings\", EMU2_I18N_DOMAIN),\n\t0,\n\tCG_PLUGIN_DIRECTORY.'/cg-settings.php'\n\t);\t\t\n\t\n\tif(!get_option('directory_label'))\n\t\t{\n\t\t$the_page_title = \"Directory\";\n\t\t}\t\n\telse\n\t\t{\n\t\t$the_page_title = get_option('directory_label');\n\t\t}\n\t//echo \"HERE: \" . $the_page_title . \"<br />\";\n\t$the_page = get_page_by_title( $the_page_title );\n\t\n\tif ( ! $the_page ) {\n\t\n\t $_p = array();\n\t $_p['post_title'] = $the_page_title;\n\t $_p['post_content'] = \"<p>Welcome to the CityGrid Hyp3rL0cal Directory</p>\";\n\t $_p['post_status'] = 'publish';\n\t $_p['post_type'] = 'page';\n\t $_p['comment_status'] = 'closed';\n\t\n\t // Insert the post into the database\n\t $the_page_id = wp_insert_post( $_p );\n\t \n\t update_post_meta( $the_page_id, '_wp_page_template', 'cg-directory.php' );\n\t \n\t}\t\n\t\n}", "private function set_admin_menu() {\n $TSB_settings_admin_menu = new Admin_Menu( Initial_Value::TSB_main_settings_page() );\n $this->loader->add_action( 'admin_menu', $TSB_settings_admin_menu, 'add_admin_menu_page' );\n\n// $plugin_name_sample_admin_sub_menu1 = new Admin_Sub_Menu( Initial_Value::sample_sub_menu_page1() );\n// $this->loader->add_action( 'admin_menu', $plugin_name_sample_admin_sub_menu1, 'add_admin_sub_menu_page' );\n//\n// $plugin_name_sample_admin_sub_menu2 = new Admin_Sub_Menu( Initial_Value::sample_sub_menu_page2() );\n// $this->loader->add_action( 'admin_menu', $plugin_name_sample_admin_sub_menu2, 'add_admin_sub_menu_page' );\n\n }", "function render_multi_level_menu($menu_source, $start_node, $start_link, $level = 0, $anc_destination)\n {\n \n// if($level==0)DebugBreak();\n \n global $TMS, $_PATH, $REQUEST_ASSOC, $REQUEST_VARS;\n static $branches;\n\n if ($REQUEST_VARS[0] == 'show' && ($level === 0))\n {\n $objid =$this->get_requested_basic_id($anc_destination);\n $this->menu_selected_obj_id=$objid;\n $this->menu_selected_id =$this->_tree->GetAncestor($objid);\n $this->menu_selected_id3 =$this->_tree->GetAncestor($this->menu_selected_id);\n }\n elseif ($REQUEST_VARS[0] == 'showobj' && $objid && ($level === 0))\n {\n $this->menu_selected_obj_id=$objid;\n $this->menu_selected_id =$this->_tree->GetAncestor($objid);\n }\n elseif ($level === 0&&$objid)\n {\n $this->menu_selected_id=$objid;\n }\n\n \n if (!$branches && $objid)\n {\n $this->_tree->BonesMas=null;\n $this->_tree->GetBones($objid, 1);\n $branches= $this->_tree->BonesMas;\n \n }\n \n if (($menu_source) && ($menu_source[$start_node]))\n {\n foreach ($menu_source[$start_node] as $key => $menuitem)\n {\n if ($menuitem['params']['Disable'])\n unset ($menu_source[$start_node][$key]);\n }\n\n $xtr_count=count($menu_source[$start_node]);\n\n $i =0;\n\n foreach ($menu_source[$start_node] as $menuitem)\n {\n $itembasic = $menuitem['basic'];\n\n $menuitem =$this->_common_obj->property_set_to_properties($menuitem['params']['Property_set'],$menuitem,'',true,$this);\n\n if (is_array($menuitem['props']))$menuitem=array_merge($menuitem, $menuitem['props']);\n\n unset ($menuitem['props']);\n\n $menuitem['_num'] =$i++;\n $menuitem['Ancestor']=$start_node;\n\n if ($menuitem['obj_type'] == '_CATGROUP')\n {\n\n $menuitem['subcount']=count($menu_source[$menuitem['id']]);\n }\n\n $rpath =$this->_tree->calculate_r_path($menuitem['id'], $anc_destination, $this->_sel_arr,\n 2);\n $menuitem['Link'] =$start_link . '/' . $rpath;\n\n $menuitem['submenu']='';\n\n \n if (is_array($menu_source[$menuitem['id']]))\n {\n\n $menuitem['submenu']=$this->render_multi_level_menu($menu_source, $menuitem['id'], $start_link,\n $level + 1, $anc_destination);\n }\n\n $selected=false;\n\n if (in_array($menuitem['id'], array\n (\n $this->menu_selected_id,\n $this->menu_selected_obj_id\n )))\n {\n $selected =true;\n $selected_item=$menuitem;\n }\n\n $branch_detected=false;\n\n\n if (!$selected && $branches && in_array($menuitem['id'], $branches))\n {\n \n $branch_detected=true;\n }\n\n if (($menuitem['obj_type'] == '_CATGROUP') && is_array($menu_source[$menuitem['id']])\n && ($TMS->isSectionDefined('_menu_item_nested_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_nested_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_nested_level' . $level);\n $TMS->clear_section_fields('_menu_item_nested_level' . $level);\n }\n elseif ($branch_detected && ($TMS->isSectionDefined('_menu_item_branch_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_branch_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_branch_level' . $level);\n }\n elseif (($i == 1) && ($selected) && ($TMS->isSectionDefined(\n '_menu_item_first_selected_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_first_selected_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_first_selected_level' . $level);\n $TMS->clear_section_fields('_menu_item_first_selected_level' . $level);\n }\n elseif (($i == 1) && ($TMS->isSectionDefined('_menu_item_first_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_first_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_first_level' . $level);\n $TMS->clear_section_fields('_menu_item_first_level' . $level);\n }\n elseif (($i == $xtr_count) and ($selected) && ($TMS->isSectionDefined(\n '_menu_item_last_selected_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_last_selected_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_last_selected_level' . $level);\n $TMS->clear_section_fields('_menu_item_last_selected_level' . $level);\n }\n elseif ($i == $xtr_count && $TMS->isSectionDefined('_menu_item_last_level' . $level))\n {\n $TMS->AddMassReplace('_menu_item_last_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_last_level' . $level);\n $TMS->clear_section_fields('_menu_item_last_level' . $level);\n }\n elseif ($selected && $TMS->isSectionDefined('_menu_item_middle_selected_level' . $level))\n {\n $TMS->AddMassReplace('_menu_item_middle_selected_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_middle_selected_level' . $level);\n $TMS->clear_section_fields('_menu_item_middle_selected_level' . $level);\n }\n elseif ($TMS->isSectionDefined('_menu_item_middle_level' . $level))\n {\n $TMS->AddMassReplace('_menu_item_middle_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_middle_level' . $level);\n $TMS->clear_section_fields('_menu_item_middle_level' . $level);\n }\n\n if ($level == 0)\n {\n $anc_node=$this->menu_ancestor;\n $TMS->AddMassReplace('_menu_main_level' . $level, $anc_node['params']);\n }\n\n if (($this->devide_by_rows) && ($i % (int)$this->devide_by_rows == 0))\n {\n $levnum++;\n $TMS->AddReplace('_menu_main_level' . $level, 'id', $start_node);\n $TMS->AddReplace('_menu_main_level' . $level, 'menu_buff', $menu_buff);\n $TMS->AddReplace('_menu_main_level' . $level, '__divnum', $levnum);\n\n $menu_buff='';\n $menu_dbuff.=$TMS->parseSection('_menu_main_level' . $level);\n $exit_section='_menu_divide_container' . $level;\n $TMS->KillField('_menu_main_level' . $level, 'menu_buff');\n }\n }\n\n if (($this->devide_by_rows) && (($i % (int)$this->devide_by_rows != 0)))\n {\n $levnum++;\n $TMS->AddReplace('_menu_main_level' . $level, 'menu_buff', $menu_buff);\n $TMS->AddReplace('_menu_main_level' . $level, '__divnum', $levnum);\n\n $menu_dbuff.=$TMS->parseSection('_menu_main_level' . $level);\n $exit_section='_menu_divide_container' . $level;\n $menu_buff =$menu_dbuff;\n }\n elseif (!$this->devide_by_rows)\n {\n $exit_section='_menu_main_level' . $level;\n }\n else\n {\n $menu_buff=$menu_dbuff;\n }\n\n $TMS->AddReplace($exit_section, 'menu_buff', $menu_buff);\n\n $TMS->AddReplace('_menu_main_level' . $level, 'id', $start_node);\n $TMS->AddReplace($exit_section, 'ancestor', $this->menu_ancestor['params']['Name']);\n $TMS->AddReplace($exit_section, 'id', $start_node);\n $TMS->AddMassReplace($exit_section, $branch_item);\n\n $main=$TMS->parseSection($exit_section);\n\n $TMS->KillField($exit_section, 'menu_buff');\n\n return $main;\n }\n }", "function register_menus() {\n\tregister_nav_menu( 'main', __( 'Main Menu', 'postlight-headless-wp' ) );\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}", "public function register_menu() {\n $parent_slug = 'comparrot';\n $capability = 'manage_options';\n\n add_menu_page( 'Comparrot', 'Comparrot', $capability, $parent_slug, [$this, 'import_from_csv_page'], 'dashicons-admin-page', 2 );\n\n add_submenu_page( $parent_slug, __( 'Import from CSV', 'comparrot' ), __( 'Import from CSV', 'comparrot' ), $capability, $parent_slug, [$this, 'import_from_csv_page'] );\n add_submenu_page( $parent_slug, __( 'General settings', 'comparrot' ), __( 'General settings', 'comparrot' ), $capability, 'comparrot-general-settings', [$this, 'general_settings_page'] );\n }", "function start_lvl(&$output, $depth){\n\t\t// depth dependent classes\n\t\t$indent = ($depth > 0 ? str_repeat( \"\\t\", $depth ) : ''); // code indent\n\t\t$display_depth = ( $depth + 1); // because it counts the first submenu as 0\n\t\t$classes = array(\n\t\t\t'sub-menu',\n\t\t\t($display_depth >=2 ? 'sub-sub-menu' : '')\n\t\t);\n\t\t$class_names = implode(' ', $classes);\n\t \n\t\t// build html\n\t\t$output .= \"\\n\" . $indent . '<ul class=\"'.$class_names.'\">' . \"\\n\";\n\t}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\t\t$indent = str_repeat(\"\\t\", $depth);\n\t\t\t$output .= \"\\n$indent<ul class=\\\"menu vertical sublevel-2\\\">\\n\";\n\t\t}", "function control_custom_menus() {\n\n\t// Check if the menu exists\n\t$menu_exists = wp_get_nav_menu_object( 'secondary' );\n\n\t// If it doesn't exist, let's create it.\n\tif( !$menu_exists){\n\t\t$menu_id = wp_create_nav_menu( 'secondary' );\n\n\t\t$user = wp_get_current_user();\n\n\t\t// Set up default menu items\n\t\t$menu_author_id = wp_update_nav_menu_item($menu_id, 0, array(\n\t\t\t'menu-item-title' => __( $user->display_name ),\n\t\t\t'menu-item-url' => get_author_posts_url( $user->ID ),\n\t\t\t'menu-item-status' => 'publish'));\n\n\t\t// Set up default menu items\n\t\t$menu_logout_id = wp_update_nav_menu_item($menu_id, 0, array(\n\t\t\t'menu-item-title' => __( 'Logout' ),\n\t\t\t'menu-item-parent-id' => $menu_author_id,\n\t\t\t'menu-item-url' => wp_logout_url(),\n\t\t\t'menu-item-status' => 'publish'));\n\n\t}\n}", "function start_lvl( &$output, $depth = 0, $args = array() ) {\n\t\t// depth dependent classes\n\t\t$indent = ( $depth > 0 ? str_repeat( \"\\t\", $depth ) : '' ); // code indent\n\t\t$display_depth = ( $depth + 1); // because it counts the first submenu as 0\n\t\t$classes = array(\n\t\t\t'sub-menu',\n\t\t\t( $display_depth % 2 ? 'menu-odd' : 'menu-even' ),\n\t\t\t( $display_depth >=2 ? 'sub-sub-menu' : '' ),\n\t\t\t'menu-depth-' . $display_depth\n\t\t\t);\n\t\t$class_names = implode( ' ', $classes );\n\t \n\t\t// build html\n\t\t$output .= \"\\n\" . $indent . '<ul class=\"' . $class_names . '\">' . \"\\n\";\n\t}", "public static function _NEW(){\n\t\tLibMenuBar::startTable();\n\t\tLibMenuBar::cancel();\n\t\tLibMenuBar::spacer();\n\t\tLibMenuBar::help('screen.menus.new');\n\t\tLibMenuBar::endTable();\n\t}", "public function create()\n\t{\n $parentIds = Menu::whereNull('parent_id')->lists('name', 'id');\n\n return view('admin.submenu.create', compact('parentIds'));\n\t}", "public function createMainMenu(RequestStack $requestStack)\n {\n $menu = $this->factory->createItem('root');\n\n $menu->addChild('Homepage', array('route' => 'homepage'));\n $menu->addChild('News', array('route' => 'news'));\n $menu->addChild('About us', array('route' => 'about'));\n $menu->addChild('Product', array('route' => 'product'));\n $menu->addChild('Service', array('route' => 'service'));\n $menu->addChild('Contact', array('route' => 'contact'));\n\n // add some secured items\n if ($this->authorizationChecker->isGranted('IS_AUTHENTICATED_FULLY')) {\n $menu->addChild('Secured item', array('route' => 'secure'));\n }\n return $menu;\n }" ]
[ "0.7365579", "0.67719513", "0.66532713", "0.6630727", "0.66284615", "0.65678376", "0.65408057", "0.6528235", "0.6496008", "0.6481294", "0.6475736", "0.64552546", "0.6430498", "0.6388561", "0.63588446", "0.63503534", "0.63491124", "0.6340017", "0.6320309", "0.6319807", "0.63045067", "0.629859", "0.62924945", "0.6283604", "0.62721974", "0.62671393", "0.6258527", "0.62576634", "0.6227342", "0.62234986", "0.62232417", "0.6208565", "0.62033135", "0.62018776", "0.62018776", "0.62018776", "0.62018776", "0.62018776", "0.62018776", "0.620025", "0.6196477", "0.6191722", "0.6171704", "0.61626655", "0.6157384", "0.6155193", "0.6140363", "0.6140363", "0.6135253", "0.6134771", "0.6117982", "0.61176115", "0.6109605", "0.6109046", "0.6101221", "0.6096865", "0.60942274", "0.60893315", "0.6088982", "0.60809463", "0.6078225", "0.607765", "0.6068976", "0.6060206", "0.60573626", "0.6049814", "0.6048139", "0.604761", "0.6046391", "0.6045692", "0.6042512", "0.603059", "0.60283506", "0.6027157", "0.60251695", "0.60250586", "0.6024641", "0.6016583", "0.60163754", "0.6003395", "0.6003314", "0.6001077", "0.5995676", "0.59929764", "0.59913456", "0.59903246", "0.59873646", "0.5985397", "0.5985076", "0.598227", "0.5977476", "0.59623545", "0.59619236", "0.59605044", "0.5958783", "0.5954608", "0.5952864", "0.594852", "0.5948098", "0.5941989", "0.5940025" ]
0.0
-1
Find category by ID.
public static function findByID($categoryID) { return self::where('categoryID', $categoryID)->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($id)\n {\n return Category::findOrFail($id);\n }", "public function find($id): ?Category\n {\n return $this->model->find($id);\n }", "public function find($id)\n {\n try {\n return $this->category->find($id);\n } catch (Exception $e) {\n return null;\n }\n }", "public function findById($id)\n\t{\n\t\t$id = intval($id);\n\t\t$query = \"SELECT * FROM category WHERE id = \".$id;\n\n\t\t$result = $this->database->query($query);\n\t\tif ( $result )\n\t\t{\n\t\t\t$category = $result->fetchObject(\"Category\", array($this->database));\n\t\t\tif ( $category )\n\t\t\t{\n\t\t\t\treturn $category;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Catégorie introuvable.\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"Erreur - Base de données.\");\n\t\t}\n\t}", "public function findCategoryById($id): Category\n {\n return $this->categoryModel()->find($id);\n }", "public function findByIdWithCategory($id);", "public function retrieveCategory($id) {\n return $this->categoriesDB->retrieveByCategoryId($id);\n }", "public function getCategoryById($id)\n\t{\n\t\treturn $this->find($id);\n\t}", "public function findCategoryById($id)\n {\n $category = Category::select('id', 'name')\n ->with([\n 'bookshelf' => function($q) {\n $q->select('id', 'name', 'category_id');\n }\n ])\n ->where('id', $id)\n ->first();\n\n // return data yang di cari\n return $category;\n }", "public function getCategory(int $id)\n {\n }", "public function find(int $id)\n {\n return FinanceCategory::find($id);\n }", "public function getCategoryById($id)\n {\n return Category::findOrFail($id);\n }", "public static function getCategoryById($id) {\n self::checkConnection();\n settype($id, 'integer');\n $sql = sprintf(\"SELECT * FROM category WHERE id = %d\", $id);\n $results = self::$connection->execute($sql);\n if (count($results) >= 1) {\n return new Category($results[0]);\n } else {\n return null;\n }\n }", "function find_category($db, $id){\n\n\t$ID_cat = (int)$id;\n\n\t$sql = \"SELECT * FROM categories WHERE ID_cat = $ID_cat\";\n\n\t$category = mysqli_query($db, $sql);\n\n\t$result = mysqli_fetch_assoc($category);\n\n\treturn $result;\n}", "public function getCategory($id) {\n\t\treturn $this->query ( \"SELECT * FROM categorie WHERE cat_id = $id\" );\n\t}", "public function getCategoryById($id){ //print_r($id); die;\n $query = $this->db->get_where('category',array('id' => $id));\n return $query->row(); // print_r($query);\n }", "public function findById($id)\n\t{\n \t\treturn $this->findAll('kategoria')->where('id_kat', $id)->fetch();\n\t}", "public function getCategory($id){\n $category = Product::find($id)->category_id;\n return $category;\n }", "public function CategoryById($id) {\n $result = $this->conn->query(Category::toSelectByIdQuery($id));\n if ($result) {\n if(!$result->num_rows) {\n $this->err = 'Entity not found';\n return FALSE;\n }\n return $result->fetch_object('Category');\n }\n $this->err = $this->conn->error;\n return false;\n }", "public function find(int $id): CategoryFilter\n {\n return CategoryFilter::find($id);\n }", "public static function getCategory($id)\n {\n \t$query = \"SELECT * FROM categories WHERE id = :id\";\n \t$result = DB::select($query, ['id' => $id]);\n\n \treturn $result;\n }", "public function getCategory($id){\n $file = $this->com->callApi(\"products\");\n $data = json_decode($file);\n\n foreach($data as $arrayInf) {\n if((int)$arrayInf->id == (int)$id) {\n return intval($arrayInf->category);\n }\n }\n return null;\n }", "public function getCategoryById($id) {\n $query = \"SELECT * FROM \" . self::$TABLE . \" WHERE id = $id LIMIT 1\";\n $resultSet = parent::executeQuery($query);\n \n $array = $this->getRecordAsArray($resultSet);\n return $this->arrayToObject($array);\n }", "public static function getCategoryById($id)\n\t{\n\t\t$category = Category::find($id);\n\t\treturn $category;\n\t}", "static function get_category_by_id($category){\n\t\treturn self::$db->where('id',$category)->get('categories')->results();\n\t}", "public function show($id)\n {\n return $this->category->find($id);\n }", "function get_category_by_id($cate_id) {\n App::import(\"Model\", \"Category\");\n $model = new Category();\n $categoryInfo = $model->findById($cate_id);\n return $categoryInfo['Category']['title'];\n }", "public function get(Id $id): Category\n {\n /** @var Category $category */\n if (! $category = $this->repo->find($id->getValue())) {\n throw new EntityNotFoundException('Category is not found.');\n }\n return $category;\n }", "public function show($id)\n {\n return Category::find($id);\n }", "public function show($id)\n {\n return Category::find($id);\n }", "public function getCategory($id){\n\t\t\t$q = $this->mysqlRow('SELECT * FROM `'.$GLOBALS['db']['db_prefix'].'category` WHERE c_id=\"'.mysql_real_escape_string($id).'\"');\n\t\t\tif($q != ''){\n\t\t\t\treturn new CatCategory($q['c_id'], $q['name'], $q['webname'], $q['status'], $q['desc'], $q['img'], $q['service_root']);\n\t\t\t} else return null;\n\t\t}", "public function loadCategory(Int $id)\n {\n $query = $this->pdo->prepare('SELECT * FROM category WHERE id=:id');\n $query->execute(['id' => $id]);\n $query->setFetchMode(PDO::FETCH_CLASS, Category::class);\n /** @var POST|FALSE */\n return $query->fetch();\n }", "public function show($id) {\n $cat = Category::find($id);\n }", "function get_category_by_id($cate_id) {\n App::import(\"Model\", \"Category\");\n $model = new Category();\n $categoryInfo = $model->findById($cate_id);\n return (!empty($categoryInfo['Category']['title']))?$categoryInfo['Category']['title']:\"\";\n }", "public function category_by_id($id)\n {\n $query = \"SELECT *\n FROM \" . $this->db_table_prefix . \"categories\n \t WHERE id = $id\";\n $result = $this->commonDatabaseAction($query);\n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n// return mysql_fetch_assoc($result);\n return $this->sqlAssoc;\n }\n else\n {\n return array();\n }\n }", "function _get_cat($id) {\r\n $qry = $this->db->where('cat_id', $id)\r\n ->get($this->_cat);\r\n return $qry->row();\r\n }", "public function findCategorieById(int $idCategorie) {\n $res = array_filter($this->categories,\n function ($c) use($idCategorie) {\n return $c[\"id\"] == $idCategorie;\n });\n return (sizeof($res) === 1) ? $res[array_key_first($res)] : null;\n }", "public function get($category_id);", "public function actionGet($id) {\n\t\treturn $this->txget ( $id, \"app\\models\\Category\" );\n\t}", "public function getById(int $id): ?Category\n {\n return $this->categoryRepository->getById($id);\n }", "public function get_cat_by_id($id) {\n $query = $this->query(\"SELECT `name` FROM `categories` WHERE id = '\" . $id . \"'\");\n if ($query->num_rows > 0) {\n $row = $query->fetch_row();\n return $row[0];\n } else\n return null;\n }", "public function show($id)\n {\n //\n $find = Category::find($id);\n if (!$find) {\n return response()->json(['message' => 'false'], 404);\n }\n return $find;\n }", "public function show($id)\n {\n return $this->categoryService->getCategory($id);\n }", "protected function findModel_category($id)\n {\n if (($model = Category::findOne($id)) !== null && $id != 1) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find($id=null)\n\t{\n\t\tif (empty($this->selects))\n\t\t{\n\t\t\t$this->select($this->table_name .'.*, category');\n\t\t}\n\t\t//$this->from();\n\t\t$this->db->where('news_articles.'.$this->key,$id);\n\t\t\n\t\t$this->db->join('news_categories', 'news_categories.id = news_articles.category_id', 'left');\n\t\t$result = $this->db->get($this->table_name)->result();\n\t\treturn $result[0];\n\t}", "public function edit_category ($id) {\n\t\treturn Category::find($id);\n\t}", "public static function getCategory($id) {\n\t\t\t$conn = parent::connect();\n\t\t\t$sql = \"SELECT * FROM \" . TBL_CATEGORY . \" WHERE id = :id\";\n\n\t\t\ttry {\n\t\t\t\t$st = $conn->prepare($sql);\n\t\t\t\t$st->bindValue(\":id\", $id, PDO::PARAM_INT);\n\t\t\t\t$st->execute();\n\t\t\t\t$row = $st->fetch();\n\t\t\t\tparent::disconnect($conn);\n\t\t\t\tif ($row) {\n\t\t\t\t\treturn new SiteCategory($row);\n\t\t\t\t}\n\t\t\t} catch (PDOException $e) {\n\t\t\t\tparent::disconnect($conn);\n\t\t\t\tdie (\"Query failed: \" . $e->getMessage());\n\t\t\t}\n\t\t}", "function get_by_cat($id)\n {\n $this->db->where('cat_id', $id);\n return $this->db->get($this->table)->result();\n }", "protected function getCategoryById($id)\n {\n if (!isset(self::$categories[$id])) {\n self::$categories[$id] = $this->categoryFactory->create()->load($id);\n }\n return self::$categories[$id];\n }", "function get_category_by_id($category_id)\n\t\t{\n\t\t\tif(!$category_id)\n\t\t\t\treturn \"\";\n\t\t\t$query = \" SELECT id,name,name_display,is_comment, alias, display_tags,display_title,display_sharing,display_comment,display_category,display_created_time,display_related,updated_time\n\t\t\t\t\t\tFROM \".$this->table_category .\" \n\t\t\t\t\t\tWHERE id = $category_id \";\n\t\t\tglobal $db;\n\t\t\t$sql = $db->query($query);\n\t\t\t$result = $db->getObject();\n\t\t\treturn $result;\n\t\t}", "public function getCategory($id)\n {\n $I = $this;\n $I->amAdminTokenAuthenticated();\n $I->sendGET($this->endpoint . \"/$id\");\n $I->seeResponseCodeIs(\\Codeception\\Util\\HttpCode::OK);\n return $I->grabResponse();\n }", "public static function getCategoriaById($id) {\n $db = new BaseDeDatos();\n\n $query = \"SELECT * FROM categoria WHERE id_cat=\".$id;\n\n $arrayCategorias = $db->realizarConsulta($query);\n\n $categoria = new Categoria($arrayCategorias[0][0], $arrayCategorias[0][1], \"imgs/categorias/\".$arrayCategorias[0][2]);\n\n return $categoria;\n }", "function getCategory($id_category){\n $db = db();\n $db->begin();\n $data = $db->exec('SELECT * FROM m_song WHERE fk_id_category = '.$id_category);\n\n return $data;\n }", "public function getCategorieById($id)\n\t{\n\t\tif($id === null)\n\t\t\treturn null;\n\t\t$this->ensureCategoriesLoaded(array($id));\n\t\tif(!isset($this->_categories[$id]))\n\t\t\treturn null;\n\t\treturn new GmthBridgeCategorie($this, $this->_categories[$id]);\n\t}", "private function getModel($id) {\n $category = $id ? Categories::findOne($id) : [];\n\n if ($id && !is_object($category)) {\n throw new \\yii\\web\\NotFoundHttpException('Категория не найдена');\n }\n\n return $category;\n }", "public function find(int $id, array $columns = ['*'])\n {\n try {\n $category = $this->category->find($id, $columns);\n }\n catch (\\Throwable $exception) {\n return false;\n }\n\n return $category;\n }", "public static function getByID($id) {\n\t\tif ($id == \"root\") {\r\n\t\t\t// Dummy empty \"root\" category. \r\n\t\t\t$cat = new InstitutionCategory();\r\n\t\t\t$cat->id = \"root\";\n\t\t\treturn $cat;\r\n\t\t} else {\r\n\t\t\treturn \tMyConsolatoPublication::getByIDGeneric($id, \"InstitutionCategory\");\r\n\t\t}\n\t}", "public function findById($id)\n {\n Log::info('ProjectMasterRepository->findById:-Inside ');\n\n $result = Category::where('id', $id)->first();\n \n\n Log::info('ProjectMasterRepository->findById:-Return '. json_encode($result));\n\n return $result;\n \n }", "public function find(int $id): EntityInterface\n {\n return parent::find($id) ?: new CategoryEntity();\n }", "public function show($id) {\n $o_article = Category::find($id);\n if (is_null($o_article)) {\n return $this->msg('category not exists', 1);\n }\n\n return $o_article;\n }", "public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }", "function theme_moove_get_course_category($id){\n\n global $DB;\n\n $sql_query = \"SELECT category\n FROM {course}\n WHERE id = $id\";\n\n $categoryid = $DB->get_record_sql($sql_query)->category;\n\n return $categoryid;\n }", "function getCategoryNameById($id = null){\n\t}", "function _BuscarCategoriaPorId($id)\n\t\t{\n\t\t\tR::begin();\n\t\t\t try{\n\t\t\t \t$query = 'SELECT * from sgcategoriamaquina where id=?';\n\t\t\t $cat = R::getRow($query,[$id]);\n\t\t\t R::commit();\n\t\t\t }\n\t\t\t catch(Exception $e) {\n\t\t\t $cat = R::rollback();\n\t\t\t $cat = \"error\";\n\t\t\t }\n\t\t\tR::close();\n\t\t\treturn $cat;\n\t\t}", "function get_category($id) {\n\t\t$data = $this->category->getAllCategory($id);\n\n\t\tif(empty($data)) {\n\t\t\t$statusCode = 404;\n\t\t} else {\n\t\t\t$statusCode = 200;\n\t\t}\n\t\t\n\n\t\t$result[\"data\"] = $data;\n\t\t$result['status'] = \"ok\";\n\t\treturn json_encode($result);\n\t}", "public function getCategory ( $_id ) {\r\n if ( $_id != 0 ) {\r\n $category = $this->categoryService->getWithParents( $_id );\r\n }\r\n // Creating a new one\r\n else{\r\n $category = new Category();\r\n }\r\n return $category;\r\n }", "public function show($id)\n {\n //\n $categoria = Tbl_Categoria::find($id);\n return $categoria;\n }", "public function getCategoryById($id)\n {\n try {\n $category = $this->categoryRepository->get($id, $this->getStore()->getId());\n $pathIds = $category->getPathIds();\n $collection = $this->categoryCollectionFactory->create();\n $collection->addAttributeToSelect('name');\n $collection->addFieldToFilter('entity_id', ['in' => $pathIds]);\n $collection->addFieldToFilter('name', ['nin' => $this->configuration->getExcludedCategoriesName()]);\n\n $path = '';\n foreach ($pathIds as $pathId) {\n if (($item = $collection->getItemById($pathId))) {\n $path .= self::CATEGORIES_SEPARATOR . $item->getName();\n }\n }\n\n $paths[] = trim($path, '/');\n return implode(self::PATHS_SEPARATOR, $paths);\n } catch (LocalizedException $e) {\n return null;\n }\n }", "public function show(int $id): Category\n {\n return User::find($id);\n }", "public function getById($id)//вернуть категории по id\n {\n if(is_numeric($id)){\n $sql = \"SELECT `title` FROM `category` WHERE `id`=\".intval($id);\n return $this->mysql->query($sql);\n }else{\n return 'ERROR';\n }\n\n }", "public function getById(int $id):?ProductCategory \n {\n $productCategory = null;\n \n // Generate the query\n $sql = \"SELECT id, name, status\n FROM product_categories\n WHERE id = :id\";\n \n // Open the connection\n $pdo = DbConfig::getPdo();\n \n // Execute the query\n $stmt = $pdo->prepare($sql);\n $stmt->execute([':id' => $id]);\n \n // Get the information of the product category\n if ($stmt->rowCount() > 0) {\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $productCategory = $this->createFromDbRow($row);\n }\n \n // Close the db connection\n $pdo = null;\n \n return $productCategory; \n }", "function get( $id = -1 )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n if ( $id != \"\" )\r\n {\r\n $db->array_query( $category_array, \"SELECT * FROM eZImageCatalogue_Category WHERE ID='$id'\" );\r\n if ( count( $category_array ) > 1 )\r\n {\r\n eZLog::writeNotice( \"Error: Category's with the same ID was found in the database. This shouldent happen.\" );\r\n return false;\r\n }\r\n else if ( count( $category_array ) == 1 )\r\n {\r\n $this->ID =& $category_array[0][$db->fieldName(\"ID\")];\r\n $this->Name =& $category_array[0][$db->fieldName(\"Name\")];\r\n $this->Description =& $category_array[0][$db->fieldName(\"Description\")];\r\n $this->ParentID =& $category_array[0][$db->fieldName(\"ParentID\")];\r\n $this->UserID =& $category_array[0][$db->fieldName(\"UserID\")];\r\n $this->SectionID =& $category_array[0][$db->fieldName(\"SectionID\")];\r\n }\r\n }\r\n return true;\r\n }", "public static function find($id);", "public function category($id = null)\n\t{\n\t\t/**Modelo Posts */\n\t\t$postsModel = new PostsModel();\n\t\t/**Cargamos las Categorías */\n\t\t$categoriesModel = new CategoriesModel();\n\t\t/**Buscamos el Nombre de las Categorias */\n\t\t$data[\"category\"] = $categoriesModel->where(\"id\",$id)->findAll();\n\t\t/**Buscamos los Post de esa Categoria */\n\t\t$data[\"posts\"] = $postsModel->where(\"category\",$id)->findAll();\n\n\t\t$this->loadViews(\"category\",$data);\n\t}", "public function findOneById(int $id): ?MyNotesCategories\n {\n return $this->app->repositories->myNotesCategoriesRepository->findOneById($id);\n }", "public function getCategory($_ID)\n {\n $return = $this->getUnique(\"categories\", $_ID);\n return $return;\n }", "public function getCategoryUrl($id)\n {\n\t return $category = $this->_categoryFactory->create()->load($id);\n }", "public function getCategory($categoryID)\n {\n //checks if value exists in database\n $sql = \"SELECT * FROM categories WHERE categoryID = :categoryID\";\n\n if ($stmt = $this->dbHandle->prepare($sql)) {\n // Bind variables to the prepared statement as parameters\n $stmt->bindParam(\":categoryID\", $param_categoryID, PDO::PARAM_STR);\n \n // Set parameters\n $param_categoryID = trim($categoryID);\n\n // Attempt to execute the prepared statement\n if ($stmt->execute()) {\n if ($stmt->rowCount() == 1) {\n $row = $stmt->fetch();\n return new Category($row);\n } else {\n return false;\n }\n } else {\n return false;\n }\n }\n //Close statement\n unset($stmt);\n //Close connection\n unset($pdo);\n }", "public function single($id)\n {\n /**\n * Query\n */\n $item = Category::with(['translations', 'parent'])->findOrFail($id);\n\n\n /**\n * Response structure\n */\n return new CategoryResource($item);\n }", "public function show($id)\n {\n return IngramCategory::where('category_id', \"=\", $id)->get();;\n }", "function getby_id($id)\n {\n $this->db->where('id', $id);\n return $this->db->get('wp_kategori_kas')->row();\n }", "public function category($id){\n\t\t$categorie = $this->Category->find($id);\n\n\t\tif ($categorie === false) {\n\t\t\t$this->notFound();\n\t\t}\n\t\t$posts = $this->Post->lastByCategory($id);\n\t\t$categories = $this->Category->all();\n\n\t\t['posts'=>$posts, 'categorie'=>$categorie, 'categories'=>$categories];\n\t\t$this->render('posts.category', compact('posts', 'categories', 'categorie'));\n\t}", "public function show($id)\n {\n //\n return PriceCategories::findOrFail($id);\n }", "public static function fetch_by_id($id){\n\t\t$mysql = mysql_connection::get_instance();\n\t\t\n\t\t$sql = 'SELECT\n\t\t\t\t\t`items`.`item_id`,\n\t\t\t\t\t`items`.`item_title`,\n\t\t\t\t\t`items`.`item_description`,\n\t\t\t\t\t`items`.`item_price`,\n\t\t\t\t\t`items`.`item_weight`,\n\t\t\t\t\t`items`.`item_quantity`,\n\t\t\t\t\t`items`.`item_time_created`,\n\t\t\t\t\t`categories`.`category_id`,\n\t\t\t\t\t`categories`.`category_name`,\n\t\t\t\t\t`categories`.`category_removed`\n\t\t\t\tFROM `items`\n\t\t\t\tINNER JOIN `categories` ON `items`.`category_id` = `categories`.`category_id`\n\t\t\t\tWHERE `item_id` = ?';\n\t\t\n\t\t$stmt = $mysql->prepare($sql);\n\t\t$stmt->bind_param('i', $id);\n\t\t$stmt->execute();\n\t\t$result = $stmt->get_result();\n\t\t$stmt->close();\n\t\t\n\t\tif ($result->num_rows != 1){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$row = $result->fetch_assoc();\n\t\t\n\t\t$category = new category(intval($row['category_id']), $row['category_name'], (bool) $row['category_removed']);\n\t\t\n\t\treturn new self(intval($row['item_id']), $category, $row['item_title'], $row['item_description'], floatval($row['item_price']), intval($row['item_weight']), intval($row['item_quantity']), intval($row['item_time_created']));\n\t}", "private function checkCategoryExists($id)\n {\n $category = Category::find($id);\n if (!$category) {\n throw new DomainException(self::MESSAGE_CATEGORY_NOT_FOUND);\n }\n }", "public function getById(int $id):?ProductCategory \n {\n $productCategoryDAO = new ProductCategoryDAO();\n $productCategory = $productCategoryDAO->getById($id);\n \n return $productCategory;\n }", "function productByCategory($id)\n {\n \t\n }", "public function getById($categoryID, $type = 'article'){\n\n\t\t//find by alias at first\n\t\t$where = array(\n\t\t\t'alias' => $categoryID,\n\t\t\t'type' \t=> $type,\n\t\t\t);\n\t\t$this -> db -> where($where);\n\t\t$this -> db -> select('*');\n\t\t$category = $this -> db -> get($this -> tableName) -> result_array();\n\n\t\tif( ! $category){\n\t\t\t$where = array(\n\t\t\t\t'id' => \t$categoryID,\n\t\t\t\t'type' => \t$type,\n\t\t\t\t);\n\n\t\t\t$this -> db -> where($where);\n\t\t\t$this -> db -> select('*');\n\t\t\t$category = $this -> db -> get($this -> tableName) -> row_array();\n\t\t} \n\n\t\t//if type quite forum the deal it\n\t\treturn $category;\n\t}", "public function get(int $id)\n {\n return HandbookCategory::find($id);\n }", "function getCategory($id) {\n $this->db->select(\"*\");\n $this->db->where(\"categoryID\", $id);\n $query = $this->db->get('post_category');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }", "public function getDetailTag($id) {\r\n\t\t$category = $this->get('node')->find('first',array(\r\n\t\t\t'contain' => array(\r\n\t\t\t\t'CloggySubject' => array(\r\n\t\t\t\t\t'fields' => array('CloggySubject.subject')\r\n\t\t\t\t),\r\n\t\t\t\t'CloggyParentNode'\r\n\t\t\t),\r\n\t\t\t'conditions' => array('CloggyNode.id' => $id),\r\n\t\t\t'fields' => array('CloggyNode.id')\r\n\t\t));\t\t\t\r\n\t\r\n\t\treturn $category;\r\n\t\r\n\t}", "public static function find($id) {\n return parent::find(__CLASS__, $id);\n }", "public function getCategory($id)\n {\n if (($id != '') && ctype_digit((string)$id)) {\n $query = 'SELECT category_id, `category_name`\n FROM categories\n WHERE category_id= :id';\n $statement = $this->db->prepare($query);\n $statement->bindValue('id', $id, \\PDO::PARAM_INT);\n $statement->execute();\n $result = $statement->fetchAll(\\PDO::FETCH_ASSOC);\n return !$result ? array() : current($result);\n } else {\n return array();\n }\n }", "function eZImageCategory( $id=-1 )\r\n {\r\n $this->ExcludeFromSearch = \"false\";\r\n if ( $id != -1 )\r\n {\r\n $this->ID = $id;\r\n $this->get( $this->ID );\r\n }\r\n }", "public function testFindById(): void\n {\n // given\n $expectedCategory = new Category();\n $expectedCategory->setName('Test Category');\n $this->categoryRepository->save($expectedCategory);\n\n // when\n $result = $this->categoryService->findOneById($expectedCategory->getId());\n\n // then\n $this->assertEquals($expectedCategory->getId(), $result->getId());\n }", "protected function findModel($id)\n {\n if (($model = Category::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('Такой категории нет.');\n }\n }", "protected function getNodeById($id) {\n return Db::test('SELECT * FROM categories WHERE id=?', [$id])->fetchObject();\n }", "public function getJobCategory($id) \n { \n if (is_numeric($id)) {\n return $this->find($id)->current();\n }\n return null;\n }", "public function findCategoryById( $categoryId )\n {\n return $this->categoryDao->findById($categoryId);\n }", "function getCourseCategoryByCategoryId($id){\n\n $select=$this->select()->where(\" categoryid = ?\",$id);\n return $this->fetchAll($select)->toArray();\n }" ]
[ "0.79099834", "0.77596533", "0.7722687", "0.7716146", "0.7690174", "0.75676817", "0.75472206", "0.74986047", "0.7488659", "0.74852705", "0.74188745", "0.735168", "0.73232484", "0.7305042", "0.72833675", "0.72822237", "0.7275362", "0.7258605", "0.72245276", "0.7212937", "0.71889937", "0.71879905", "0.71586263", "0.71459156", "0.7135091", "0.71123576", "0.71024716", "0.70645595", "0.7054275", "0.7054275", "0.70411396", "0.70366305", "0.7027842", "0.69963515", "0.69694585", "0.6915795", "0.6903325", "0.6881905", "0.6881536", "0.6819692", "0.68195283", "0.68118733", "0.6800952", "0.67938864", "0.6791692", "0.67461044", "0.6745795", "0.6738371", "0.67223823", "0.6669435", "0.6664427", "0.6648416", "0.6645372", "0.66347706", "0.66233456", "0.6618413", "0.6601005", "0.6579539", "0.6576133", "0.6567293", "0.6564427", "0.65115947", "0.6511463", "0.6500337", "0.64858776", "0.6478549", "0.6468282", "0.64514405", "0.6449225", "0.6447233", "0.64402676", "0.6434332", "0.6429691", "0.64270335", "0.64244676", "0.6405793", "0.63957953", "0.6380563", "0.63451755", "0.6344734", "0.6338322", "0.63301235", "0.63263065", "0.63153976", "0.6301602", "0.6294474", "0.62774396", "0.62769204", "0.6275469", "0.6270179", "0.6267814", "0.62627774", "0.6262229", "0.6258637", "0.6256969", "0.625173", "0.6249554", "0.6238076", "0.6237747", "0.62312204" ]
0.67457294
47
Find by category by slug
public static function findBySlug($categorySlug) { return self::where('slug->'.App::getLocale(), $categorySlug)->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findBySlugWithCategory($slug);", "public function findCategoryBySlug($slug);", "public function findBySlugWithCategoryAndTags($slug);", "function get_category_by_slug($slug)\n {\n }", "public function findBySlug($slug)\n {\n return Category::where('slug', $slug)\n ->first();\n }", "static function get_category_by_slug($slug){\n\t\treturn self::$db->where('slug',$slug)->get('categories')->row();\n\t}", "public function findCategoryBySlug($slug)\n {\n return $this->db->fetchRow(\"SELECT * FROM `blog_categories` WHERE `type` = 'cat' AND `slug` = :slug\", [ 'slug' => $slug ]);\n }", "public function findBySlug(string $slug);", "public function findBySlug(string $slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findCategoryBySlug($slug):Category\n {\n return $this->categoryModel()->whereSlug($slug)->first();\n }", "public function bySlug($slug);", "public function findByCat($slug){\n $cat = Category::where('slug', $slug)->firstOrFail();\n \n $pizzas = Pizza::latest()\n ->with('category')\n ->where([\n ['name', 'like', '%' . request('search') . '%'],\n ['category_id', $cat->id],\n ])\n ->orWhere([\n ['description', 'like', '%' . request('search') . '%'],\n ['category_id', $cat->id],\n ])\n ->get();\n\n return view('pizzas.pizzasByCat', ['pizzas' => $pizzas, 'categories' => Category::all(), 'currentCat' => $cat->name]);\n }", "public function slug($slug){\n $criteria = Category::where('slug', $slug)->first();\n\n return new ResourceCategory($criteria);\n }", "public function category($slug = '')\r\n {\r\n \r\n }", "public function getBySlug(string $slug)\n {\n $category = HandbookCategory::where('ru_slug', $slug)->first();\n return $category;\n }", "public function blogSearchByCat($slug){\n\n\n $cats = Category::where('slug', $slug) -> first();\n\n return view('comet.category-blog', [\n 'all_posts' => $cats -> posts\n ]);\n\n\n\n }", "public function getBySlug(string $slug);", "public function get_category_by_banner($slug = '')\n\t{\n\t\tif (empty($slug))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->select('categories.*,banners.title,banners.sub_title,banners.description,banners.banner');\n\t\t\t$this->db->from('categories');\n\t\t\t$this->db->join('banners', 'banners.id=categories.banner_id');\n\t\t\t$this->db->where('categories.slug', $slug);\n\t\t\t$query = $this->db->get();\n\t\t\t$result = $query->row_array();\n\n\t\t\tif (empty($result))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}", "public function postCategory($slug) {\n // 'name' che è il nome per esteso della categoria\n // 'slug' che è lo slug ricavato dal nome per esteso della categoria\n // questa funzione riceve in ingresso lo slug ($slug) della categoria\n // e deve ricavare l'elenco di tutti i posts che hanno quella categoria associata\n // identificati dallo slug ricevuto come parametro in ingresso.\n // Poi la funzione richiama una view e le passa l'elenco di tutti i posts trovati\n // e l'oggetto categoria, quella identificata dallo slug ricevuto in ingresso\n\n // cerco nella colonna 'slug' della mia tabella 'categories', la categoria (record) con slug uguale al parametro ricevuto\n $category = Category::where('slug', $slug)->first();\n\n // verifico se la select fatta sul DB mi ha ritornato qualcosa per la categoria ricercata tramite slug\n // ad esempio l'utente potrebbe modificare la stringa nella barra indirizzi, alterando il nome\n // dello slug e scrivendo un qualcosa che non esiste e non corrisponde a nessuna categoria del DB\n if (!empty($category)) {\n // qui sfrutto la relazione fra categorie e posts, cioè la relazione fra le entità/modelli\n // Category e Post. Nella classe Category è definito un metodo posts()\n // (cioè col nome dell'entità verso la quale è definita la relazione)\n // posts() ritorna $this->hasMany('App\\Post');\n // chiamo la proprietà posts (in questa maniera'$category->posts')\n // che restituisce i post che sono legati da relazione in base alla categoria\n $posts_by_category = $category->posts;\n\n // chiamo una view per visualizzare tutti i post della categoria ricercata,\n // gli passo la categoria e l'elenco dei posts\n return view('public.posts.posts-by-category', [\n 'category' => $category,\n 'posts' => $posts_by_category\n ]);\n } else {\n // ritorno la pagina di errore \"Page not found\" poichè lo slug ricevuto in ingresso\n // non corrisponde a nessuna categoria presente nel mio DB (tabella 'categories')\n return abort(404);\n }\n }", "public function category( $slug ) {\n\t\t$data[\"categoryInfo\"] = SM::getCache( 'category_' . $slug, function () use ( $slug ) {\n\t\t\treturn Category::with( \"blogs\" )\n\t\t\t ->where( \"slug\", $slug )\n\t\t\t ->where( 'status', 1 )\n\t\t\t ->first();\n\t\t} );\n\t\tif ( count( $data[\"categoryInfo\"] ) > 0 ) {\n\t\t\t$page = \\request()->input( 'page', 0 );\n\t\t\t$key = 'categoryBlogs_' . $data[\"categoryInfo\"]->id . '_' . $page;\n\t\t\t$data[\"blogs\"] = SM::getCache(\n\t\t\t\t$key, function () use ( $data ) {\n\t\t\t\t$blog_posts_per_page = SM::smGetThemeOption(\n\t\t\t\t\t\"blog_posts_per_page\",\n\t\t\t\t\tconfig( \"constant.smFrontPagination\" )\n\t\t\t\t);\n\n\t\t\t\treturn $data[\"categoryInfo\"]->blogs()\n\t\t\t\t ->where( \"status\", 1 )\n\t\t\t\t ->paginate( $blog_posts_per_page );\n\t\t\t}, [ 'categoryBlogs' ]\n\t\t\t);\n\t\t\t$data['seo_title'] = $data['categoryInfo']->seo_title;\n\t\t\t$data[\"meta_key\"] = $data[\"categoryInfo\"]->meta_key;\n\t\t\t$data[\"meta_description\"] = $data[\"categoryInfo\"]->meta_description;\n\t\t\t$data[\"image\"] = $data[\"categoryInfo\"]->image != '' ? asset( SM::sm_get_the_src( $data[\"categoryInfo\"]->image, 750, 560 ) ) : '';\n\n\t\t\treturn view( 'page.category', $data );\n\t\t} else {\n\t\t\treturn abort( 404 );\n\t\t}\n\t}", "public function findBySlug($slug)\n {\n $result = $this->_model->where('news_slug', '=', $slug)->first();\n\n return $result;\n }", "public function getBySlug()\n {\n }", "public function findBySlug(string $slug) {\n return $this->getFirstBy('slug', $slug);\n }", "public function findBySlug($slug)\n {\n $recipe = Recipe::where('slug', $slug)->first();\n return new RecipeCategoryResource($recipe);\n }", "public function findBySlug(string $slug)\n {\n /** @psalm-suppress LessSpecificReturnStatement */\n return $this->findOneBy([ 'slug' => $slug ]);\n }", "public function findBySlug($slug)\n {\n return $this->model->where('slug', $slug)->first();\n }", "public function findBySlug($slug)\n {\n return $this->model->where('slug', $slug)->first();\n }", "public function findOneBySlug(Slug $slug);", "public function findOneBySlug(Slug $slug);", "public function get_one_post_joined_with_category_bySlug($postSlug){\n $db = \\Config\\Database::connect();\n $builder = $db->table('posts');\n $builder->select('posts.id, posts.category_id, posts.title, posts.slug, posts.body, posts.created_at, categories.name')->where('slug', $postSlug);\n $builder->join('categories', 'posts.category_id = categories.id');\n $query = $builder->get();\n $results = $query->getResult();\n \n return $results;\n }", "public function findBySlug(string $slug): Product;", "public function show($slug)\n {\n try {\n \n $category = $this->categoryService->show($slug);\n return $category;\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n }", "public function showPostBySlug($slug)\n{\n \n $sql = \"SELECT p.ID, p.media_id, p.post_author,\n p.post_date, p.post_modified, p.post_title,\n p.post_slug, p.post_content, p.post_summary, \n p.post_keyword, p.post_tags,\n p.post_status, p.post_type, p.comment_status, u.user_login\n FROM tbl_posts AS p\n INNER JOIN tbl_users AS u ON p.post_author = u.ID\n WHERE p.post_slug = :slug AND p.post_type = 'blog'\";\n\n $this->setSQL($sql);\n\n $postBySlug = $this->findRow([':slug' => $slug]);\n\n return (empty($postBySlug)) ?: $postBySlug;\n \n}", "function article_category_slug() {\n $category = Registry::get('category');\n return $category->slug;\n}", "public function findBySlug($slug)\n {\n return $this->model->whereSlug($slug)->first();\n }", "private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }", "public function findCat($cat)\n {\n $query = $this->db->query('SELECT * FROM `view_api_recipes` WHERE id_tag=\"' . $cat . '\"');\n return $query->getResult();\n }", "static function get_project_by_slug($slug){\n\t\treturn self::$db->select('st.*,cat.name,u.*')->from('stock as st')->where('st.slug',$slug)->join('users as u','u.id = st.user_id')->join('categories as cat','cat.id = st.cat_id')->get()->row();\n\t}", "public function loadCategoryModel($slug)\n {\n $model = ArticleCategory::model()->findByAttributes(array(\n 'slug' => $slug,\n 'status' => Article::STATUS_ACTIVE\n ));\n \n if ($model === null) {\n throw new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n \n return $model;\n }", "public function findCategories();", "public function category_show($locale,$slug)\n {\n $this->checkLang($locale);\n\n $Category = Category::where('slug',$slug)->with('categories')->with('parent')->first();\n if($Category) {\n return $this->sendResult('show Category',new CategoryResource($Category));\n }\n return $this->sendResult('Category not found',null, 'Category not found',false);\n }", "public function findPublicBySlug($slug, $locale);", "private function searchByCategory($category){\n \n $searchResults = null;\n $items = $this->items;\n if(strlen(trim($category)) == 0 ) return $searchResults;\n \n foreach($items as $item){\n foreach($item->categories as $category_tmp)\n if($category == $category_tmp){\n $searchResults[] = $item;\n } \n }\n return $searchResults;\n }", "public function scopeFindBySlug ($query, $slug) {\n return $query->where('slug', $slug)->first();\n }", "public function getProductsByCategory($slug){\n $category = Category::where(['url'=> $slug, 'status' => 1])->first();\n \n if($category){\n // Show parent category\n if($category->parent_id != 0){\n $parent_categories = Category::with('categories')->where('id', $category->parent_id)->get();\n }else{\n $parent_categories = [$category];\n }\n \n // Show products by category_id\n $products = Product::where('category_id', $category->id)->where('status', 1)->orderBy('id', 'DESC')->paginate(8);\n\n return view('frontend.products_by_category')->withCategory($category)->withProducts($products)->withParentCategories($parent_categories);\n }\n return abort(404, 'Unauthorized action.');\n }", "public function articleBySlug($article_slug)\n {\n $a = Article::where('slug', $article_slug)->get()->pop();\n //dd($a);\n $category = json_decode($a->categories()->get());\n // If it's an array\n if (is_array($category)){\n //Obtener todos los id de categoria\n $category_ids = collect($category)->pluck('id');\n\n $articles = Article::whereHas('categories', function($query) use ($category_ids) {\n // Assuming your category table has a column id\n $query->whereIn('categories.id', $category_ids);\n })->get();\n\n // Excluye el artículo que estás viendo\n $filtered_articles = $articles->filter(function ($current, $key) use ($a)\n {\n return ($current->slug != $a->slug);\n });\n\n //dd($filtered_articles);\n } else {\n dd('Not an array (bad url parameter)');\n }\n //dd($articles);\n return view('frontend.articleBySlug', ['main' => $a, 'related' => $filtered_articles]);\n }", "public function actionCategory($slug)\n {\n $category = $this->loadCategoryModel($slug);\n \n $criteria = new CDbCriteria();\n $criteria->compare('t.status', Article::STATUS_PUBLISHED);\n $criteria->with = array(\n 'activeCategories' => array(\n 'select' => 'activeCategories.category_id',\n 'together' => true,\n 'joinType' => 'INNER JOIN',\n 'condition' => 'activeCategories.category_id = :cid',\n 'params' => array(':cid' => $category->category_id),\n )\n );\n $criteria->order = 't.article_id DESC';\n \n $count = Article::model()->count($criteria);\n \n $pages = new CPagination($count);\n $pages->pageSize = 10;\n $pages->applyLimit($criteria);\n \n $articles = Article::model()->findAll($criteria);\n\n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | ' . $category->name,\n 'pageMetaDescription' => StringHelper::truncateLength($category->description, 150),\n ));\n \n Yii::app()->clientScript->registerLinkTag('canonical', null, $this->createAbsoluteUrl($this->route, array('slug' => $slug)));\n Yii::app()->clientScript->registerLinkTag('shortlink', null, $this->createAbsoluteUrl($this->route, array('slug' => $slug)));\n \n $this->render('category', compact('category', 'articles', 'pages'));\n }", "public function getBySlug(string $slug): ?Category\n {\n return $this->categoryRepository->getBySlug($slug);\n }", "public function findOneBySlug($slug) {\r\n $sql = \"SELECT * FROM `$this->table` WHERE `slug` = '$slug' LIMIT 1\";\r\n $cms = $this->db->fetchAssoc($sql);\r\n\r\n $cms['is_visible'] = $cms['is_visible'] ? true : false;\r\n\r\n return $cms;\r\n }", "public function category ($slug) {\n\n $category = \\App\\Entities\\Blog\\Category::whereSlug($slug)->first();\n abort_unless($category, 404);\n $posts = \\App\\Entities\\Blog\\Post::where('category_id', $category->id)->paginate(12);\n return view('app::category', [\n 'category' => $category,\n 'posts' => $posts\n ]);\n }", "public function fetchBySlug($slug)\n {\n return $this->fetchByColumn('slug', $slug);\n }", "public function getBySlug($slug)\n\t{\n\t\treturn $this->model->where('slug',$slug)->firstOrFail();\n\t}", "public function slug($slug);", "function findByName($name) {\n \t$str_len = strlen($name);\n \ttrim($name);\n \t$name = str_replace('category', '', strtolower($name));\n \t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM commoditycategory WHERE LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') \";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage($result);\n\t\treturn $result; \n\t}", "function filter_categories ( $page) {\n global $db;\n return find_by_sql(\"SELECT * FROM categorias where idpagina =\".$db->escape($page).\" ORDER BY name\");\n \n}", "public function findContactBySlug($slug)\n {\n return $this->getContacts()->findContactBySlug($slug);\n }", "function alaya_cat_id($cate_slug){\n $category=get_term_by('slug',$cate_slug,'category');\n if($category){\n\t $cate_id = $category->term_id;\n\t $cate_id = apply_filters('alaya_cat_id', $cate_id);\n\t return $cate_id;\n\t}\n}", "static function get_post_by_slug($slug){\n\t\treturn self::$db->where('slug',$slug)->get('blog')->row();\n\t}", "public function findBySlug($slug)\n\t{\n\t\treturn Article::where('slug', $slug)\n\t\t\t\t\t->active()\n\t\t\t\t\t->firstOrFail();\n\t}", "public function getCategory(string $slug)\n {\n return redirect('/home?cat=' . $slug);\n // dd($slug);\n $locale = request()->session()->get('locale');\n if($locale==null) {\n $locale = 'fa';\n }\n App::setlocale($locale);\n\n $category = $this->categoryRepo->findCategoryById($slug);\n\n $repo = new CategoryRepository($category);\n\n $products = $repo->findProducts()->where('status', 1)->all();\n\n return view('front.categories.category', [\n 'category' => $category,\n 'products' => $repo->paginateArrayResults($products, 20),\n 'locale' => $locale\n ]);\n }", "function findByCategory($category) {\n return Documents::find(array(\n 'conditions' => array('category_id = ?', $category->getId()),\n 'order' => 'name'\n ));\n }", "public function find($slug)\n {\n if (isset($this->storage[$slug]))\n {\n return $this->storage[$slug];\n }\n }", "public function show($slug){ \n $categoria = Categorie::where('slugCategoria',$slug)->first();\n return view('adminviews.categories.show', compact('categoria'));\n }", "public function findByIdWithCategory($id);", "function get_product_id_from_cat_query($category) {\n global $wpdb;\n\n $product_results = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT DISTINCT post_id\n FROM wp_postmeta\n JOIN randys_categoryproduct cp ON cp.ProductID = wp_postmeta.meta_value\n JOIN randys_category c ON c.CategoryID = cp.CategoryID\n WHERE wp_postmeta.meta_key = %s\n AND (c.CategoryID = %d OR c.ParentID = %d)\",\n array('_randy_productid', $category, $category)\n )\n );\n\n return $product_results;\n}", "public function getBySlug($slug) {\n\t\treturn $this->find('first', array(\n\t\t\t'conditions' => array($this->alias . '.slug' => $slug),\n\t\t\t'contain' => array_keys($this->belongsTo),\n\t\t\t'cache' => array($this->alias . '::' . __FUNCTION__, $slug)\n\t\t));\n\t}", "public function category($category, $subdomain)\n {\n // if multiple words, try flipping them\n $words = explode(' ', $category);\n if (count($words) > 1) {\n // remove bogus words\n foreach ($words as $k => $w) {\n // if less than 3 chars, remove\n if (strlen($w) < 3) {\n unset($words[$k]);\n }\n }\n }\n\n // if we still have multiple words\n if (count($words) > 1) {\n $sql = array();\n foreach ($words as $w) {\n $sql[] = sprintf('(SELECT category AS label, category AS value\n FROM ats_jobs\n WHERE category LIKE %s\n ORDER BY category ASC)',\n $this->_db->quote('%' . $w . '%'));\n }\n\n $sql = 'SELECT DISTINCT category AS label, category AS value\n FROM ' . implode(' UNION ', $sql) . '\n ORDER BY category ASC';\n\n } else {\n $sql = sprintf('SELECT DISTINCT category AS label, category AS value\n FROM ats_jobs\n WHERE category LIKE %s\n ORDER BY category ASC',\n $this->_db->quote('%' . $words[0] . '%'));\n }\n\n return $this->_db->query($sql)->fetchAll();\n }", "public function findByCategory($category) {\n\t\t if ($this->identityMap->hasIdentifier($category, $this->objectType)) {\n\t\t $object = $this->identityMap->getObjectByIdentifier($category, $this->objectType);\n\t\t } else {\n\t\t $query = $this->createQuery();\n\t\t $query->getQuerySettings()->setRespectSysLanguage(FALSE);\n\t\t $query->getQuerySettings()->setRespectStoragePage(FALSE);\n\t\t $object = $query->matching($query->equals('categories', $category))->execute();\n\t\t }\n\t\t return $object;\n\t}", "public function show($slug)\n {\n $categoria = Categoria::where('slug',$slug)->firstOrFail();\n return \\response($categoria);\n }", "public function getRecord($slug){\n return $this->where(\"slug\", $slug)->first();\n }", "public function findPostBySlug($post_id) {\n $sql = \"SELECT * \n FROM posts p \n INNER JOIN users u ON p.author_id = u.id \n INNER JOIN categories c ON p.cat_id = c.cat_id\n WHERE p.post_id = $post_id\";\n return mysqli_query($this->conn, $sql)->fetch_assoc();\n }", "function get_product_by_slug($slug)\n{\n $db = get_connection();\n\n $sql = <<<SQL\n SELECT *\n FROM products\n WHERE\n slug = :slug\nSQL;\n\n $statement = $db->prepare($sql);\n $statement->execute([\n ':slug' => $slug,\n ]);\n\n $product = (array) $statement->fetch(PDO::FETCH_ASSOC);\n $product['images'] = get_images($product['id']);\n\n return $product;\n}", "public static function findBySlug(string $slug, array $columns = ['*']);", "public function showCategoryPage($slug)\n {\n $category = Category::whereSlug($slug)->firstOrFail();\n\n //get the category id, because in the beginning, get the slug\n $category_id = $category->id;\n\n //choose all posts of category\n $posts = Post::with('category')->where('category_id','=', $category_id)->paginate(10);\n return view('category.index', compact('category', 'posts'));\n }", "public function getOneBySlug($slug)\n {\n return reset($this->prepare(array(DB::findOne($this->table, 'slug = ?', array($slug)))));\n }", "static function get_category_by_id($category){\n\t\treturn self::$db->where('id',$category)->get('categories')->results();\n\t}", "public function fetchByTag($tagSlug)\n {\n $from = \"FROM `blog_categories` AS `c` LEFT JOIN `blog_category_has_articles` AS `link` ON `link`.`category_id` = `c`.`id` LEFT JOIN `blog_articles` AS `a` ON `a`.`id` = `link`.`article_id` AND `a`.`published` < NOW()\";\n $where = \"WHERE `c`.`type` = 'tag' AND `c`.`slug` = :slug\";\n $params = [ 'slug' => $tagSlug ];\n return $this->listArticles(\"`a`.`id`, `a`.`title`, `a`.`slug`, `a`.`lead`, `a`.`image_url`, `a`.`published`\", $from, $where, $params);\n }", "public static function slug($slug);", "protected function find_plugin_for_slug($slug)\n {\n }", "public function showCategory($slug)\n {\n $menuItems = Category::orderBy('category_name', 'ASC')->whereparent_id(NULL)->get();\n $menu = $this->drawMenu($menuItems);\n\n $categories = Category::orderBy('category_name', 'ASC')->whereslug($slug)->get();\n $crumbs = $this->drawBreadcrumbs($categories);\n\n $products = $this->getProducts($categories);\n $category = Category::orderBy('category_name', 'ACS')->whereslug($slug)->first();\n\n /*foreach($categories as $cat)\n {\n $this->products[] = Product::wherecategory_id($cat->id)->get();\n }*/\n\n return View::make('catalog')\n ->with('menu', $menu)\n ->with('breadcrumbs', $crumbs)\n ->with('category', $category->category_name)\n ->with('products', $products);\n }", "function get_cat_by_dir($catdir,$moduleid) {\r\n\tglobal $db;\r\n\treturn $db->get_one(\"SELECT * FROM {$db->pre}category WHERE moduleid = $moduleid and catdir='$catdir'\");\r\n}", "public function getPageBySlug($slug)\n {\n return $this->findOneBy(array('slug' => $slug));\n }", "function get_project_category_by_slug($slug,$approved =0) {\n\n\n\n $this->db->select('projects.id as id,project_slug,category.id as cat_id, sub_category.price,sub_category.id as sub_cat_id, posted_by,budget,title,details,projects.file_path,projects.file_name,category.name as cat_name, sub_category.name as sub_cat_name,projects.location,projects.duration');\n $this->db->from('projects');\n $this->db->where('category.slug', $slug);\n $this->db->where('users.deleted', '0');\n if($approved !=0){\n\n $this->db->where('projects.approved', $approved);\n }\n\n $this->db->join('category', 'category.id = projects.category','left outer');\n $this->db->join('sub_category', 'sub_category.id = projects.sub_category','left outer');\n $this->db->join('users', 'users.id = projects.posted_by');\n\n\n $query = $this->db->get();\n\n\n\n if ($query->num_rows() >= 1){ return $query->result_array(); }\n\n\n\n return false;\n\n }", "private function filterCategory()\n {\n if(empty($this->category) || $this->category === static::FILTER_CATEGORY_NONE) {\n return;\n }\n\n if($this->category === static::FILTER_CATEGORY_OTHER) {\n $this->query->andWhere(['LIKE', 'category', 'yii\\\\']);\n return;\n }\n\n $this->query->andWhere(['category' => $this->category]);\n }", "public function findOneBySlug($slug)\n {\n return $this->createQueryBuilder('i')\n ->where('i.slug = :slug')\n ->setParameter('slug', $slug)\n ->getQuery()\n ->getOneOrNullResult();\n }", "public function category($slug)\n {\n $cate = Category::where(['slug' => $slug])->first();\n //2 . chứa tên danh mục cha và sản phẩm theo danh mục (gồm cả SP thuộc cha và con)\n $data = [];\n\n foreach ($this->categories as $category) {\n if ($category->id == $cate->id ) { // lấy danh mục cha\n\n $categoryIds = []; // biến chưa id của danh mục , cha / con\n\n $categoryIds[] = $category->id;\n\n foreach ($this->categories as $categoryChild1) {\n if ($categoryChild1->parent_id == $category->id) {\n $categoryIds[] = $categoryChild1->id;\n\n foreach ($this->categories as $categoryChild2) {\n if ($categoryChild2->parent_id == $categoryChild1->id) {\n $categoryIds[] = $categoryChild2->id;\n }\n }\n }\n }\n\n // SQL query dữ liệu sản phẩm của cả cha/con\n $products = Product::where(['is_active' => 1])\n ->whereIn('category_id' , $categoryIds)\n ->limit(40)\n ->orderBy('id', 'desc')\n ->orderBy('position', 'asc')\n ->get();\n\n\n $data = [\n 'name' => $category->name,\n 'products' => $products ,// toàn bộ sản phẩm gồm cả cha / con\n ];\n\n\n }\n }\n\n return view('frontend.category',['data' => $data]);\n }", "public function getCategory();", "public function getCategory();", "public function show( $slug)\n {\n// $job = Job:: where('slug', $slug)->first();\n// $category_jobs= Job::where('category_id',$job->category_id)->get();\n// return view('job.show',compact('job','category_jobs'));\n\n// $categories = Category::orderBy('created_at', 'desc')->get();\n// $category= Category::where('slug',$slug)->first();\n//\n// if(!empty($category)){\n// $jobs= Job::where('category_id' , $category->id)\n// ->orderBy('created_at', 'desc')->Paginate(5);\n// return view('job.show', compact('categories','jobs', 'category'));\n// }\n\n }", "function tkno_get_top_category_slug( $return_slug=false, $cat_id=false ) {\n global $post;\n $curr_cat = ( $cat_id ) ? get_category_parents( $cat_id, false, '/', true ) : get_the_category_list( '/' , 'multiple', $post->ID );\n $valid_cats = ( is_outdoors() ) ? array( 'spring', 'summer', 'fall', 'winter', 'trips', 'outdoors' ) : array( 'music', 'food', 'drink', 'things-to-do', 'arts' );\n $curr_cat = explode( '/', $curr_cat );\n $return_cat = array();\n foreach ( $curr_cat as $current ) {\n $current = sanitize_title( strtolower( $current ) );\n if ( in_array( $current, $valid_cats ) ) {\n $return_cat['slug'] = $current;\n if ( $return_slug ) { \n return $current;\n }\n break;\n }\n }\n if ( ! empty( $return_cat['slug'] ) ) { \n $cat_for_name = get_category_by_slug( $return_cat['slug'] );\n $return_cat['cat_name'] = $cat_for_name->name;\n $return_cat['term_id'] = $cat_for_name->term_id;\n return (object) $return_cat;\n } else {\n return false;\n }\n}", "private function parseCategoryUrl() {\n $sql = \"SELECT\n id,\n name\n FROM\n categories\";\n if(!$stmt = $this->db->prepare($sql)){return $this->db->error;}\n if(!$stmt->execute()) {return $result->error;}\n $stmt->bind_result($id, $name);\n while($stmt->fetch()) {\n $name = lowerCat($name);\n if($this->cat == $name) {\n $this->catId = $id;\n break;\n }\n }\n $stmt->close();\n if($this->catId !== -1) {\n $this->parsedUrl = '/'.$this->catId.'/'.$this->cat;\n }\n }", "public function getSlugCategory(Request $rq)\n {\n $category_name = $rq->category_name;\n $category_slug = str_slug($category_name);\n $slug = Category::where('category_slug',$category_slug)->get();\n if($slug)\n {\n $category_slug = $category_slug . '-' . uniqid();\n return response(['category_slug' => $category_slug]);\n } else {\n $category_slug = $category_slug . '-' . uniqid();\n return response(['category_slug' => $category_slug]);\n }\n }", "public function getWithCategory($categoryIdSlug, $page = null, $perPage = null, $data = null, $includeDeleted = false)\n {\n $oDb = Factory::service('Database');\n\n // Join the $this->tableCat table so we can WHERE on it.\n $oDb->join(\n $this->tableCat . ' ' . $this->tableCatPrefix,\n $this->tableCatPrefix . '.post_id = ' . $this->tableAlias . '.id'\n );\n $oDb->join(\n NAILS_DB_PREFIX . 'blog_category bc',\n 'bc.id = ' . $this->tableCatPrefix . '.category_id'\n );\n\n // Set the where\n if (is_null($data)) {\n $data = ['where' => []];\n }\n\n if (!isset($data['where'])) {\n $data['where'] = [];\n }\n\n if (is_numeric($categoryIdSlug)) {\n $data['where'][] = ['column' => 'bc.id', 'value' => (int) $categoryIdSlug];\n } else {\n $data['where'][] = ['column' => 'bc.slug', 'value' => $categoryIdSlug];\n }\n\n $oDb->group_by($this->tableAlias . '.id');\n\n return $this->getAll($page, $perPage, $data, $includeDeleted);\n }", "public function show($slug)\n {\n try {\n $category = Category::with(['image'])->where('slug', $slug)->first();\n if ($category) {\n return response()->json(['status' => 'success', 'message' => 'Category retrieved successfully!', 'category' => $category], JsonResponse::HTTP_OK);\n } else {\n return response()->json(['message' => 'No category was found'], JsonResponse::HTTP_CONFLICT);\n }\n } catch (\\Exception $e) {\n return response()->json(['message' => $e->getMessage()], JsonResponse::HTTP_CONFLICT);\n }\n }", "public function actionCategory($slug)\n {\n $model = ArticleCategory::find()->andWhere(['slug' => $slug])->active()->one();\n if (!$model) {\n throw new NotFoundHttpException(Yii::t('frontend', 'Page not found.'));\n }\n\n $query = Article::find()->with('tags')->joinWith('category')->where('{{%article_category}}.slug = :slug', [':slug' => $slug])->published();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => ['defaultPageSize' => 10],\n ]);\n\n $dataProvider->sort = [\n 'defaultOrder' => ['created_at' => SORT_DESC],\n ];\n\n return $this->render('category', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n 'menuItems' => self::getMenuItems(),\n ]);\n }" ]
[ "0.85779524", "0.8359779", "0.74517024", "0.7445335", "0.7254354", "0.7177294", "0.71389866", "0.6980511", "0.6980511", "0.69639444", "0.69639444", "0.69639444", "0.69639444", "0.69639444", "0.679315", "0.6772538", "0.6700671", "0.6591197", "0.6553535", "0.6538956", "0.6510549", "0.64975864", "0.6420039", "0.6261589", "0.62384534", "0.6165189", "0.6092772", "0.6066552", "0.60653085", "0.6061026", "0.6052961", "0.6052961", "0.6045761", "0.6045761", "0.6040876", "0.6036965", "0.6027886", "0.60016006", "0.5981737", "0.59541", "0.5943425", "0.5942252", "0.5917741", "0.59097844", "0.5894226", "0.5868885", "0.5841552", "0.582781", "0.5815317", "0.58026105", "0.5797881", "0.5797581", "0.5797261", "0.5797247", "0.579294", "0.5791953", "0.5788676", "0.57737267", "0.5772394", "0.57426083", "0.57233983", "0.5722403", "0.5719762", "0.57075053", "0.57003474", "0.5692402", "0.56887335", "0.56804883", "0.56731987", "0.5645488", "0.56365204", "0.5623516", "0.5622966", "0.56196415", "0.56120694", "0.56105095", "0.56100214", "0.5609685", "0.56014556", "0.5588069", "0.55865216", "0.55848867", "0.55649", "0.55473596", "0.55389285", "0.5525395", "0.55216295", "0.54984623", "0.54789704", "0.54709613", "0.5470155", "0.5467949", "0.5467949", "0.5465492", "0.5464216", "0.5462903", "0.5457475", "0.54456526", "0.5443126", "0.54322" ]
0.6629845
17
Find category by Post Type.
public static function findByPostType($postTypeSlug) { $postType = PostType::findBySlug($postTypeSlug); if($postType) { return self::where('postTypeID', $postType->postTypeID)->get(); } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function category(PostType $postType, Category $category)\n\t{\n\t\t\n\t\t MetaTag::setTitle($postType->title.\" - \".$category->title);\n MetaTag::setDescription($postType->description);\n MetaTag::setKeywords($postType->title);\n MetaTag::setFacebookTags([\n \t'title' => $postType->title, \n \t'description' => $postType->description, \n \t'image' => \"\", \n \t'url' => route('posts.list', [$postType->slug]) \n ]);\n MetaTag::setTwitterDescription($postType->description);\n\n\n\t\t//change limit in case post type is support\n\t\tif($postType->slug == 'support')\n\t\t\t$this->limit = 100;\n\n\t\t$posts = $this->postRepos->getAllByPostTypeIdAndCategoryId($postType->id, $category->id, $this->limit);\n\t\t\n\t\t//get the view name\n\t\tif( File::exists($this->viewsPath.\"/index-\".$postType->slug.\".blade.php\" ))\n\t\t\t$viewName = \"front.posts.index-\".$postType->slug;\n\t\telse\n\t\t\t$viewName = \"front.posts.index\";\n\n\t\treturn view($viewName, ['posts' => $posts, 'pageTitle' => $category->title, 'pageDescription' => $category->description, 'category' => $category]);\n\t}", "private function getPostCategoryTaxonomy($postType){\n\t\t\n\t\tif(isset(self::$arrPostTypeTaxCache[$postType]))\n\t\t\treturn(self::$arrPostTypeTaxCache[$postType]);\n\t\t\n\t\t$taxonomy = \"category\";\n\t\t\n\t\tif($postType == \"post\" || $postType == \"page\")\n\t\t\treturn($taxonomy);\n\t\t\t\n\t\t$arrTax = UniteFunctionsWPUC::getPostTypeTaxomonies($postType);\n\t\t\t\n\t\tif(!empty($arrTax))\n\t\t\t$taxonomy = UniteFunctionsUC::getFirstNotEmptyKey($arrTax);\n\t\t\n\t\tself::$arrPostTypeTaxCache[$postType] = $taxonomy;\n\t\t\n\t\treturn($taxonomy);\n\t}", "public static function getColumnCategory($type) {\n\t\tforeach (static::getColumns() as $category => $columns) {\n\t\t\tforeach ($columns as $columnType) {\n\t\t\t\tif ($columnType === $type) {\n\t\t\t\t\treturn $category;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function custom_post_type_cat_filter($query) {\n if ( !is_admin() && $query->is_main_query() ) {\n if ($query->is_category()) {\n $query->set( 'post_type', array( 'articles', 'guides', 'conseils' ) );\n }\n }\n}", "function vcex_get_post_type_cat_tax( $post_type = '' ) {\n\tif ( function_exists( 'wpex_get_post_type_cat_tax' ) ) {\n\t\treturn wpex_get_post_type_cat_tax( $post_type );\n\t}\n\n\tif ( ! $post_type ) {\n\t\t$post_type = get_post_type();\n\t}\n\n\tswitch ( $post_type ) {\n\t\tcase 'post':\n\t\t\t$tax = 'category';\n\t\t\tbreak;\n\t\tcase 'portfolio':\n\t\t\t$tax = 'portfolio_category';\n\t\t\tbreak;\n\t\tcase 'staff':\n\t\t\t$tax = 'staff_category';\n\t\t\tbreak;\n\t\tcase 'testimonials':\n\t\t\t$tax = 'testimonials_category';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$tax = '';\n\t}\n\n\t/**\n\t * Filters the post type category taxonomy name.\n\t *\n\t * @param string $tax\n\t */\n\t$tax = (string) apply_filters( 'wpex_get_post_type_cat_tax', $tax, $post_type );\n\n\treturn $tax;\n}", "public function categories($userId, $type)\n {\n return $this->where('user_id', $userId)\n ->orWhere('slug', 'uncategories')\n ->category($type)\n ->get();\n }", "private function GetCategoriesByType($outlet_id,$type){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\t$where = array(\n\t\t\t\t'category_business_admin_id' => $this->session->userdata['logged_in']['business_admin_id'],\n\t\t\t\t'category_type' => $type,\n\t\t\t\t'category_is_active' => TRUE,\n\t\t\t\t'category_business_outlet_id'=> $outlet_id\n\t\t\t);\n\t\n\t\t\t$data = $this->BusinessAdminModel->MultiWhereSelect('mss_categories',$where);\n\t\t\tif($data['success'] == 'true'){\t\n\t\t\t\treturn $data['res_arr'];\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\t\t\n\t}", "protected function categories_dropdown($post_type)\n {\n }", "function get_category($type_code=''){\n\t\t\t$this->db->select('category.*,type.name as type_name');\n\t\t\t$this->db->from('category');\n\t\t\t$this->db->join('type','category.type_code=type.code');\n\t\t\t$this->db->where('category.type_code',$type_code);\n\t\t\treturn $this->db->get()->result();\n\t\t}", "public function CategoryListWithType(Request $request,$type)\n {\n $society_id = OauthToken::find($request->get('access_token'))->society()->first()->id;\n $results = Category::where('type', $type)\n ->where('society_id', $society_id)->get();\n return $this->presentor->make200Response('Successfully loaded.', $results);\n }", "function mpcth_get_filter_categories($categories, $type = 'blog') {\r\n\tif($type != 'blog')\r\n\t\t$all_categories = get_categories(array('taxonomy' => 'mpcth_portfolio_category', 'hide_empty' => 1));\r\n\telse\r\n\t\t$all_categories = get_categories(array('hide_empty' => 1));\r\n\r\n\tif(isset($categories[0])) {\r\n\t\t$categories = unserialize($categories[0]);\r\n\r\n\t\t$filter_categories = '';\r\n\t\t$filter_categories .= '<div class=\"mpcth-'.$type.'-categories mpcth-filterable-categories\"><span>'.__('Categories: ', 'mpcth').'</span><ul>'; \r\n\t\t$filter_categories .= '<li class=\"active\" data-link=\"post\"><a href=\"\">'.__('All', 'mpcth').'</a></li>';\r\n\r\n\t\tforeach($all_categories as $key) {\r\n\t\t\tif((isset($categories[$key->slug]) && $categories[$key->slug] == 'on') || !isset($categories[$key->slug])) {\r\n\t\t\t\t$filter_categories .= '<li data-link=\"'.$key->slug.'\">';\r\n\t\t\t\tif($type == 'blog')\r\n\t\t\t\t\t$filter_categories .= '<a href=\"\" title=\"'.$key->slug.'\">'.$key->name.'</a></li>';\r\n\t\t\t\telse\r\n\t\t\t\t\t$filter_categories .= '<a href=\"\" title=\"'.$key->slug.'\">'.$key->name.'</a></li>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$filter_categories .= '</ul></div>';\r\n\r\n\t\treturn $filter_categories;\r\n\t}\r\n}", "public function getById($categoryID, $type = 'article'){\n\n\t\t//find by alias at first\n\t\t$where = array(\n\t\t\t'alias' => $categoryID,\n\t\t\t'type' \t=> $type,\n\t\t\t);\n\t\t$this -> db -> where($where);\n\t\t$this -> db -> select('*');\n\t\t$category = $this -> db -> get($this -> tableName) -> result_array();\n\n\t\tif( ! $category){\n\t\t\t$where = array(\n\t\t\t\t'id' => \t$categoryID,\n\t\t\t\t'type' => \t$type,\n\t\t\t\t);\n\n\t\t\t$this -> db -> where($where);\n\t\t\t$this -> db -> select('*');\n\t\t\t$category = $this -> db -> get($this -> tableName) -> row_array();\n\t\t} \n\n\t\t//if type quite forum the deal it\n\t\treturn $category;\n\t}", "public function get_category_type()\n {\n return C__CMDB__CATEGORY__TYPE_SPECIFIC;\n }", "function get_the_category_rss($type = \\null)\n {\n }", "function mpcth_get_query_categories($categories, $type = 'blog') {\r\n\tif($type != 'blog')\r\n\t\t$all_categories = get_categories(array('taxonomy' => 'mpcth_portfolio_category', 'hide_empty' => 1));\r\n\telse\r\n\t\t$all_categories = get_categories(array('hide_empty' => 1));\r\n\t\r\n\t// make a list of categories that should be displayed (for WP query)\r\n\t$display_categories = '';\r\n\r\n\tif(isset($categories[0])) {\r\n\t\t$categories = unserialize($categories[0]);\r\n\r\n\t\tforeach($all_categories as $key) {\r\n\t\t\tif((isset($categories[$key->slug]) && $categories[$key->slug] == 'on') || !isset($categories[$key->slug]))\r\n\t\t\t\t$display_categories .= $key->slug.', ';\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $display_categories;\r\n}", "function get_by_type($type) {\r\n\t\t\t$output = array();\r\n\t\t\t$posts_array = get_posts( 'post_type=' . $type ); \r\n\t\t\tforeach( $posts_array as $post ) {\r\n\t\t\t\tsetup_postdata($post); \r\n\t\t\t\t$output[$post->ID] = $post->post_title ;\r\n\t\t\t}\r\n\t\t\treturn $output;\r\n\t\t}", "public function get_category_type()\n {\n return $this->m_cat_dao->get_category_type();\n }", "public function category($type)\n {\n $this->lang->help->menu = $this->help->createModuleMenu();\n\n $this->lang->category = $this->lang->directory;\n $this->lang->tree->menu = $this->lang->help->menu;\n $this->lang->menuGroups->tree = 'help';\n\n $this->view->categoryBox = $this->help->getCategoryBox($type);\n $this->view->title = $this->lang->category->common;\n $this->view->type = $type;\n $this->view->root = $root;\n $this->view->children = $this->loadModel('tree')->getChildren(0, $type);\n\n $this->display();\n }", "public function getCategory();", "public function getCategory();", "public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }", "public function findCategories();", "public function findCategoryBySlug($slug);", "public function getCategory() {}", "function ajax_post_category_get() {\n\t\tglobal $my_cat_id_12;\n\t\t$cat_name = $_POST['cat_name'];\n\t\t$term = get_term_by('name', $cat_name, 'category');\n\t\t$cat_id = $term->term_id;\n\t\t$my_cat_id_12=$cat_id;\n\n\t\t$the_query = new WP_Query( array( 'cat' => $cat_id, 'post_type' => 'any', 'posts_per_page'=>-1, 'order' => 'ASC'));\n\t\t$start = true;\n\t\twhile ( $the_query->have_posts() ) : $the_query->the_post();\n\t\t\tif ($the_query->post->post_type != 'page') {\n\t\t\t\tif (!$start) {\n\t\t\t\t\techo '||';\n\t\t\t\t}\n\t\t\t\t$start = false;\n\t\t\t\t$this->ajax_post_get($the_query->post->ID);\n\t\t\t}\n\t\tendwhile;\n\n\t\tdie();\n\t}", "function get_post_type_object($post_type)\n {\n }", "public static function find()\n\t{\n\t\treturn new ArticleCategoryQuery(get_called_class());\n\t}", "public function getCategoriesList($type)\n {\n $categories = $this->getEntityManager()->getRepository('CmsXutBundle:Category')->findByType($type);\n\n return $categories;\n }", "function aurum_search_page_filter_by_post_type( $query ) {\n\t\n\tif ( $query->is_main_query() && $query->is_search() ) { \n\t\t\n\t\t$query->set( 'posts_per_page', apply_filters( 'laborator_search_results_count', 10 ) );\n\t\t\n\t\tif ( isset( $_GET['type'] ) ) {\n\t\t\t$post_type = sanitize_title_for_query( $_GET['type'] );\n\t\t\t$query->set( 'post_type', $post_type );\n\t\t}\n\t}\n}", "function _find_post_by_old_slug($post_type)\n {\n }", "public static function getPostsByType($type) {\n $args = array(\n \t'posts_per_page' => 100,\n \t'offset' => 0,\n \t'orderby' => 'menu_order',\n \t'order' => 'DESC',\n \t'post_type' => $type,\n \t'post_status' => 'publish',\n \t'suppress_filters' => true\n );\n\n $posts = get_posts( $args );\n self::postSort($posts);\n\n return $posts;\n }", "public function updateCategoriesByType()\n {\n global $config, $rlListingTypes, $rlDb;\n\n if (!$config['cache']) {\n return false;\n }\n\n if ($rlListingTypes->types) {\n foreach ($rlListingTypes->types as $key => $value) {\n $sql = \"SELECT *, CONCAT('categories+name+', `Key`) AS `pName`, CONCAT('categories+title+', `Key`) AS `pTitle` \";\n $sql .= \"FROM `{db_prefix}categories` \";\n $sql .= \"WHERE `Type` = '{$value['Key']}' AND `Status` = 'active' \";\n if ($value['Cat_hide_empty']) {\n $sql .= \"AND `Count` > 0 \";\n }\n $out[$value['Key']] = $rlDb->getAll($sql, 'ID');\n }\n\n $this->set('cache_categories_by_type', $out);\n }\n }", "private function getByCategoryType($type, $user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->andWhere('c.type = :type')\n ->orderBy('p.publishedAt', 'desc')\n ->setParameter('type', $type)\n ->getQuery()\n ;\n\n return $q->getResult();\n }", "public function category() {\n\t\treturn $this->get_category();\n\t}", "public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }", "public static function getAvailableCategories($id, $type) {\n\t\t$params = array(\"id\"=> $id,\n\t\t\t\t\t\t\"type\" => $type);\n\t\t$sort = array(\"category\" => -1);\n\t\t$listCategory = PHDB::distinct(self::COLLECTION, \"category\", $params);\n\t\t\n\t\treturn $listCategory;\n\n\t}", "function get_category_by_slug($slug)\n {\n }", "public static function getCategory()\n {\n return self::$category;\n }", "function jmt_category_and_tag_archives( $wp_query ) {\n\n$my_post_array = array('post','page');\n\nif ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) )\n $wp_query->set( 'post_type', $my_post_array );\n\n if ( $wp_query->get( 'tag' ) )\n $wp_query->set( 'post_type', $my_post_array );\n\n}", "function pixelgrade_get_main_category( $post_ID = null ) {\n\n\t// Use the current post ID is none given\n\tif ( empty( $post_ID ) ) {\n\t\t$post_ID = get_the_ID();\n\t}\n\n\t// Obviously pages don't have categories\n\tif ( 'page' == get_post_type( $post_ID ) ) {\n\t\treturn false;\n\t}\n\n\t$categories = get_the_category();\n\n\tif ( empty( $categories ) ) {\n\t\treturn false;\n\t}\n\n\t// We need to sort the categories like this: first categories with no parent, and secondly ordered DESC by post count\n\t// Thus parent categories take precedence and categories with more posts take precedence\n\tusort( $categories, '_pixelgrade_special_category_order' );\n\n\t// The first category should be the one we are after\n\t// We allow others to filter this (Yoast primary category maybe?)\n\treturn apply_filters( 'pixelgrade_get_main_category', $categories[0], $post_ID );\n}", "function get_the_category($post_id = \\false)\n {\n }", "public static function getPodcatsDetailByCategory($type, $meta_value, $id = null) {\n $query = self::orderBy('id', 'desc')\n ->join('podcast_metas', 'podcast_metas.podcast_id', '=', 'podcasts.id')\n ->join('podcast_meta_data', 'podcast_meta_data.id', '=', 'podcast_metas.meta_id')\n ->select('podcasts.*')\n ->where('podcast_meta_data.slug', $meta_value)\n ->whereNotIn('podcasts.id', [$id])\n ->where('podcast_meta_data.meta_type', $type)->limit(4)->get();\n return $query;\n }", "private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }", "public function getContentCategory()\n {\n if ($this->_oContentCat === null) {\n // setting default status ..\n $this->_oContentCat = false;\n if (($oContent = $this->getContent()) && $oContent->oxcontents__oxtype->value == 2) {\n $this->_oContentCat = $oContent;\n }\n }\n\n return $this->_oContentCat;\n }", "public function type()\n\t{\n\t\treturn $this->belongsTo('Lainga9\\BallDeep\\app\\PostType', 'post_type_id');\n\t}", "function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }", "function getPostCategory($post_id) {\n // Connect To Blog DB\n $db = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n\n $sql = \"SELECT * FROM categories WHERE id=\n\t\t\t(SELECT topic_id FROM post_category WHERE post_id='$post_id') LIMIT 1\";\n\n $result = mysqli_query($db, $sql);\n $category = mysqli_fetch_assoc($result);\n\n // Close Connection\n $db -> close();\n\n return $category;\n}", "public function getCategory()\n {\n\n return $this->category;\n }", "function medigroup_mikado_get_blog_type($type) {\n\n $blog_query = medigroup_mikado_get_blog_query();\n\n $paged = medigroup_mikado_paged();\n $blog_classes = '';\n\n if(medigroup_mikado_options()->getOptionValue('blog_page_range') != \"\") {\n $blog_page_range = esc_attr(medigroup_mikado_options()->getOptionValue('blog_page_range'));\n } else {\n $blog_page_range = $blog_query->max_num_pages;\n }\n $show_load_more = medigroup_mikado_enable_load_more();\n\n if($show_load_more) {\n $blog_classes .= ' mkd-blog-load-more';\n }\n\n $params = array(\n 'blog_query' => $blog_query,\n 'paged' => $paged,\n 'blog_page_range' => $blog_page_range,\n 'blog_type' => $type,\n 'blog_classes' => $blog_classes\n );\n\n medigroup_mikado_get_module_template_part('templates/lists/'.$type, 'blog', '', $params);\n }", "function ex_cpt_search( $query ) {\t\n\t\n\tif ( is_admin() || ! $query->is_main_query() )\n return;\n\n\tif ( $query->is_search ) {\n\t\t\t\n\t\tif (isset($_GET['cpt']) && !empty($_GET['cpt'])) {\n\t\t \t$query->set( 'post_type', array( $_GET['cpt'] ) );\t\t \n\t\t}else{\t\t\t\n\t\t\t$query->set( 'post_type', array( 'post', 'page', 'projets' ) );\n\t\t}\t\t\n\t\t\n\t\tif (isset($_GET['cat']) && !empty($_GET['cat'])) {\n\t\t\t$query->set( 'cat', $_GET['cat'] );\n\t\t}\n\t\n\t\treturn $query;\n\t} \n \n}", "protected function resolveCategoryable(string $type, int $id): CategoryableContract\n {\n $model = Relation::getMorphedModel($type);\n\n return $model::withoutEvents(\n fn () => $model::withoutGlobalScopes()\n ->withOnly([])\n ->findOrFail($id, ['id'])\n );\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "function query_post_type($query) {\n $post_types = get_post_types();\n if ( is_category() || is_tag()) {\n\n $post_type = get_query_var('post_type');\n \n if ( $post_type )\n $post_type = $post_type;\n else\n $post_type = $post_types; \n $query->set('post_type', $post_type);\n\n return $query;\n }\n}", "public function getCategory()\n {\n return $this->readOneof(2);\n }", "public function bycategory($id)\n\t{\n\t $category = Category::where('slug', '=', $id)->first();\n $categlist = Category::findOrFail($category->id)->cposts()->paginate(6);\n return view('catindex', array('type'=>'Category','categlist' => $categlist,'posttype'=>$category) );\n \n \n }", "function get_page_category ($category_id) {\r\n\t$cat = get_category($category_id);\r\n\tif ($cat) { return $cat; }\r\n\treturn get_category(1);\r\n}", "static function get_post_by_cat_id($post){\n\t\treturn self::$db->where('cat_id',$post)->get('blog')->row();\n\t}", "function dlk_check_get_cat( $type_taxonomy ) {\n\n $cat_check = array();\n $category = get_terms(\n array(\n 'taxonomy' => $type_taxonomy,\n 'hide_empty' => false\n )\n );\n\n if ( isset( $category ) && !empty( $category ) ):\n\n foreach( $category as $item ) {\n\n $cat_check[$item->term_id] = $item->name;\n\n }\n\n endif;\n\n return $cat_check;\n\n}", "public static function post_object_type($type, $post) {\n $post_type = get_post_type($post);\n switch ( $post_type ) {\n case \"post\":\n $post_format = get_post_format($post);\n switch ( $post_format ) {\n case \"aside\":\n case \"status\":\n case \"quote\":\n case \"note\":\n $object_type = \"note\";\n break;\n case \"gallery\":\n case \"image\":\n $object_type = \"image\";\n break;\n case \"video\":\n $object_type = \"video\";\n break;\n case \"audio\":\n $object_type = \"audio\";\n break;\n default:\n $object_type = \"article\";\n break;\n }\n break;\n case \"page\":\n $object_type = \"page\";\n break;\n case \"attachment\":\n $mime_type = get_post_mime_type();\n $media_type = preg_replace(\"/(\\/[a-zA-Z]+)/i\", \"\", $mime_type);\n\n switch ($media_type) {\n case 'audio':\n $object_type = \"audio\";\n break;\n case 'video':\n $object_type = \"video\";\n break;\n case 'image':\n $object_type = \"image\";\n break;\n }\n break;\n default:\n $object_type = \"article\";\n break;\n }\n\n return $object_type;\n }", "public function getCategory()\n {\n }", "public function postsByType($type, $options = []){\n $order = isset($options['order']) && $options['order'] ? $options['order'] : null;\n $limit = isset($options['limit']) && $options['limit'] ? $options['limit'] : null;\n $offset = isset($options['offset']) && $options['offset'] ? $options['offset'] : null;\n\n $type = \\FlexCMS\\BasicCMS\\Models\\Item::where('item_type', '=', 'type')->where('name', '=', $type)->first();\n if ($type){\n $post = \\FlexCMS\\BasicCMS\\Models\\Article::with('category')->where('type_id', '=', $type->id);\n if ($order){\n $post = $post->orderByRaw($order);\n }\n if ($limit){\n $post = $post->take($limit);\n }\n if ($offset){\n $post = $post->offset($offset);\n }\n $post = $post->get()->toArray();\n return $post;\n }\n else{\n return [];\n }\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function findCategoryBySlug($slug)\n {\n return $this->db->fetchRow(\"SELECT * FROM `blog_categories` WHERE `type` = 'cat' AND `slug` = :slug\", [ 'slug' => $slug ]);\n }", "function selecttype(Request $request){\n $type=$request->input('type');\n \t$myquery = DB::table('categories')->select('name')->where('type','=',$type)->get();\n \t\treturn $myquery;\n }", "function voyage_mikado_get_blog_type($type) {\n\n $blog_query = voyage_mikado_get_blog_query();\n\n $paged = voyage_mikado_paged();\n $blog_classes = '';\n\n if(voyage_mikado_options()->getOptionValue('blog_page_range') != \"\") {\n $blog_page_range = esc_attr(voyage_mikado_options()->getOptionValue('blog_page_range'));\n } else {\n $blog_page_range = $blog_query->max_num_pages;\n }\n $show_load_more = voyage_mikado_enable_load_more();\n\n if($show_load_more) {\n $blog_classes .= ' mkdf-blog-load-more';\n }\n\n $params = array(\n 'blog_query' => $blog_query,\n 'paged' => $paged,\n 'blog_page_range' => $blog_page_range,\n 'blog_type' => $type,\n 'blog_classes' => $blog_classes\n );\n\n voyage_mikado_get_module_template_part('templates/lists/'.$type, 'blog', '', $params);\n }", "public function getCategorieType() {\n\t\tif (empty($this->_oType)) {\n\t\t\t$this->_oType = FactoryType::getFromTableType($this->getType());\n\t\t}\n\t\treturn $this->_oType->getNom();\n\t}", "public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}", "function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}", "public function getCategory() {\n return $this->category;\n }", "function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}", "public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "private function _get_relatives_of_object_by_type( $post_type ) {\n\t\t// Set up meta key fragments.\n\t\t$meta_key_fragments = array(\n\t\t\t'prefix' => $prefix,\n\t\t\t'type' => $post_type,\n\t\t);\n\n\t\t// Generate meta key.\n\t\t$meta_key = '_' . implode( '_', $meta_key_fragments );\n\n\t\treturn get_metadata( $this->type, $this->id, $meta_key, false );\n\t}", "public function getCategory() {\n return $this->category;\n }", "public function getCategory() {\n\t\treturn $this->category;\n\t}", "function list_categories() {\n $project_parent_category = get_category_by_slug('project');\n $project_parent_category_id=$project_parent_category->term_id;\n $categories=get_the_category();\n $count = 0;\n foreach($categories as $category){\n if($category->category_parent==$project_parent_category_id){\n if ($count == 0) {\n echo '<div class=\"category-symbology\">';\n\n if(get_post_type(get_the_id()) == 'discussion') { echo '<i class=\"social-foundicon-chat\"> </i> '; }\n }\n echo \"<a class='one-category' href='/project/\". $category->slug . \"'>\" . $category->name . \"</a>\";\n if ($count == 0) {\n echo '</div>';\n } \n $count++;\n }\n }\n\n //emit a chat symbol for discussion\n if($count == 0 && get_post_type(get_the_id()) == 'discussion') {\n generate_discussion_w_no_category();\n }\n}", "public function getCat()\n {\n return $this->cat = get_the_category($this->id);\n }", "public function findWithAcl(int $categoryId): ?HostCategory;", "static function get_category_by_slug($slug){\n\t\treturn self::$db->where('slug',$slug)->get('categories')->row();\n\t}", "public function getCategory()\n {\n return $this->_category;\n }", "function getCategory() \n {\n return $this->instance->getCategory();\n }", "public function get_blog_count($title = \"\", $category = \"\", $type = \"\")\n\t{ \t\t\t\t\n\t\t$conditions = 'blog.publish_status ='.$type;\n\t\tif($_GET){\t\t\t\n\t\t\tif($title){\n\t\t\t\t$conditions .= ' and blog_title like \"%'.mysql_real_escape_string($title).'%\"';\n\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\tif($category){\n\t\t\t\t$conditions .= ' and blog.category_id = '.$category;\n\t\t\t}\n\t\t\t$query = \"select * from blog left join category on category.category_id=blog.category_id where $conditions\";\t\t\t\n\t\t\t$result = $this->db->query($query);\t\n\t\t}\n\t\telse{ \t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$result = $this->db->from(\"blog\")\n\t\t\t\t\t\t->join(\"category\",\"category.category_id\",\"blog.category_id\")\t\t\t\t\t\n\t\t\t\t\t\t->where($conditions)\t\t\t\t\t\t\n\t\t\t\t\t\t->orderby(\"blog.blog_id\", \"ASC\")\n\t\t\t\t\t\t->get();\n\t\t} \n\t\treturn count($result);\n\t}", "public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }", "public function findBySlugWithCategory($slug);", "function filter_categories ( $page) {\n global $db;\n return find_by_sql(\"SELECT * FROM categorias where idpagina =\".$db->escape($page).\" ORDER BY name\");\n \n}" ]
[ "0.64634806", "0.6253032", "0.6196113", "0.61755913", "0.5980419", "0.5965445", "0.59566706", "0.58833754", "0.58646864", "0.58084184", "0.5759454", "0.57170665", "0.5703813", "0.562897", "0.5618032", "0.561225", "0.5590744", "0.55857503", "0.5565525", "0.5565525", "0.5554727", "0.5534445", "0.55321854", "0.5523525", "0.5452786", "0.54406637", "0.5432708", "0.5425796", "0.54175425", "0.5412793", "0.5401896", "0.53842974", "0.5371181", "0.5359648", "0.53510445", "0.5347487", "0.5347178", "0.53459024", "0.5342157", "0.533255", "0.5326524", "0.53233624", "0.5318515", "0.52897227", "0.5283691", "0.5271704", "0.52664876", "0.5264251", "0.5261946", "0.52603376", "0.5259728", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5251977", "0.5244658", "0.5238375", "0.52343905", "0.5234003", "0.5226136", "0.5225368", "0.52221125", "0.5218851", "0.5214043", "0.52127147", "0.5211632", "0.52063125", "0.5197524", "0.5195118", "0.519443", "0.51933855", "0.5193229", "0.5191031", "0.51887596", "0.5185158", "0.5185158", "0.5180606", "0.5176065", "0.51672286", "0.5156945", "0.5146085", "0.5143945", "0.51292485", "0.5126735", "0.5126357", "0.51212674", "0.5113732", "0.510195", "0.51016587" ]
0.0
-1
Check if a category has posts.
public static function hasPosts($postType, $categoriesID) { if(DB::table(categoriesRelationTable($postType))->where('categoryID', $categoriesID)->count() ) { return true; }else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function has_posts() {\n\tif(($posts = IoC::resolve('posts')) === false) {\n\t\t$params['sortby'] = 'id';\n\t\t$params['sortmode'] = 'desc';\n\t\t\n\t\t$posts = Posts::list_all($params);\n\t\tIoC::instance('posts', $posts, true);\n\t}\n\t\n\treturn $posts->length() > 0;\n}", "public function hasPosts()\n\t{\n\t\tif ($this->hasData('post_count')) {\n\t\t\treturn $this->getPostCount() > 0;\n\t\t}\n\n\t\treturn $this->getPostCollection()->count() > 0;\n\t}", "public function hasCategory()\n {\n return $this->category !== null;\n }", "public function hasCategories()\n {\n return !$this->categories->isEmpty();\n }", "public function hasCategories()\n {\n return !empty($this->categories);\n }", "function has_category($category = '', $post = \\null)\n {\n }", "public function count_cat_post($cat_id) {\n $sql = 'SELECT COUNT(*) AS cat_posts FROM ' . PREFIX . 'posts WHERE post_parent= ? AND post_status= ? AND post_type= ?';\n $res = $this->shareCon()->get_single_result($sql, array($cat_id, 'publish', 'post'));\n if($res != null)\n return $res['cat_posts'];\n\n return false;\n }", "function ppo_categorized_blog() {\n if (false === ( $all_the_cool_cats = get_transient('ppo_category_count') )) {\n // Create an array of all the categories that are attached to posts\n $all_the_cool_cats = get_categories(array(\n 'hide_empty' => 1,\n ));\n\n // Count the number of categories that are attached to the posts\n $all_the_cool_cats = count($all_the_cool_cats);\n\n set_transient('ppo_category_count', $all_the_cool_cats);\n }\n\n if (1 !== (int) $all_the_cool_cats) {\n // This blog has more than 1 category so ppo_categorized_blog should return true\n return true;\n } else {\n // This blog has only 1 category so ppo_categorized_blog should return false\n return false;\n }\n}", "public function hasPosts() {\n\t\t$sql = \"SELECT \tCOUNT(*) AS count\n\t\t\tFROM \twbb\".WBB_N.\"_post\n\t\t\tWHERE \tthreadID = \".$this->threadID;\n\t\t$result = WCF::getDB()->getFirstRow($sql);\n\t\treturn $result['count'];\n\t}", "public function hasCategory(): bool;", "public function have_posts() {\r\n\t\treturn $this->query->have_posts();\r\n\t}", "public static function existsCategory($category) {\n $n = self::where('name', '=', $category)->where('parent_category_id', '=', 17)->count();\n return $n>0;\n }", "public function exists()\n {\n if (get_post($this->id)) {\n return true;\n }\n\n return false;\n }", "function has_categorys()\n\t{\n\t\t\t$categorias = $this->combofiller->categorias();\t\t\t\n\t\t\tforeach($categorias as $key => $value)\n\t\t\t{\n\t\t\t\tif ($this->input->post('' . $key . ''))\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn FALSE;\t\n\t}", "public function hasChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n if ($result->getRows() > 0) {\n return true;\n }\n\n return false;\n\n }", "public static function postWithIdExists($id)\n\t{\n\t\treturn sizeof(Utils::wpdbQuery(\"SELECT ID FROM _tbl_posts WHERE ID=%d\",$id)) > 0;\n\t}", "function postExists($id){\n return (getSingleValue(\"SELECT COUNT(`id`) FROM `public_forums_posts` WHERE `deleted` = '0' AND `id` = '\" . escape(intval($id)) . \"'\") >= 1);\n }", "public function exists_in_posts_table() {\r\n\t\treturn ! empty( $this->db_id );\r\n\t}", "public function getAllPublishedPostsByCategory($category_id=null)\n\t{\n\t\tif(is_null($category_id)){\n\t\t\t$this->logger->logError('No Category ID provided.','Input Error');\n\t\t\treturn false;\n\t\t}\n\t\t$q = \"SELECT in_posts.* FROM in_posts INNER JOIN in_posts_categories \";\n\t\t$q.= \"ON in_posts.id=in_posts_categories.post_id \"; \n\t\t$q.=\"WHERE (in_posts_categories.category_id=:category_id AND in_posts.publish_flag=1)\";\n\t\t$vars = array(\n\t\t\t\":category_id\"=>(int)$category_id\n\t\t);\n\t\t$ps = $this->execute($q,$vars);\n\t\t$result = $this->getDataRowsAsObjects($ps,'Post');\n\t\treturn $result;\n\t}", "public function exists_in_feeds_posts_table() {\r\n\t\tglobal $wpdb;\r\n\t\t$table_name = $wpdb->prefix . CTF_FEEDS_POSTS_TABLE;\r\n\t\t$db_id = $this->db_id;\r\n\t\t$results = $wpdb->get_results( $wpdb->prepare( \"SELECT feed_id FROM $table_name WHERE id = %s AND feed_id = %s LIMIT 1\", $db_id, $this->feed_id ), ARRAY_A );\r\n\t\treturn isset( $results[0]['feed_id'] );\r\n\t}", "public function hasCategories() {\n return $this->_has(16);\n }", "public function isCategory($category): bool;", "protected function isCategory()\n {\n return is_null($this->request->task);\n }", "public function hasNewPosts()\n {\n if ($this->last_post == null) return false;\n\n $last_access = session('last_access_time');\n if (!$last_access || !($last_access instanceof Carbon)) $last_access = Carbon::now()->addDays(1);\n\n $thread_read = session('thread_persistance_data');\n if ($thread_read && is_array($thread_read) && array_key_exists($this->id, $thread_read)) {\n $read = $thread_read[$this->id];\n if ($read instanceof Carbon && $read > $last_access) $last_access = $read;\n }\n\n return $this->last_post->updated_at > $last_access;\n }", "public function getPosts($id)\n {\n $event = Events::findOrFail($id);\n if(count($event) > 0){\n\n $event_post = $event->posts;\n if(isset($event_post) && $event_post->count() > 0){\n\n return true;\n\n }else{\n\n return false;\n }\n }\n }", "public function isPublished()\n {\n return $this->postID > 0;\n }", "public function isReadyForPurge()\n\t{\n\t\tif($this->getStatus() != CategoryStatus::DELETED)\n\t\t\treturn false;\n\t\t\t\n\t\tif($this->getMembersCount())\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getMembersCount() . \"] users\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\tif($this->getEntriesCount() > 0)\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getEntriesCount() . \"] entries\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\tif($this->getDirectSubCategoriesCount() > 0)\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getDirectSubCategoriesCount() . \"] sub categories\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static function postWithTitleExists($title,$post_type)\n\t{\n\t\treturn count(Utils::wpdbQuery(\"Select ID from _tbl_posts WHERE post_title=%s and post_status='published' and post_type=%s\",$title,$post_type)) > 0;\n\t}", "public function get_category_post_count($category_id)\r\n {\r\n $category = $this->category_model->get_category($category_id);\r\n if (!empty($category)) {\r\n if ($category->parent_id == 0) {\r\n $this->set_filter_query();\r\n $this->db->where('posts.category_id', $category_id);\r\n $query = $this->db->get('posts');\r\n return $query->num_rows();\r\n } else {\r\n $this->set_filter_query();\r\n $this->db->where('posts.subcategory_id', $category_id);\r\n $query = $this->db->get('posts');\r\n return $query->num_rows();\r\n }\r\n }\r\n }", "function client_portal_categorized_blog() {\n\n\t$category_count = get_transient( 'client_portal_categories' );\n\n\tif ( false === $category_count ) {\n\n\t\t$category_count_query = get_categories(\n\t\t\tarray(\n\t\t\t\t'fields' => 'count',\n\t\t\t)\n\t\t);\n\n\t\t$category_count = (int) $category_count_query[0];\n\n\t\tset_transient( 'client_portal_categories', $category_count );\n\t}\n\n\treturn $category_count > 1;\n}", "public function isPost( $post_ID )\n {\n $categories = get_the_category( $post_ID );\n\n if ( $categories ) {\n $category = current( $categories ); // @todo Warning: what if the post has more than 1 categories?\n $category_id = $category->term_id; // get the slug of the post\n xlog(\"category_id: $category_id\");\n $ex = explode('/', get_category_parents($category_id, false, '/', true)); // get the root slug of the post\n xlog(\"category slug of the category id: $ex[0]\");\n if ( $ex[0] == FORUM_CATEGORY_SLUG ) { // is it a post under XForum?\n return true;\n }\n }\n return false;\n }", "public static function hasChildren($category_id)\n\t{\n\t\t//TODO: cache stuff if possible\n\t\t//check input\n\t\t$category_id = intval($category_id);\n\t\tif ($category_id==0){\n\t\t\treturn false;\n\t\t}\n\t\t$db = DataAccess::getInstance();\n\t\t$sql = \"SELECT COUNT(*) FROM \".geoTables::categories_table.\" WHERE `parent_id` = ?\";\n\t\t$count = (int)$db->GetOne($sql, array($category_id));\n\t\treturn ($count > 0);\n\t}", "public function countPostsByCategory($category, $options = []){\n $order = isset($options['order']) && $options['order'] ? $options['order'] : null;\n $lang = isset($options['lang']) && $options['lang'] ? $options['lang'] : 'en';\n \n if (is_numeric($category)){\n $category = \\FlexCMS\\BasicCMS\\Models\\Item::where('item_type', '=', 'category')->where('id', '=', $category)->first();\n }\n else{\n $category = \\FlexCMS\\BasicCMS\\Models\\Item::where('item_type', '=', 'category')->where('name', '=', $category)->first(); \n }\n \n if ($category){\n $post = \\FlexCMS\\BasicCMS\\Models\\Article::with('category')->where('category_id', '=', $category->id)->whereRaw('language = \\'en\\'');\n if ($lang == 'en'){\n }\n else{\n $post = \\FlexCMS\\BasicCMS\\Models\\Article::whereRaw('(category_id = ? AND language = ? AND (parent_id IS NOT NULL AND parent_id > 0))', [$category->id, $lang]);\n }\n if ($order){\n $post = $post->orderByRaw($order);\n }\n $count = $post->get()->count();\n return $count;\n }\n else{\n return [];\n }\n }", "function categoryAssociationExists($monographId, $categoryId) {\n\t\t$result = $this->retrieve(\n\t\t\t'SELECT COUNT(*) FROM submission_categories WHERE submission_id = ? AND category_id = ?',\n\t\t\tarray((int) $monographId, (int) $categoryId)\n\t\t);\n\t\t$returner = isset($result->fields[0]) && $result->fields[0] == 1 ? true : false;\n\n\t\t$result->Close();\n\t\treturn $returner;\n\t}", "function gravit_categorized_blog() {\r\r\n\tif ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) {\r\r\n\t\t// Create an array of all the categories that are attached to posts.\r\r\n\t\t$all_the_cool_cats = get_categories( array(\r\r\n\t\t\t'hide_empty' => 1,\r\r\n\t\t) );\r\r\n\r\r\n\t\t// Count the number of categories that are attached to the posts.\r\r\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\r\r\n\r\r\n\t\tset_transient( 'all_the_cool_cats', $all_the_cool_cats );\r\r\n\t}\r\r\n\r\r\n\tif ( '1' != $all_the_cool_cats ) {\r\r\n\t\t// This blog has more than 1 category so gravit_categorized_blog should return true.\r\r\n\t\treturn true;\r\r\n\t} else {\r\r\n\t\t// This blog has only 1 category so gravit_categorized_blog should return false.\r\r\n\t\treturn false;\r\r\n\t}\r\r\n}", "function delivery_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'delivery_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'hide_empty' => 1,\n\n\t\t\t// We only need to know if there is more than one category.\n\t\t\t'number' => 2,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'delivery_categories', $all_the_cool_cats );\n\t}\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so delivery_categorized_blog should return true.\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so delivery_categorized_blog should return false.\n\t\treturn false;\n\t}\n}", "public function hasCategory($catId)\n {\n if(empty($catId)) throw new \\Exception('Invalid category id');\n if(empty($this->id)) return false;\n\n $cmd = self::getDb()->createCommand(\"SELECT 1 FROM tbl_cms_post_category WHERE post_id = :pid AND category_id = :cid\");\n $cmd->bindParam(\":pid\", $this->id, \\PDO::PARAM_INT);\n $cmd->bindParam(\":cid\", $catId, \\PDO::PARAM_INT);\n return (bool) $cmd->queryScalar();\n }", "public function isValidCat($cat){\r\n \treturn isset($this->categories[$cat]); \r\n\t}", "public function isNewCategory(): bool {\n return !$this->category->exists;\n }", "function have_category() {\n global $categories_index, $discussion, $categories, $categories_count;\n\n $categories_count = count(get_categories());\n $categories = get_categories();\n\n if ($categories && $categories_index + 1 <= $categories_count) {\n $categories_index++;\n return true;\n } else {\n $categories_count = 0;\n return false;\n }\n}", "private function recipeHasCategory($recipe) {\n // Meanwhile, we assume any recipe has any category.\n return true;\n }", "public function hasPriceCategory()\n {\n return $this->price_category !== null;\n }", "public function existCategorie($categories){\n\t\t\n\t\tglobal $wpdb;\n\n\t\t$ok = 0;\n\t\t\n\t\tif(!empty($categories))\n\t\t{\n\t\t\tforeach($categories as $cat)\n\t\t\t{ \n\t\t\t\t$category = $this->utils->cleanString($cat);\n\t\t\t\t\n\t\t\t\t$result = $this->findCategory($category);\n\t\t\t\t\n\t\t\t\tif( !$result )\n\t\t\t\t{\n\t\t\t\t\t$this->insertCategory($category);\n\t\t\t\t}\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t \n\t\treturn true;\n\t}", "private function hasCategoryLinks() {\n\t\tif ( !$this->getSkinOption( self::OPTION_CATEGORIES ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$categoryLinks = $this->getOutput()->getCategoryLinks();\n\n\t\tif ( !count( $categoryLinks ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !empty( $categoryLinks['normal'] ) || !empty( $categoryLinks['hidden'] );\n\t}", "public function is_category($category = '')\n {\n }", "static function cws_has_children() {\n\t\tglobal $post;\n\n\t\t$children = get_pages( array( 'child_of' => $post->ID ) );\n\n\t\tif ( count( $children ) == 0 ) {\n\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t}", "function areThereStickyPosts()\r\n{\r\n\t$sticky = get_option('sticky_posts');\r\n\t// check if there are any\r\n\treturn !empty($sticky) ? true : false;\r\n}", "public function hasPost(string $name): bool {}", "function block_core_calendar_has_published_posts() {\n\t// Multisite already has an option that stores the count of the published posts.\n\t// Let's use that for multisites.\n\tif ( is_multisite() ) {\n\t\treturn 0 < (int) get_option( 'post_count' );\n\t}\n\n\t// On single sites we try our own cached option first.\n\t$has_published_posts = get_option( 'wp_calendar_block_has_published_posts', null );\n\tif ( null !== $has_published_posts ) {\n\t\treturn (bool) $has_published_posts;\n\t}\n\n\t// No cache hit, let's update the cache and return the cached value.\n\treturn block_core_calendar_update_has_published_posts();\n}", "function circle_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'circle_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'hide_empty' => 1,\n\t\t\t// We only need to know if there is more than one category.\n\t\t\t'number' => 2,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'circle_categories', $all_the_cool_cats );\n\t}\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so circle_categorized_blog should return true.\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so circle_categorized_blog should return false.\n\t\treturn false;\n\t}\n}", "function twe_news_has_category_subcategories($category_id) {\n global $db;\n $child_category_query = \"select count(*) as count from \" . TABLE_NEWS_CATEGORIES . \" where parent_id = '\" . $category_id . \"'\";\n $child_category = $db->Execute($child_category_query);\n\n if ($child_category->fields['count'] > 0) {\n return true;\n } else {\n return false;\n }\n }", "function bt_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'hide_empty' => 1,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'all_the_cool_cats', $all_the_cool_cats );\n\t}\n\n\tif ( '1' != $all_the_cool_cats ) {\n\t\t// This blog has more than 1 category so _s_categorized_blog should return true\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so _s_categorized_blog should return false\n\t\treturn false;\n\t}\n}", "public function has_remaining_posts() {\n\t\treturn $this->has_remaining_posts;\n\t}", "public function hasCategory($categoryId) {\n\t\t$quizCategories = $this->quizCategoriesTable->find('quizId', $this->id);\n\n\t\tforeach ($quizCategories as $quizCategory) {\n\t\t\tif ($quizCategory->categoryId == $categoryId) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}", "public static function existsCategory($id)\n {\n return (bool) BackendModel::getContainer()->get('database')->getVar(\n 'SELECT COUNT(i.id)\n FROM slideshow_categories AS i\n WHERE i.id = ? AND i.language = ?',\n array((int) $id, BL::getWorkingLanguage())\n );\n }", "public function has_children( $category_id = NULL ) {\n // Get the categories\n $categories_by_parent = Category::$categories_by_parent;\n\n if ( is_null( $categories_by_parent ) ) {\n $this->sort_by_parent();\n\n $categories_by_parent = Category::$categories_by_parent;\n }\n\n if ( is_null( $category_id ) )\n $category_id = $this->id;\n\n return isset( $categories_by_parent[$category_id] );\n }", "public function hasTopics() {\n\t\treturn $this->topics()->count() > 0;\n\t}", "private function hasPosts($request)\n {\n if (!empty($_POST)) {\n if ($p = $this->hasParams($request)) {\n foreach ($_POST as $key => $post) {\n $this->params[$key] = $post;\n }\n } else {\n $this->params = $_POST;\n }\n return true;\n }\n return false;\n }", "public function category_exists() {\n\t\t$users_name = trim($this->input->post ( 'category_name' ));\n\n\t\t$where = array ('category_name' => trim ( $users_name ));\n\t\t\n\t\t$result = $this->Mydb->get_record ( 'category_id', $this->table, $where );\n\t\tif (! empty ( $result )) {\n\t\t\t$this->form_validation->set_message ( 'cate_exists', get_label('username_exists') );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function isCategoryPage();", "function in_child_category($thecategory ){\n\t$params = array('type' => 'post',\n 'child_of' => $thecategory,\n 'hierarchical' => 0, );\n\t$cats = get_categories($params);\n\n\tforeach ($cats as $cat) {\n\t\tif ( in_category($cat->cat_ID) ){\n\t\t\treturn true;\n\t\t}\n \t} // end for children\n\treturn false;\n}", "private function _hasSubCategories($category){\n $cat = Mage::getModel('catalog/category')->load($category->getId());\n $subcats = $cat->getChildren();\n if (empty($subcats)){\n return false;\n } else {\n return true;\n }\n }", "function smart_foundation_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'smart_foundation_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'hide_empty' => 1,\n\n\t\t\t// We only need to know if there is more than one category.\n\t\t\t'number' => 2,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'smart_foundation_categories', $all_the_cool_cats );\n\t}\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so smart_foundation_categorized_blog should return true.\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so smart_foundation_categorized_blog should return false.\n\t\treturn false;\n\t}\n}", "function tep_has_category_subcategories($category_id) {\n $child_category_query = tep_db_query(\"select count(*) as count from \" . TABLE_CATEGORIES . \" where parent_id = '\" . (int)$category_id . \"'\");\n $child_category = tep_db_fetch_array($child_category_query);\n\n if ($child_category['count'] > 0) {\n return true;\n } else {\n return false;\n }\n }", "private function categoryHasLessThanFiveQuestions($category): bool {\n\t\treturn !$category || ($category && $category->questions->count() < 5);\n\t}", "public function hasPost()\n {\n if (func_num_args() == 0) {\n return !empty($this->post);\n }\n\n foreach (func_get_args() as $key) {\n if (!$this->hasParam($this->post, $key)) {\n return false;\n }\n }\n\n return true;\n }", "function root_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'root_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'hide_empty' => 1,\n\t\t\t// We only need to know if there is more than one category.\n\t\t\t'number' => 2,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'root_categories', $all_the_cool_cats );\n\t}\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so root_categorized_blog should return true.\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so root_categorized_blog should return false.\n\t\treturn false;\n\t}\n}", "public function hasPost($name)\n {\n return isset($this->post[$name]) ? $this->post[$name] : false;\n }", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "public static function existsCategory($id)\n\t{\n\t\treturn (bool) BackendModel::getDB()->getVar(\n\t\t\t'SELECT COUNT(i.id)\n\t\t\t FROM faq_categories AS i\n\t\t\t WHERE i.id = ? AND i.language = ?',\n\t\t\tarray((int) $id, BL::getWorkingLanguage())\n\t\t);\n\t}", "function in_comic_category() {\n\tglobal $post, $category_tree;\n\t\n\t$comic_categories = array();\n\tforeach ($category_tree as $node) {\n\t\t$comic_categories[] = end(explode(\"/\", $node));\n\t}\n\treturn (count(array_intersect($comic_categories, wp_get_post_categories($post->ID))) > 0);\n}", "function has_children(){\n\t\tglobal $post;\n\t\t$pages = get_pages('child_of='.$post->ID);\n\t\treturn count($pages);\n\t}", "public function getPostsByCategory($category_id=null)\n\t{\n\t\tif(is_null($category_id)){\n\t\t\t$this->logger->logError('No Category ID provided.','Input Error');\n\t\t\treturn false;\n\t\t}\n\t\t$q = \"SELECT in_posts.* FROM in_posts INNER JOIN in_posts_categories \";\n\t\t$q.= \"ON in_posts.id=in_posts_categories.post_id \"; \n\t\t$q.=\"WHERE in_posts_categories.category_id=:category_id\";\n\t\t$vars = array(\n\t\t\t\":category_id\"=>(int)$category_id\n\t\t);\n\t\t$ps = $this->execute($q,$vars);\n\t\t$result = $this->getDataRowsAsObjects($ps,'Post');\n\t\treturn $result;\n\t}", "public function getAnsweredAttribute()\n {\n return $this->postsCount() > 0;\n }", "public function canCreate($member = null) {\n\t\treturn DataList::create(\"DOArticlesCategoryHolderPage\")->count() < 1;\n\t}", "function categoryExists($cat) { // Return true if the given category exists\n\t$cat = dbEscape($cat);\n\treturn(dbResultExists(\"SELECT * FROM categories WHERE name='$cat'\"));\n}", "function is_child_category($thecategory ){\n\t$params = array('type' => 'post',\n 'child_of' => $thecategory,\n 'hierarchical' => 0, );\n\t$cats = get_categories($params);\n\n\tforeach ($cats as $cat) {\n\t\tif ( is_category($cat->cat_ID) ){\n\t\t\treturn true;\n\t\t}\n \t} // end for children\n\treturn false;\n}", "public static function hasPosts($postTypeSlug)\n {\n $getPostType = self::findBySlug($postTypeSlug);\n if($getPostType) {\n if(DB::table($getPostType['slug'])->count() > 0) {\n return true;\n }\n }\n return false;\n }", "private function validatePostCategory($_post_category){\n $this->post_category = htmlspecialchars($_post_category);\n if($this->post_category === '' or strlen($this->post_category) > 50){\n return false; //Was not a string, or an error occured\n }\n return true;\n }", "private function check_category_taxonomy($category_name){\n\t\t$query = $this->db->prepare(\"SELECT count(`taxonomy_id`) FROM `nw_taxonomy` WHERE `taxonomy_value` = ?\");\n\t\t$query->bindValue(1, $category_name);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$rows = $query->fetchColumn();\n\n\t\t\tif($rows == 0){\n\t\t\t\treturn true;\n\t\t\t}else if($rows >= 1){\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}", "function have_posts()\n {\n }", "function ridizain_has_featured_posts() {\r\n\treturn ! is_paged() && (bool) ridizain_get_featured_posts();\r\n}", "function category_has_children() {\n global $wpdb;\n $term = get_queried_object();\n $category_children_check = $wpdb->get_results(\" SELECT * FROM wp_term_taxonomy WHERE parent = '$term->term_id' \");\n if ($category_children_check) {\n return true;\n } else {\n return false;\n }\n}", "public function categoriesSetup()\n {\n \treturn (bool) $this->categoryDao->countAll();\n }", "public function check() {\n $now = time();\n\n $count = $this->db->count_records_select('forum_posts', '\n mailed = 0 AND\n ((mailnow = 1 AND created < ?) OR (mailnow = 0 AND created < ?))\n ', [\n $now - $this->timepadding,\n $now - $this->timepadding - $this->editdelay,\n ]);\n\n return $count > 0;\n }", "public function cat_match($category){\n\n\t\t\t$sql = mysql_query(\"SELECT * FROM `categories` WHERE `cat` = '$category'\");\n\n\t\t\t$count_query = mysql_num_rows($sql);\n\n\t\t\t\tif ($count_query == 0) {\n\t\t\t\t\t# code...\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t} else {\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t}", "protected function has_post( $key = '' ) {\n\t\treturn $this->has( $key, 'POST' );\n\t}", "public function isInAuthorPost()\n {\n return $this->object->isInAuthorPost();\n }", "function block_core_calendar_has_published_posts()\n {\n }", "function exists() {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"SELECT post_id FROM $this->cacheTable WHERE post_id = \" . $this->db->escape( $this->postID ) . \"\";\n\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( $results[0] )\n\t\t\treturn true;\n\t\t\t\n\t\treturn false;\n\t\t\n\t}", "function isCategoryExist($categoryName)\n {\n $allCategories = $this->data->getAllCategories();\n while ($category = $allCategories->fetch_assoc())\n {\n if ($category['CategoryName'] == $categoryName)\n {\n return true;\n }\n }\n return false;\n }", "public function hasChildren() {\n\t\treturn $this->children()->count() > 0;\n\t}", "protected function _checkCategoryVisibility($category)\n {\n return $category && $category->getIsActive() > 0 && $category->getLevel() > 1;\n }", "function has_children(){\n\tglobal $post;\n\t$pages = get_pages('child_of=' . $post->ID);\n\treturn count($pages);\n}", "public function checkPost( $posts ) {\n\t\tif ( !$this->is_loaded ) {\n\t\t\t$found = FALSE;\n\t\t\tif ( !empty( $posts ) ) {\n\t\t\t\tforeach ( $posts as $gog_get['post'] ) {\n\t\t\t\t\t// Check post content for shortcode.\n\t\t\t\t\tif ( stripos( $gog_get['post']->post_content, '[good-old-gallery') !== FALSE ) {\n\t\t\t\t\t\t$found = TRUE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Not found in post content, let's check custom fields.\n\t\t\t\t\telse {\n\t\t\t\t\t\t$custom = get_post_custom( $gog_get['post']->ID );\n\t\t\t\t\t\tforeach ( $custom as $field ) {\n\t\t\t\t\t\t\tif ( stripos( $field[0], '[good-old-gallery' ) !== FALSE ) {\n\t\t\t\t\t\t\t\t$found = TRUE;\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}\n\t\t\t\t}\n\n\t\t\t\tif ( $found ) {\n\t\t\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'loadStylesAndScripts' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $posts;\n\t}", "public function hasContent(): bool\n {\n return (empty($this->content) === false);\n }", "function postcountdown_count( $cat ) {\n\t$query = new WP_Query( \"cat=$cat\" );\n\treturn $query->found_posts;\n}", "public function hasChildren()\n {\n return $this->myChildren()->exists();\n }", "public static function hasPost($var)\n {\n return (bool) self::post($var);\n }", "function is_posts_page() {\r\n global $wp_query;\r\n return $wp_query->is_posts_page ? true : false;\r\n }" ]
[ "0.7438177", "0.7354948", "0.7157183", "0.7088383", "0.6971919", "0.69513637", "0.65975", "0.65319705", "0.6494458", "0.6474757", "0.6469547", "0.6413939", "0.6391314", "0.63445693", "0.6333965", "0.631355", "0.62695825", "0.6237783", "0.6194921", "0.6171557", "0.61671627", "0.6088543", "0.6053417", "0.6030659", "0.6030246", "0.60211957", "0.6020522", "0.6015426", "0.6015263", "0.60027164", "0.59906363", "0.59711003", "0.59440166", "0.5938676", "0.5934397", "0.59175676", "0.59075826", "0.5890284", "0.58816", "0.5875365", "0.5860071", "0.5849535", "0.5844793", "0.5833283", "0.5830356", "0.5824241", "0.58130157", "0.5807936", "0.57959324", "0.57886916", "0.57872367", "0.5768396", "0.5762307", "0.57382447", "0.57281655", "0.5726362", "0.57246864", "0.5721275", "0.571752", "0.57154906", "0.57106066", "0.5709495", "0.56796217", "0.56734973", "0.56682086", "0.56577724", "0.56561655", "0.56374544", "0.5634897", "0.56342316", "0.56300753", "0.5616914", "0.56075555", "0.5602494", "0.559896", "0.5586887", "0.55867666", "0.5582741", "0.55535126", "0.55513614", "0.5532455", "0.55264336", "0.5522233", "0.5520405", "0.5520167", "0.5493372", "0.5490232", "0.5485358", "0.54663354", "0.54518306", "0.54482275", "0.54427135", "0.54388815", "0.5437818", "0.5437009", "0.5434997", "0.54322004", "0.5424218", "0.5409939", "0.5381395" ]
0.6919697
6
Checks if a category is part of a menulink.
public static function isInMenuLinks($categoriesID) { $isInMenulinks = MenuLink::where('belongsToID', $categoriesID)->where('belongsTo', 'category')->count(); if ($isInMenulinks) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_category($category = '')\n {\n }", "function is_linked_category($category) {\r\n switch($category) {\r\n case 99999:\r\n case 99998:\r\n return true;\r\n }\r\n return false;\r\n }", "private function hasCategoryLinks() {\n\t\tif ( !$this->getSkinOption( self::OPTION_CATEGORIES ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$categoryLinks = $this->getOutput()->getCategoryLinks();\n\n\t\tif ( !count( $categoryLinks ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !empty( $categoryLinks['normal'] ) || !empty( $categoryLinks['hidden'] );\n\t}", "public function isCategory($category): bool;", "public function isCategoryPage();", "public function hasCategory(): bool;", "public function hasCategory()\n {\n return $this->category !== null;\n }", "protected function _isCategoryAllowed($category)\n {\n $categoryPath = $category->getPath();\n foreach ($this->_role->getAllowedRootCategories() as $rootPath) {\n if ($categoryPath === $rootPath || 0 === strpos($categoryPath, \"{$rootPath}/\")) {\n return true;\n }\n }\n return false;\n }", "public function isValidCat($cat){\r\n \treturn isset($this->categories[$cat]); \r\n\t}", "function is_movie_category( $term = '' ) {\n return is_tax( 'movie_cat', $term );\n }", "public function validCategory($data) {\n $categories = $this->categories();\n return array_key_exists(current($data), $categories);\n }", "protected function checkUsage(){\n $modId = $this->getModId();\n $oDeclarator = AMI_ModDeclarator::getInstance();\n $parentModId = $oDeclarator->getParent($modId);\n return\n AMI::issetAndTrueOption($parentModId, 'use_categories');\n }", "protected function _isValidCategory($category)\n {\n $rootId = (int) Mage::app()->getStore()->getRootCategoryId();\n if ($this->getUseUrlRewrites() && $category->getParentId() === $rootId) {\n return false;\n }\n\n return parent::_isValidCategory($category);\n }", "public function isMenu($label) {\r\n\t\tglobal $WT_TREE;\r\n\t\t$module = Module::getModuleByName($label);\r\n\t\tif (in_array($module, Module::getActiveMenus($WT_TREE))) {\r\n\t\t\tif ($module->getMenu()) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function hasCategories() {\n return $this->_has(16);\n }", "public static function checkCategory($aCont) {\n if(strpos($aCont['layout'], 'nutri') > -1) return TRUE;\n \n $lSql = 'SELECT c.`content_id` FROM `al_cms_ref_category` rc INNER JOIN `al_cms_content` c ON c.content_id=rc.content_id ';\n $lSql.= 'WHERE c.`content`='.esc($aCont['content']).' AND rc.`category`='.esc($aCont['category']).' AND `mand`='.intval(MID);\n $lRes = CCor_Qry::getInt($lSql);\n \n return ($lRes > 0) ? TRUE : FALSE;\n }", "function in_comic_category() {\n\tglobal $post, $category_tree;\n\t\n\t$comic_categories = array();\n\tforeach ($category_tree as $node) {\n\t\t$comic_categories[] = end(explode(\"/\", $node));\n\t}\n\treturn (count(array_intersect($comic_categories, wp_get_post_categories($post->ID))) > 0);\n}", "private function _hasSubCategories($category){\n $cat = Mage::getModel('catalog/category')->load($category->getId());\n $subcats = $cat->getChildren();\n if (empty($subcats)){\n return false;\n } else {\n return true;\n }\n }", "private function category() {\n if ($this->is_logged_in()){\n return true; //check if user had been logged in!!!\n }else{\n exit;\n }\n }", "public function hasCategories()\n {\n return !$this->categories->isEmpty();\n }", "public function okCategory($cat, $error = 1, $user_isadmin = false, $user_cat = false) {\n if ($user_isadmin === false) {\n $user_isadmin = $_SESSION['isadmin'];\n }\n\n if ($user_cat === false) {\n $user_cat = $_SESSION['categories'];\n }\n\n /* Is admin? */\n if ($user_isadmin) {\n return true;\n }\n /* Staff with access? */ elseif (in_array($cat, $user_cat)) {\n return true;\n }\n /* No access */ else {\n if ($error) {\n $this->helpbase->common->_error(_('You are not authorized to view tickets inside this category!'));\n } else {\n return false;\n }\n }\n }", "public function isAssignedToCategory()\n {\n $_currentProduct = $this->getProduct();\n $_categoryIds = $_currentProduct->getCategoryIds();\n if($_categoryIds) {\n return true;\n } else {\n return false;\n }\n }", "function in_child_category($thecategory ){\n\t$params = array('type' => 'post',\n 'child_of' => $thecategory,\n 'hierarchical' => 0, );\n\t$cats = get_categories($params);\n\n\tforeach ($cats as $cat) {\n\t\tif ( in_category($cat->cat_ID) ){\n\t\t\treturn true;\n\t\t}\n \t} // end for children\n\treturn false;\n}", "function is_nav_menu($menu)\n {\n }", "function is_video_category( $term = '' ) {\n return is_tax( 'video_cat', $term );\n }", "protected function _checkCategoryVisibility($category)\n {\n return $category && $category->getIsActive() > 0 && $category->getLevel() > 1;\n }", "function has_category($category = '', $post = \\null)\n {\n }", "function is_product_category( $term = '' ) {\n\t\treturn is_tax( 'product_cat', $term );\n\t}", "public function hasCategories()\n {\n return !empty($this->categories);\n }", "function nm_cmb_is_category_tyskysour( $cmb ) {\n $term = get_term($cmb->object_id);\n\n if (isset($term->slug) && ($term->slug === 'tyskysour-video')) {\n return true;\n }\n\n return false;\n}", "function wp_link_category_checklist($link_id = 0)\n {\n }", "function empty_category($a) {\n\t\treturn !empty($a['CategoriesProduct']);\n\t}", "function feed_category_term_access($feed_category_term) {\r\n global $user;\r\n \r\n if (isset($feed_category_term->uid) && $feed_category_term->uid == $user->uid) {\r\n return TRUE;\r\n }\r\n if (isset($feed_category_term->fcid) && $feed_category = feed_category_load($feed_category_term->fcid)) {\r\n return $feed_category->uid == $user->uid;\r\n }\r\n return FALSE;\r\n}", "function is_child_category($thecategory ){\n\t$params = array('type' => 'post',\n 'child_of' => $thecategory,\n 'hierarchical' => 0, );\n\t$cats = get_categories($params);\n\n\tforeach ($cats as $cat) {\n\t\tif ( is_category($cat->cat_ID) ){\n\t\t\treturn true;\n\t\t}\n \t} // end for children\n\treturn false;\n}", "function bwsocial_maybe_has_menu( $args ) {\n\t\n\t// Check theme location\n\t$location = isset( $args[ 'theme_location' ] ) ? $args[ 'theme_location' ] : false;\n\tif ( $location && 'bw-social' === $location ) {\n\t\treturn true;\n\t}\n\t\n\t// Check Menu\n\t$menu = isset( $args[ 'menu' ] ) ? $args[ 'menu' ] : false;\n\tif ( ! $menu ) {\n\t\treturn false;\n\t}\n\t\n\t// Get menu object\n\t$menu_object = wp_get_nav_menu_object( $menu );\n\tif ( $menu_object && is_a( $menu_object, 'WP_Term' ) ) {\n\t\t$menu_locations = get_nav_menu_locations();\n\t\tforeach( $menu_locations as $menu_location => $menu_term_id ) {\n\t\t\tif ( 'bw-social' === $menu_location && $menu_term_id === $menu_object->term_id ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn false;\n}", "protected function hasParentMenuItem() {}", "function L_catHasParent($catid) {\n\t\t\n\t\t$category = get_category($catid);\n\t\tif ($category->category_parent > 0) {\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn false;\n\t\n\t}", "private function isFirstLevel($category)\n {\n return $category->getData('level') == 2 ? true : false;\n }", "function has_nav_menu($location)\n {\n }", "function _gwt_drupal_has_sub_menu($below_menu = array()){\n if(empty($below_menu)){\n return false;\n }\n\n foreach($below_menu as $key => $link_full){\n if($link_full['link']['hidden']){\n unset($below_menu[$key]);\n }\n }\n\n $has_item = !empty($below_menu);\n return $has_item;\n}", "function has_categorys()\n\t{\n\t\t\t$categorias = $this->combofiller->categorias();\t\t\t\n\t\t\tforeach($categorias as $key => $value)\n\t\t\t{\n\t\t\t\tif ($this->input->post('' . $key . ''))\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn FALSE;\t\n\t}", "function tep_has_category_subcategories($category_id) {\n $child_category_query = tep_db_query(\"select count(*) as count from \" . TABLE_CATEGORIES . \" where parent_id = '\" . (int)$category_id . \"'\");\n $child_category = tep_db_fetch_array($child_category_query);\n\n if ($child_category['count'] > 0) {\n return true;\n } else {\n return false;\n }\n }", "protected function isCategory()\n {\n return is_null($this->request->task);\n }", "public function hasChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n if ($result->getRows() > 0) {\n return true;\n }\n\n return false;\n\n }", "public function cat_match($category){\n\n\t\t\t$sql = mysql_query(\"SELECT * FROM `categories` WHERE `cat` = '$category'\");\n\n\t\t\t$count_query = mysql_num_rows($sql);\n\n\t\t\t\tif ($count_query == 0) {\n\t\t\t\t\t# code...\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t} else {\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t}", "function category_exists($cat_name, $category_parent = \\null)\n {\n }", "public function getIsMenuLinkEnabled(): bool;", "function AddCategory(&$category)\n\t{\n\t\tif ($category instanceof Category)\n\t\t{\n\t\t\tif (in_array($this, $category->supplierList, true))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($this->_categoryList as $category2)\n\t\t\t\t{\n\t\t\t\t\tif ($category->categoryId > 0 && $category->categoryId == $category2->categoryId)\n\t\t\t\t\t{\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found)\n\t\t\t\t{\n\t\t\t\t\t$this->_categoryList[] = $category;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function twe_news_has_category_subcategories($category_id) {\n global $db;\n $child_category_query = \"select count(*) as count from \" . TABLE_NEWS_CATEGORIES . \" where parent_id = '\" . $category_id . \"'\";\n $child_category = $db->Execute($child_category_query);\n\n if ($child_category->fields['count'] > 0) {\n return true;\n } else {\n return false;\n }\n }", "function accessMenu( $uid, $access, $section ) {\r\n\tglobal $database;\r\n\r\n\t$row = new mosCategory( $database );\r\n\t$row->load( $uid );\r\n\t$row->access = $access;\r\n\r\n\tif ( !$row->check() ) {\r\n\t\treturn $row->getError();\r\n\t}\r\n\tif ( !$row->store() ) {\r\n\t\treturn $row->getError();\r\n\t}\r\n}", "public function isValidCategory() {\n\t\t$input = file_get_contents('php://input');\n\t\t$_POST = json_decode($input, TRUE);\n\n\t\t// if no splits then category is required otherwise MUST be NULL (will be ignored in Save)\n\t\tif (empty($_POST['splits']) && empty($_POST['category_id'])) {\n\t\t\t$this->form_validation->set_message('isValidCategory', 'The Category Field is Required');\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "private function isShopsBaseCategoryPage($categoryId)\n {\n $defaultShopCategoryId = Shopware()->Shop()->getCategory()->getId();\n\n $queryParamsWhiteList = ['controller', 'action', 'sCategory', 'sViewport', 'rewriteUrl', 'module'];\n $queryParamsNames = array_keys($this->Request()->getParams());\n $paramsDiff = array_diff($queryParamsNames, $queryParamsWhiteList);\n\n return $defaultShopCategoryId === (int) $categoryId && !$paramsDiff;\n }", "protected function has_active_siblings($category)\n {\n \n \n $sibling = Db_DbHelper::queryArray('select * from gd_google_taxonomy where visible=1 and parent_id=:parent_id and id<>:id', array('parent_id'=>$category->parent_id, 'id'=>$category->id));\n \n return count($sibling) > 0;\n \n \n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('catalog/categories');\n }", "function chkResourceAccess($cats,$mbrCat) {\n\tglobal $isAdmin;\n\t\n\t$aCat = explode(\",\",$cats);\n\t$aMbrCat = explode(\",\",$mbrCat);\n\tif($isAdmin) return true;\n\tif($cats == \"*\") return true;\n\t$catMatch = array_intersect($aMbrCat,$aCat);\n\tif(count($catMatch)>0) return true;\n\treturn false;\n}", "function _haveValidParent(&$cat) {\n\t\t$parentCat = $this->get($cat->getVar('cat_pid'));\n\t\treturn !$this->_isAlbum($parentCat);\n\t}", "function is_new_category_allowed($parent_category){\n\t$max_depth = Modules::Run('site_settings/get_max_category_depth');\n\t// get current category depth\n\t$current_depth = $this->get_category_depth($parent_category);\n\t// figure out if a new category is allowed\n\tif ($current_depth < $max_depth){\n\t\treturn TRUE;\n\t} else {\n\t\treturn FALSE;\n\t}\n\n}", "function _validCategory($check)\n\t\t{\n\t\t\t// check legacy too in case we're adding a legacy workshop\n\t\t\t$this->Category->useLegacy(true);\n\t\t\t\n\t\t\t$result = $this->Category->find('count', \n\t\t\t\tarray('recursive' => -1, 'conditions' => array('Category.id' => $check['category_id'])));\n\t\t\t\n\t\t\tif ($result)\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}", "function have_category() {\n global $categories_index, $discussion, $categories, $categories_count;\n\n $categories_count = count(get_categories());\n $categories = get_categories();\n\n if ($categories && $categories_index + 1 <= $categories_count) {\n $categories_index++;\n return true;\n } else {\n $categories_count = 0;\n return false;\n }\n}", "public function is_accessible_controller() {\r\n\t\tinclude_once 'menu_aksi.php';\r\n\t\t$menu_aksi = new menu_aksi($this->Command);\r\n\t\tif($menu_aksi->getByController(true) != 0) {\r\n\t\t\tinclude_once 'menu_function_aksi.php';\r\n\t\t\t$menu_function_aksi = new menu_function_aksi($this->Command);\r\n\t\t\tif($menu_function_aksi->getByName(true) != 0) {\r\n\t\t\t\t$this->model = new permission();\r\n\t\t\t\t$this->model->set_select_full_prefix('select * from permission p,user u');\r\n\t\t\t\t$this->model->set_select_full_suffix('p.ROLE = u.ROLE and p.MENU = (select id_menu from menu where controller=\\'' . $this->Command->getControllerName() . '\\') and u.USERNAME=\\'' . $this->Command->getUserLogged()->get_username() . '\\' and menu_function=(select id_menu_function from menu_function where nama_menu_function=\"' . $this->Command->getFunction() . '\" limit 1)');\r\n\t\t\t\treturn ($this->svc->select_count($this->model) > 0) ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private function recipeHasCategory($recipe) {\n // Meanwhile, we assume any recipe has any category.\n return true;\n }", "private function isValidCategoryPath($categoryId)\n {\n $defaultShopCategoryId = Shopware()->Shop()->getCategory()->getId();\n\n /** @var \\Shopware\\Models\\Category\\Repository $categoryRepository */\n $categoryRepository = Shopware()->Models()->getRepository(\\Shopware\\Models\\Category\\Category::class);\n $categoryPath = $categoryRepository->getPathById($categoryId);\n\n if (!array_key_exists($defaultShopCategoryId, $categoryPath)) {\n $this->Request()->setQuery('sCategory', $defaultShopCategoryId);\n $this->Response()->setStatusCode(404);\n\n return false;\n }\n\n return true;\n }", "protected function hasParentMenuItemKey() {}", "function isOpen($cat) {\n global $GLOBAL;\n\tif($GLOBAL['category']==$cat) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public static function canDisplayMaritalStatusesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_MARITAL_STATUS);\n\t}", "public function checkCategoria($id_categoria) {\n return true;\n }", "public function isBreadOnCategory(Mage_Catalog_Model_Category $category)\n {\n $breadCategories = Mage::helper('breadcheckout')->getBreadCategories();\n $categoryIds = explode(',', $breadCategories);\n if(in_array($category->getId(), $categoryIds))\n return true;\n else\n return false;\n }", "public function isMenu()\n {\n // todo: it might be better to move this method to trait.\n return false;\n }", "public static function updateMenulink($category)\n {\n if(self::isInMenuLinks($category->categoryID)) {\n $menuLinks = MenuLink::where('belongsToID', $category->categoryID)->where('belongsTo', 'category')->get();\n foreach($menuLinks as $menuLink){\n $menuLink->params = $category->menuLinkParameters();\n $menuLink->save();\n }\n }\n }", "function checkCategory($storeId=null,$merchant_id=null,$catId=null) {\n \n App::import('Model', 'Category');\n $this->Category = new Category();\n $result=FALSE;\n $checkCategory=$this->Category->find('first',array('conditions'=>array('Category.store_id'=>$storeId,'Category.merchant_id'=>$merchant_id,'Category.is_deleted'=>0,'Category.id'=>$catId,'Category.is_active'=>1),'fields'=>array('id')));\n if(!empty($checkCategory)){\n $result=TRUE;\n }else{\n $result=FALSE;\n }\n return $result;\n }", "public function has_menu()\r\n {\r\n return false;\r\n }", "function check_category_code($category_code){\n\t\t\tif($this->db->get_where('category',array('code'=>$category_code))->num_rows()>0 ){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function has_category_thumbnail( $cat = '' ) {\n\techo Category_Thumbnail::has_category_thumbnail( $cat );\n\t\n}", "private function validate() {\n\t\tif (!$this->user->hasPermission('modify', 'module/bottomlistcategory')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t}\n\t\t\n\t\tif (!$this->error) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\t\n\t}", "function isPartCategory($input) {\n return (preg_match(\"~(^(?:(?:[a-zA-Z]+)(?:[ ]?))+$)~\", $input));\n }", "public static function canDisplayLeadTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_LEAD_TYPE);\n\t}", "function is_nav_menu_item($menu_item_id = 0)\n {\n }", "public function testCategoriesAreListed()\n {\n $category = factory(Category::class)->create();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories')\n ->assertSuccessful()\n ->assertSee($category->name);\n }", "public function validateCatalogCategories()\n {\n $forward = false;\n switch ($this->getActionName()) {\n case self::ACTION_ADD:\n /**\n * adding is not allowed from beginning if user has scope specified permissions\n */\n $forward = true;\n $parentId = $this->_request->getParam('parent');\n if ($parentId) {\n $forward = !$this->_validateCatalogSubCategoryAddPermission($parentId);\n }\n break;\n case self::ACTION_EDIT:\n if (!$this->_request->getParam('id')) {\n $parentId = $this->_request->getParam('parent');\n if ($parentId) {\n $forward = !$this->_validateCatalogSubCategoryAddPermission($parentId);\n } else {\n // no adding root categories\n $forward = true;\n }\n } else {\n try {\n $category = $this->categoryRepository->get($this->_request->getParam('id'));\n } catch (NoSuchEntityException $e) {\n $category = null;\n }\n if (!$category || !$this->_isCategoryAllowed($category)) {\n // no viewing wrong categories\n $forward = true;\n }\n }\n break;\n }\n\n // redirect to first allowed root category\n if ($forward) {\n $firstRootId = current(array_keys($this->_role->getAllowedRootCategories()));\n if (count($this->_role->getAllowedRootCategories()) > 0 && $firstRootId) {\n $this->_redirect(['*/*/*', 'id' => $firstRootId]);\n } else {\n $this->_forward();\n }\n }\n }", "private function is_parent()\n\t{\n\t\treturn is_null($this->category_id);\n\t}", "public static function canDisplayMilestoneTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_MILESTONE_TYPE);\n\t}", "function categoryExists($cat) { // Return true if the given category exists\n\t$cat = dbEscape($cat);\n\treturn(dbResultExists(\"SELECT * FROM categories WHERE name='$cat'\"));\n}", "function droit_gestion_categories()\r\n{\r\n\tif($_SESSION[\"espace\"][\"droit_acces\"]==2 || ($_SESSION[\"user\"][\"id_utilisateur\"]>0 && option_module(\"ajout_categorie_admin\")!=true))\r\n\t\treturn true;\r\n}", "static function canMatch($cat)\n {\n \tif(User::getCategoryCount($cat) > 9)\n \t\tif(!self::isWeekend(time()))\n \t\t\treturn true;\n \t\telse\n \t\t\treturn false;\n \telse\n \t\treturn false;\n \n }", "protected function _canShow(Mage_Catalog_Model_Category $category)\n {\n // check if the category is new\n if (!$category->getId()) {\n // if yes, return FALSE\n return false;\n }\n // check if the category is active\n if (!$category->getIsActive()) {\n // if yes, return FALSE\n return false;\n }\n // else return TRUE\n return true;\n }", "public static function existsCategory($category) {\n $n = self::where('name', '=', $category)->where('parent_category_id', '=', 17)->count();\n return $n>0;\n }", "public function showInMenu()\n {\n $ctrs = PageCom::ctrs();\n return $ctrs && (count($ctrs) > 1);\n }", "public function menuIsReal($title_menu)\n\t{\n\t\t$out = false;\n\t\n\t\t$sql = \"SELECT\n\t\t\t\t\t`link_id`\n\t\t\t\tFROM\n\t\t\t\t\t`menu`\n\t\t\t\tWHERE\n\t\t\t\t\t`title_menu` = ?\n\t\t\t\t\";\n\t\t\t\t\n\t\t$stmt = $this->db->prepare($sql);\n\t\t$stmt->bind_param('s',$title_menu);\n\t\t$stmt->bind_result($link_id);\n\t\t$stmt->execute();\n\t\tif($stmt->fetch())\n\t\t{\n\t\t\t$out = true;\n\t\t} \n\t\t$stmt->close();\n\t\t\n\t\treturn $out;\n\t}", "public static function inCat( $cat, $title = false ) {\n\t\tglobal $wgTitle;\n\t\tif( $title === false ) $title = $wgTitle;\n\t\tif( !is_object( $title ) ) $title = Title::newFromText( $title );\n\t\t$id = $title->getArticleID();\n\t\t$dbr = wfGetDB( DB_SLAVE );\n\t\t$cat = $dbr->addQuotes( Title::newFromText( $cat, NS_CATEGORY )->getDBkey() );\n\t\treturn $dbr->selectRow( 'categorylinks', '1', \"cl_from = $id AND cl_to = $cat\" );\n\t}", "public function is_registered($category_name)\n {\n }", "function exclude_category($category) {\r\n switch($category) {\r\n case 99999:\r\n case 99998:\r\n return true;\r\n }\r\n return false;\r\n }", "public static function canDisplayAttorneyTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ATTORNEY_TYPE);\n\t}", "function has_category_thumbnail( $cat = '' ) {\n\t\tglobal $wp_taxonomies;\n\t\t\n\t\tif ( is_object( $cat ) )\n\t\t\t$cat_id = $cat->term_id;\n\t\t\n\t\tif ( is_numeric( $cat ) )\n\t\t\t$cat_id = (int) $cat;\n\t\t\n\t\tif ( '' == $cat )\n\t\t\t$cat_id = get_category( get_query_var( 'cat' ) )->term_id;\n\t\t\n\t\t\n\t\t$image = get_option( 'category_thumbnail_image' );\n\t\t\n\t\tif ( is_array( $image ) && array_key_exists( $cat_id, $image ) )\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public function isCategory( $name ) {\n $query = $this->db->query( \"SELECT DISTINCT category_id FROM \" . DB_PREFIX . \"category_description WHERE name = '\" . $name . \"'\" );\n\n return $query->row;\n }", "public function canBeShowInCategory($categoryId)\n {\n return $this->_getResource()->canBeShowInCategory($this, $categoryId);\n }", "public function isCategoryDisplayedInPreferences( $category ) {\n\t\treturn !(\n\t\t\tisset( $this->categories[$category]['no-dismiss'] ) &&\n\t\t\tin_array( 'all', $this->categories[$category]['no-dismiss'] )\n\t\t);\n\t}", "function matchFirstCategory( $menuname, $categories ) {\n # First load and parse the template page \n $content = loadTemplate( $menuname );\n \n # Navigation list\n $breadcrumb = '';\n preg_match_all( \"`<li>\\s*?(.*?)\\s*</li>`\", $content, $matches, PREG_PATTERN_ORDER );\n \n # Look for the first matching category or a default string\n foreach ( $matches[1] as $nav ) {\n $pos = strpos( $nav, DELIM ); // End of category\n if ( $pos !== false ) {\n $cat = trim( substr($nav, 0, $pos) );\n $crumb = trim( substr($nav, $pos + 1) );\n // Is there a match for any of our page's categories? \n if ( $cat == 'default' ) {\n $breadcrumb = $crumb;\n }\n else if ( in_array( $cat, $categories ) ) {\n $breadcrumb = $crumb;\n break;\n }\n }\n }\n \n return normalizeParameters( $breadcrumb, DELIM, 3 );\n}", "function category_has_children() {\n global $wpdb;\n $term = get_queried_object();\n $category_children_check = $wpdb->get_results(\" SELECT * FROM wp_term_taxonomy WHERE parent = '$term->term_id' \");\n if ($category_children_check) {\n return true;\n } else {\n return false;\n }\n}", "public function isCurrent($link_page_id)\n {\n if (!isset($this->page) or $this->page == false) {\n return false;\n }\n if ($link_page_id == $this->page->id) {\n return true;\n }\n if (\n $link_page_id == $this->page->getParent()->id and\n $this->page->getParent()->getMeta('.category')\n ) {\n return true;\n }\n return false;\n }", "public function canAccessPage(){\n\n\t\t\t$nav = $this->getNavigationArray();\n\t\t\t$page = '/' . trim(getCurrentPage(), '/') . '/';\n\n\t\t\t$page_limit = 'author';\n\n\t\t\tforeach($nav as $item){\n\t\t\t\tif(General::in_array_multi($page, $item['children'])){\n\n\t\t\t\t\tif(is_array($item['children'])){\n\t\t\t\t\t\tforeach($item['children'] as $c){\n\t\t\t\t\t\t\tif($c['type'] == 'section' && $c['visible'] == 'no' && preg_match('#^' . $c['link'] . '#', $page)) {\n\t\t\t\t\t\t\t\t$page_limit = 'developer';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($c['link'] == $page && isset($c['limit'])) {\n\t\t\t\t\t\t\t\t$page_limit\t= $c['limit'];\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\tif(isset($item['limit']) && $page_limit != 'primary'){\n\t\t\t\t\t\tif($page_limit == 'author' && $item['limit'] == 'developer') $page_limit = 'developer';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\telseif(isset($item['link']) && ($page == $item['link']) && isset($item['limit'])){\n\t\t\t\t\t$page_limit\t= $item['limit'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($page_limit == 'author')\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}" ]
[ "0.69045794", "0.68995816", "0.68143946", "0.6629379", "0.6563836", "0.6525694", "0.6268241", "0.6144462", "0.60889053", "0.5977813", "0.5943808", "0.59219265", "0.59155315", "0.5886372", "0.58811915", "0.58677614", "0.5846663", "0.58392215", "0.5788265", "0.5781857", "0.57316977", "0.5730574", "0.572084", "0.56961536", "0.56893903", "0.5680886", "0.5667978", "0.5656992", "0.56349236", "0.56313825", "0.56308335", "0.5626749", "0.5626366", "0.56190854", "0.5613986", "0.5612426", "0.55889916", "0.5572308", "0.5567343", "0.5559006", "0.553978", "0.5527567", "0.5526865", "0.55087554", "0.5498872", "0.54903316", "0.5489775", "0.5483651", "0.5451719", "0.5451343", "0.5445039", "0.5440523", "0.5431001", "0.54254913", "0.54241693", "0.5415685", "0.5398954", "0.53977436", "0.5394037", "0.5380211", "0.5378319", "0.5377369", "0.536785", "0.5354445", "0.5343066", "0.53409547", "0.5329101", "0.5318643", "0.5279105", "0.5268045", "0.52646357", "0.5264547", "0.5256108", "0.52421314", "0.5214322", "0.52091205", "0.5203961", "0.51996404", "0.51962316", "0.5192859", "0.5185343", "0.51837516", "0.51831067", "0.5178637", "0.51745296", "0.5170049", "0.51679456", "0.5160125", "0.5159799", "0.51411617", "0.51384914", "0.5132009", "0.51299584", "0.5129595", "0.51225054", "0.51224667", "0.5121698", "0.5112518", "0.5111265", "0.51106906" ]
0.6082542
9
Add a category to a Menu.
public function addToMenu(Menu $menu) { if($this->postTypeID) { $data = [ 'menuID' => $menu->menuID, 'belongsToID' => $this->categoryID, 'belongsTo' => 'category', 'params' => $this->menuLinkParameters(), 'routeName' => 'category.posts' ]; foreach (Language::all() as $language) { $data['slug'][$language->slug] = $this->translate($language->slug)->slug; $data['label'][$language->slug] = $this->title; } factory(MenuLink::class)->create($data); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add(Category $category);", "static function add_category($menu_params) {\n\n // requiered parameters\n self::check_params(__CLASS__, __FUNCTION__, $menu_params, array(\n 'title' => 'Param is requiered!',\n 'category_id' => 'Param is requiered! - this is the category id that will be used to generate the mega menu',\n 'add_to_menu_id' => 'A menu id generated by ale_demo_menus::create_menu is requiered'\n ));\n\n\n $itemData = array(\n 'menu-item-title' => $menu_params['title'],\n 'menu-item-object-id' => $menu_params['category_id'],\n 'menu-item-db-id' => 0,\n 'menu-item-url' => get_category_link($menu_params['category_id']),\n 'menu-item-type' => 'taxonomy', //taxonomy\n 'menu-item-status' => 'publish',\n 'menu-item-object' => 'category',\n );\n\n if (!empty($menu_params['parent_id'])) {\n $itemData['menu-item-parent-id'] = $menu_params['parent_id'];\n }\n\n $menu_item_id = wp_update_nav_menu_item($menu_params['add_to_menu_id'], 0, $itemData);\n return $menu_item_id;\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function add(Menu $menu);", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function addcategory($args)\n {\n if (!SecurityUtil::checkPermission('Dizkus::', \"::\", ACCESS_ADMIN)) {\n return LogUtil::registerPermissionError();\n }\n \n if (isset($args['cat_title'])) {\n $args['cat_order'] = DBUtil::selectObjectCount('dizkus_categories') + 1;\n $obj = DBUtil::insertObject($args, 'dizkus_categories', 'cat_id');\n return $obj['cat_id'];\n }\n \n return false;\n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function add(Category $category): Category\n {\n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "function add(){\n\t\tif(!$this->checkLogin()){\n\t\t\tredirect(base_url());\n\t\t}\n\n\t\t$pageData['header_title'] = APP_NAME.' | Add Document Category';\n\t\t$pageData['page_title'] = 'Document Category Management';\n\t\t$pageData['parent_menu'] = 'document_management';\n\t\t$pageData['child_menu'] = 'document_category';\n\n\t\t$this->load->view('admin/document_management/category/add', $pageData);\n\t}", "public function addCategoryToGroupById($gorup_id, $category_id);", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function addMenuOption($category, $title, $route, $permissions = null)\n {\n if (!isset($this->menu[$category])) {\n $this->menu[$category] = array();\n }\n $this->menu[$category][$title] = array(\n 'route' => $route,\n 'permissions' => $permissions,\n );\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "public function add($title, $link = null, $cPath = null) {\n global $lC_Category;\n \n if ($cPath != null) {\n $cPathArr = explode('_', $cPath);\n $cp = '';\n foreach ($cPathArr as $id) {\n $lC_Category = new lC_Category($id);\n $this->_path[] = lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $cp . $id), $lC_Category->getTitle($id));\n $cp .= $id . '_';\n }\n }\n \n if ( !empty($link) ) {\n $title = lc_link_object($link, $title);\n }\n\n if ( !empty($title) ) {\n $this->_path[] = $title;\n }\n }", "public function createCategory();", "public function addCategoryToGroupByName($gorup_name, $category_name);", "public function addMenu()\n {\n $wpMenu = [\n [\n 'Bolsista',\n 'Bolsista',\n 'edit_pages',\n 'bolsista',\n $this,\n 'doAction',\n 'dashicons-format-aside',\n 2\n ]\n ];\n $wpSubMenu = [];\n $this->addMenuItem($wpMenu, $wpSubMenu);\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 }", "public function actionAdd ()\n\t\t{\n\n\t\t\t$menu = new Menu();\n\t\t\t$this->_tpl = '@menuViews/add';\n\t\t\t$this->setTitle(Yii::tr('Add menu item', [], 'menu'));\n\t\t\t$type = MenuType::findOne(Yii::$app->request->get('type'));\n\t\t\tif ($type == null)\n\t\t\t\treturn;\n\t\t\t$root = null;\n\t\t\t$parentId = Yii::$app->request->get('parentID');\n\t\t\tif (!is_null($parentId))\n\t\t\t{\n\t\t\t\t$root = Menu::findOne([ 'id' => $parentId, 'typeID' => $type->id ]);\n\t\t\t\t$this->setTitle(Yii::tr('Add menu subitem to {title}', [ 'title' => $root->title ], 'menu'));\n\t\t\t}\n\n\t\t\tif (Yii::$app->request->isPost)\n\t\t\t{\n\t\t\t\t$post = Yii::$app->request->post('Menu');\n\n\t\t\t\tif (is_null($root))\n\t\t\t\t{\n\t\t\t\t\t$root = Menu::findOne([ 'title' => $type->guid . '_ROOT', 'typeID' => $type->id ]);\n\t\t\t\t\tif ($root == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$root = new Menu([ 'title' => $type->guid . '_ROOT', 'typeID' => $type->id ]);\n\t\t\t\t\t\t$root->makeRoot();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$menu->setAttributes([\n\t\t\t\t\t'title' => $post[ 'title' ],\n\t\t\t\t\t'url' => $post[ 'url' ],\n\t\t\t\t\t'path' => $post[ 'path' ],\n\t\t\t\t\t'typeID' => $type->id\n\t\t\t\t]);\n\n\t\t\t\t$menu->appendTo($root);\n\t\t\t\tYii::$app->notification->messageToSession(Yii::tr('Menu item was saved.', [], 'menu'));\n\t\t\t\t$this->redirect(Url::toRoute([ '/menu/index', 'type' => $type->id ]));\n\t\t\t}\n\t\t\t$this->data('model', $menu);\n\t\t}", "function create_menu() {\n add_options_page(\"Category redirect\", \"Category redirect\", \"manage_options\", \"category-redirect\", array($this,'categ_url_hack_options')); \n\t\t}", "public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function addCategory()\n {\n $baker = Bakery::orderBy('id')->get();\n $this->authorize('category');\n return view('Admin.Bakery.Category.category', ['baker' => $baker]);\n }", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function addCategory(Category $category){\n $req =$this->db->prepare('INSERT INTO p5_files_category(category_name)\n VALUES(?)');\n $req->execute(array($category->getCategory_name()));\n }", "public function addCategory($name, $domain = null);", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function addMenu($data){\n\n\t\treturn $this->insert(['item'=>$data['item'], 'anchor' => $data['anchor']]);\n\t}", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "public function category()\n\t{\n\t\t$crud = $this->generate_crud('blog_categories');\n\t\t$crud->columns('title');\n\t\t$this->mPageTitle = 'Blog Categories';\n\t\t$this->mViewData['crud_note'] = modules::run('adminlte/widget/btn', 'Sort Order', 'blog/category_sortable');\n\t\t$this->render_crud();\n\t}", "public function addCategory(HostCategory $category): void;", "public function addCategory(CategoryElementInterface $category);", "public function addMenu(Menu $menu) {\n $this->items[] = $menu;\n }", "public function addCategory()\n {\n $items = Categories::where('is_parent', 1)->orderBy('category_name')->get();\n return view('admin.category.addCategory', compact('items'));\n }", "public function categoryAction()\n\t{\n\t\t$id = (int) $this->getRequest()->getParam('id');\n\t\t$this->view->category = $this->_blogService->findCategory($id);\n\t}", "public function add_menu($node)\n {\n }", "private function addCategory(HTTPRequest $request)\n {\n if ($this->manager->getManagerOf('Category')->getCategoryByName($request->postData('newCategory')) != null) {\n Session::getInstance()->setFlash('danger', 'Cette catégorie existe déjà.');\n } else {\n if ($request->postExists('newCategory') && ($this->manager->getManagerOf('Category')->getCategoryByName($request->postData('newCategory')) == false)) {\n $category = new Category(\n ['name' => $request->postData('newCategory')]\n );\n\n if ($category->getErrors() != null) {\n $category->getErrorMessage();\n } else {\n $this->manager->getManagerOf('Category')->addNewCategory($category);\n Session::getInstance()->setFlash('success', 'Une nouvelle catégorie a été ajoutée.');\n }\n }\n }\n }", "public function AddCategory(CategoryTSE $category) {\n $this->Categories[] = $category;\n }", "public function add_menus()\n {\n }", "public function newCategory($options = array())\n {\n return $this->newItem(\"category\", \"categories\", $options);\n }", "public function addCategory($category) {\n $this->listingCategories[] = $category;\n }", "public function addCategory()\n {\n return view('backend.admin-panel.pages.addCategory');\n }", "function AddCategory(&$category)\n\t{\n\t\tif ($category instanceof Category)\n\t\t{\n\t\t\tif (in_array($this, $category->supplierList, true))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$found = false;\n\t\t\t\tforeach ($this->_categoryList as $category2)\n\t\t\t\t{\n\t\t\t\t\tif ($category->categoryId > 0 && $category->categoryId == $category2->categoryId)\n\t\t\t\t\t{\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$found)\n\t\t\t\t{\n\t\t\t\t\t$this->_categoryList[] = $category;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addMenuItem() {\n add_menu_page(__('Visual Chat', 'WP_Visual_Chat'), 'Visual Chat', 'visual_chat', 'vcht-console', array($this, 'viewChatBackend'), 'dashicons-format-chat');\n }", "function addCategory() {\n var_dump($this->request->data);\n if ($this->request->is('post') || $this->request->is('put')) {\n $ci = $this->CategoryItem->create();\n var_dump($ci);\n if ($this->CategoryItem->save($this->request->data)) {\n $this->Session->setFlash(__('The %s has been saved', __('link')), 'flash/success');\n } else {\n $this->Session->setFlash(__('The %s could not be saved. Please, try again.', __('link')), 'flash/failure');\n }\n// $this->redirect(array('action' => 'edit', $this->Item->id));\n } else {\n $this->redirect(array('action' => 'index'));\n }\n }", "public function addMultipleCategoriesToGroup();", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "public function addMenuItem($name, $action = null, $group = null): Item;", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "public function registerMenuOptions()\n {\n if (Auth::user()->hasPermission('property_category.index')) {\n Menu::registerMenuOptions(Category::class, trans('plugins/real-estate::category.menu'));\n }\n }", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "public function addCategories(array $categories);", "public static function category_box() {\n\t\t\t\n\t\t\tglobal $post;\n\t\t\tglobal $wpdb;\n\t\n\t\t\t$cat_list = $wpdb->get_results( \"SELECT re_int, re_title FROM \".$wpdb->prefix.self::$table_name);?>\n\t\t\t\n\t\t\t<label for=\"siteurl\">Select the appropriate Menu Category for this current dish.<br /></label>\n\t\t\t<p>\n\t\t\t\n\t\t\t\t<?php\n\t\t\t\t\tif(!empty($cat_list)){\n\t\t\t\t\t\techo \"<select style='width:200px' name='cat_id'>\";\n\t\t\t\t\t\tforeach($cat_list as $list => $val){\n\t\t\t\t\t\t\t$sel = \"\";\n\t\t\t\t\t\t\tif(isset($_GET['menucat']) && ($_GET['menucat'] == $val->re_int )) { \n\t\t\t\t\t\t\t\t$sel = ' selected=\"selected\"'; \n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$menucat = get_post_meta($post->ID, \"meta_menucat\", true);\n\t\t\t\t\t\t\t\tif($menucat == $val->re_int ) { $sel = ' selected=\"selected\"';} \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo \"<option value='\".$val->re_int.\"' \".$sel.\">\".$val->re_title.\"</option>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"</select>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<a href='edit.php?post_type=menucategory-post&page=menu_listings'>Add Categories First.</a>\";\n\t\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t</p>\n\t\t\n\t\t\t<?php\n\t\t}", "function add() {\n\t\t$this->account();\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Menu->create();\n\t\t\tif ($this->Menu->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Thêm mới danh mục thành công', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Thêm mơi danh mục thất bại. Vui long thử lại', true));\n\t\t\t}\n\t\t}\n\t\t$this->loadModel(\"Menu\");\n $menulist = $this->Menu->generatetreelist(null,null,null,\" _ \");\n $this->set(compact('menulist'));\n\t}", "public function addMenuItem(Request $request, array $item, MenuItem $menu);", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function addCategory(GmthApiCategorie $categorie)\n\t{\n\t\t$this->_categories[] = $categorie->getId();\n\t}", "function wpc_client_add_blog_cats_to_menu( $items, $args = '' ) {\r\n\r\n $show_link = get_option( 'wpc_show_link' );\r\n\r\n if ( $show_link == \"yes\" ) {\r\n if ( is_user_logged_in() && !current_user_can( 'manage_options' ) ) {\r\n\r\n if ( current_user_can( 'wpc_client_staff' ) )\r\n $client_id = get_user_meta( get_current_user_id(), 'parent_client_id', true );\r\n else\r\n $client_id = get_current_user_id();\r\n\r\n $hub_id = get_user_meta( $client_id, 'wpc_cl_hubpage_id', true );\r\n\r\n $page = get_post( $hub_id );\r\n $link = get_permalink( $page->ID );\r\n $link_text = get_option( 'wpc_link_text' );\r\n\r\n if( get_option( 'permalink_structure' ) ) {\r\n return $items . '<li><a href=\"' . wpc_client_get_slug( 'hub_page_id' ) . '\">' . $link_text . '</a></li>';\r\n } else {\r\n return $items . '<li><a href=\"' . $link . '\">' . $link_text . '</a></li>';\r\n }\r\n }\r\n }\r\n\r\n return $items;\r\n }", "function addcategory(){\n \treturn view('category');\n }", "private function addBlogMenuItem($itemLanguage, $categoryId)\n\t{\n\t\t// Add Menu Item.\n\t\t$tableItem = $this->app->bootComponent('com_menus')->getMVCFactory()->createTable('Menu', 'Administrator', ['dbo' => $this->db]);\n\n\t\t$newlanguage = new Language($itemLanguage->language, false);\n\t\t$newlanguage->load('com_languages', JPATH_ADMINISTRATOR, $itemLanguage->language, true);\n\t\t$title = $newlanguage->_('COM_LANGUAGES_HOMEPAGE');\n\t\t$alias = 'home_' . $itemLanguage->language;\n\n\t\t$menuItem = array(\n\t\t\t'title' => $title,\n\t\t\t'alias' => $alias,\n\t\t\t'menutype' => 'mainmenu-' . strtolower($itemLanguage->language),\n\t\t\t'type' => 'component',\n\t\t\t'link' => 'index.php?option=com_content&view=category&layout=blog&id=' . $categoryId,\n\t\t\t'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id,\n\t\t\t'published' => 1,\n\t\t\t'parent_id' => 1,\n\t\t\t'level' => 1,\n\t\t\t'home' => 1,\n\t\t\t'params' => '{\"layout_type\":\"blog\",\"show_category_heading_title_text\":\"\",\"show_category_title\":\"\",'\n\t\t\t\t. '\"show_description\":\"\",\"show_description_image\":\"\",\"maxLevel\":\"\",\"show_empty_categories\":\"\",'\n\t\t\t\t. '\"show_no_articles\":\"\",\"show_subcat_desc\":\"\",\"show_cat_num_articles\":\"\",\"show_cat_tags\":\"\",'\n\t\t\t\t. '\"blog_class_leading\":\"\",\"blog_class\":\"\",\"num_leading_articles\":\"1\",\"num_intro_articles\":\"3\",'\n\t\t\t\t. '\"num_links\":\"0\",\"show_subcategory_content\":\"\",\"link_intro_image\":\"\",\"orderby_pri\":\"\",'\n\t\t\t\t. '\"orderby_sec\":\"front\",\"order_date\":\"\",\"show_pagination\":\"2\",\"show_pagination_results\":\"1\",'\n\t\t\t\t. '\"show_featured\":\"\",\"article_layout\":\"_:default\",\"show_title\":\"\",\"link_titles\":\"\",\"show_intro\":\"\",\"info_block_position\":\"\",'\n\t\t\t\t. '\"info_block_show_title\":\"\",\"show_category\":\"\",\"link_category\":\"\",\"show_parent_category\":\"\",'\n\t\t\t\t. '\"link_parent_category\":\"\",\"show_associations\":\"\",\"show_author\":\"\",\"link_author\":\"\",'\n\t\t\t\t. '\"show_create_date\":\"\",\"show_modify_date\":\"\",\"show_publish_date\":\"\",\"show_item_navigation\":\"\",'\n\t\t\t\t. '\"show_vote\":\"\",\"show_readmore\":\"\",\"show_readmore_title\":\"\",\"show_hits\":\"\",\"show_tags\":\"\",'\n\t\t\t\t. '\"show_noauth\":\"\",\"show_feed_link\":\"1\",\"feed_summary\":\"\",\"menu-anchor_title\":\"\",\"menu-anchor_css\":\"\",'\n\t\t\t\t. '\"menu_image\":\"\",\"menu_image_css\":\"\",\"menu_text\":1,\"menu_show\":1,\"page_title\":\"\",\"show_page_heading\":\"1\",'\n\t\t\t\t. '\"page_heading\":\"\",\"pageclass_sfx\":\"\",\"menu-meta_description\":\"\",\"robots\":\"\"}',\n\t\t\t'language' => $itemLanguage->language,\n\t\t);\n\n\t\t// Bind the data.\n\t\tif (!$tableItem->bind($menuItem))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$tableItem->setLocation($menuItem['parent_id'], 'last-child');\n\n\t\t// Check the data.\n\t\tif (!$tableItem->check())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Store the data.\n\t\tif (!$tableItem->store())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Rebuild the tree path.\n\t\tif (!$tableItem->rebuildPath($tableItem->id))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $tableItem;\n\t}", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "function wp_ajax_press_this_add_category()\n {\n }", "static public function addMenu($request) {\n $menu = new self();\n $menu->title = $request->title;\n $menu->url = $request->url;\n $menu->save();\n if ($menu->id) {\n return true;\n }\n return false;\n }", "public function testCreateCategory()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/category')\n ->clickLink('Add Cagegory')\n ->assertPathIs('/admin/category/create')\n ->assertSee('Create Category');\n });\n }", "function h_add_menu(string $title, array $args) {\n h_add_menus([\n $title => $args\n ]);\n}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function addCategory($categoryId) {\n\t\t$quizCat = ['quizId' => $this->id, 'categoryId' => $categoryId];\n\n\t\t$this->quizCategoriesTable->save($quizCat);\n\t}", "public function addCategory()\n {\n $data['categorys'] = Category::whereNull('parent_id')->get();\n return view('category.addEdit', $data);\n }", "public function addCategory($itemLanguage)\n\t{\n\t\t$newlanguage = new Language($itemLanguage->language, false);\n\t\t$newlanguage->load('joomla', JPATH_ADMINISTRATOR, $itemLanguage->language, true);\n\t\t$title = $newlanguage->_('JCATEGORY');\n\t\t$alias = ApplicationHelper::stringURLSafe($title);\n\n\t\t$app = Factory::getApplication();\n\n\t\t// Set unicodeslugs if alias is empty\n\t\tif (trim(str_replace('-', '', $alias) == ''))\n\t\t{\n\t\t\t$unicode = $app->set('unicodeslugs', 1);\n\t\t\t$alias = ApplicationHelper::stringURLSafe($title);\n\t\t\t$app->set('unicodeslugs', $unicode);\n\t\t}\n\n\t\t// Initialize a new category.\n\t\t$category = $this->app->bootComponent('com_categories')->getMVCFactory()->createTable('Category', 'Administrator', ['dbo' => $this->db]);\n\n\t\t$data = array(\n\t\t\t'extension' => 'com_content',\n\t\t\t'title' => $title . ' (' . strtolower($itemLanguage->language) . ')',\n\t\t\t'alias' => $alias . ' (' . strtolower($itemLanguage->language) . ')',\n\t\t\t'description' => '',\n\t\t\t'published' => 1,\n\t\t\t'access' => 1,\n\t\t\t'params' => '{\"target\":\"\",\"image\":\"\"}',\n\t\t\t'metadesc' => '',\n\t\t\t'metakey' => '',\n\t\t\t'metadata' => '{\"page_title\":\"\",\"author\":\"\",\"robots\":\"\"}',\n\t\t\t'created_time' => Factory::getDate()->toSql(),\n\t\t\t'created_user_id' => (int) $this->getAdminId(),\n\t\t\t'language' => $itemLanguage->language,\n\t\t\t'rules' => array(),\n\t\t\t'parent_id' => 1,\n\t\t);\n\n\t\t// Set the location in the tree.\n\t\t$category->setLocation(1, 'last-child');\n\n\t\t// Bind the data to the table\n\t\tif (!$category->bind($data))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check to make sure our data is valid.\n\t\tif (!$category->check())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Store the category.\n\t\tif (!$category->store(true))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Build the path for our category.\n\t\t$category->rebuildPath($category->id);\n\n\t\treturn $category;\n\t}", "private function addAllCategoriesMenuItem($itemLanguage)\n\t{\n\t\t// Add Menu Item.\n\t\t$tableItem = $this->app->bootComponent('com_menus')->getMVCFactory()->createTable('Menu', 'Administrator', ['dbo' => $this->db]);\n\n\t\t$newlanguage = new Language($itemLanguage->language, false);\n\t\t$newlanguage->load('joomla', JPATH_ADMINISTRATOR, $itemLanguage->language, true);\n\t\t$title = $newlanguage->_('JCATEGORIES');\n\t\t$alias = 'allcategories_' . $itemLanguage->language;\n\n\t\t$menuItem = array(\n\t\t\t'title' => $title,\n\t\t\t'alias' => $alias,\n\t\t\t'menutype' => 'mainmenu-' . strtolower($itemLanguage->language),\n\t\t\t'type' => 'component',\n\t\t\t'link' => 'index.php?option=com_content&view=categories&id=0',\n\t\t\t'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id,\n\t\t\t'published' => 1,\n\t\t\t'parent_id' => 1,\n\t\t\t'level' => 1,\n\t\t\t'home' => 0,\n\t\t\t'params' => '{\"show_base_description\":\"\",\"categories_description\":\"\",\"maxLevelcat\":\"\",'\n\t\t\t\t. '\"show_empty_categories_cat\":\"\",\"show_subcat_desc_cat\":\"\",\"show_cat_num_articles_cat\":\"\",'\n\t\t\t\t. '\"show_category_title\":\"\",\"show_description\":\"\",\"show_description_image\":\"\",\"maxLevel\":\"\",'\n\t\t\t\t. '\"show_empty_categories\":\"\",\"show_no_articles\":\"\",\"show_subcat_desc\":\"\",\"show_cat_num_articles\":\"\",'\n\t\t\t\t. '\"num_leading_articles\":\"\",\"num_intro_articles\":\"\",\"num_links\":\"\",'\n\t\t\t\t. '\"show_subcategory_content\":\"\",\"orderby_pri\":\"\",\"orderby_sec\":\"\",'\n\t\t\t\t. '\"order_date\":\"\",\"show_pagination_limit\":\"\",\"filter_field\":\"\",\"show_headings\":\"\",'\n\t\t\t\t. '\"list_show_date\":\"\",\"date_format\":\"\",\"list_show_hits\":\"\",\"list_show_author\":\"\",\"display_num\":\"10\",'\n\t\t\t\t. '\"show_pagination\":\"\",\"show_pagination_results\":\"\",\"article_layout\":\"_:default\",\"show_title\":\"\",'\n\t\t\t\t. '\"link_titles\":\"\",\"show_intro\":\"\",\"show_category\":\"\",\"link_category\":\"\",\"show_parent_category\":\"\",'\n\t\t\t\t. '\"link_parent_category\":\"\",\"show_author\":\"\",\"link_author\":\"\",\"show_create_date\":\"\",'\n\t\t\t\t. '\"show_modify_date\":\"\",\"show_publish_date\":\"\",\"show_item_navigation\":\"\",\"show_vote\":\"\",'\n\t\t\t\t. '\"show_readmore\":\"\",\"show_readmore_title\":\"\",\"show_hits\":\"\",\"show_noauth\":\"\",\"show_feed_link\":\"\",'\n\t\t\t\t. '\"feed_summary\":\"\",\"menu-anchor_title\":\"\",\"menu-anchor_css\":\"\",\"menu_image\":\"\",\"menu_image_css\":\"\",'\n\t\t\t\t. '\"menu_text\":1,\"menu_show\":0,\"page_title\":\"\",\"show_page_heading\":\"\",\"page_heading\":\"\",'\n\t\t\t\t. '\"pageclass_sfx\":\"\",\"menu-meta_description\":\"\",\"robots\":\"\"}',\n\t\t\t'language' => $itemLanguage->language,\n\t\t);\n\n\t\t// Bind the data.\n\t\tif (!$tableItem->bind($menuItem))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$tableItem->setLocation($menuItem['parent_id'], 'last-child');\n\n\t\t// Check the data.\n\t\tif (!$tableItem->check())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Store the data.\n\t\tif (!$tableItem->store())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Rebuild the tree path.\n\t\tif (!$tableItem->rebuildPath($tableItem->id))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $tableItem;\n\t}", "public function executeAddCategory(HTTPRequest $request)\n {\n $this->addCategory($request);\n $this->app->getHttpResponse()->redirect('/admin/listCategories');\n }", "function addCategory($monographId, $categoryId) {\n\t\t$this->update(\n\t\t\t'INSERT INTO submission_categories\n\t\t\t\t(submission_id, category_id)\n\t\t\tVALUES\n\t\t\t\t(?, ?)',\n\t\t\tarray(\n\t\t\t\t(int) $monographId,\n\t\t\t\t(int) $categoryId\n\t\t\t)\n\t\t);\n\t}", "function addCategory($categoryName)\n {\n return $this->data->insertCategory($categoryName);\n }", "function addingcategory(Request $request){\n $res = Category::addCategory($request);\n if ($res) {\n return view('category');\n }\n }", "public function addCategory($data)\n {\n $item=array(\n 'name'=>$data['name']\n );\n\n $this->db->insert('defect_categories',$item);\n return true;\n }", "function showMenu ($additionalCat = '', $additionalWhere = '') {\n\t\t$confSmall = $this->conf['menu.'];\n\n\t\t$template['total'] = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_MENU###');\n\t\t$template['item'] = $this->cObj->getSubpart($template['total'], '###ITEM_SINGLE###');\n\t\t$template['item2'] = $this->cObj->getSubpart($template['total'], '###ITEM_SINGLE2###');\n\n\t\t// query for the categories\n\t\t$table = 'tx_rggooglemap_cat';\n\n\t\t// if the tree is used in menu view, take the IDs from there, otherwise out of the plugin\n\t\tif ($additionalCat != '') {\n\t\t\t$menuCatList = ' AND uid IN (' . implode(',', $additionalCat) . ') ';\n\t\t} else {\n\t\t\t$menuCatList = (($this->config['categories'] != '') ? ' AND uid IN (' . $this->config['categories'] . ') ' : '');\n\t\t}\n\n\t\t$where = '1=1 ' . $this->cObj->enableFields($table) . $menuCatList;\n\t\t$orderBy = $this->config['menu-catSort'] . ' ' . $this->config['menu-catSortBy'];\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $table, $where, $groupBy = '', $orderBy, $limit = '');\n\n\t\t$i = 0;\n\t\t$count = array();\n\n\t\t// List of the Categories\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t// stdwrap for the categories\n\t\t\tforeach ($row as $key=>$value) {\n\t\t\t\t$markerArray['###' . strtoupper($key) . '###'] = $this->cObj->stdWrap($value, $confSmall['category.'][$key . '.']);\n\t\t\t}\n\n\t\t\t// query for single records in category\n\t\t\t$firstCategory = explode(',', $row['uid']);\n\n\t\t\t$where2 = ' rggmcat = ' . $firstCategory{0} . ' AND lat!=0 AND lng!=0 AND lng != \\'\\' AND lat != \\'\\' ' . $this->config['pid_list'];\n\n\t\t\t// search mode\n\t\t\tif ($additionalWhere != '') {\n\t\t\t\t$where2 .= $additionalWhere;\n\t\t\t}\n\n\t\t\t// orderBy\n\t\t\tif ($this->config['menu-recordSort']) {\n\t\t\t\t$orderByRecords = $this->config['menu-recordSort'] . ' ' . $this->config['menu-recordSortBy'];\n\t\t\t}\n\n\t\t\t$res2 = $this->generic->exec_SELECTquery('*', $this->config['tables'], $where2, $groupBy = '', $orderByRecords, $limit = '');\n\n\t\t\t// List of single records\n\t\t\t$content_item2 = '';\n\n\t\t\t// run through the reocrds of the category\n\t\t\t$content_item = '';\n\t\t\twhile ($row2 = array_shift($res2)) {\n\t\t\t\t$i++;\n\n\t\t\t\t$markerArray2 = $this->getMarker($row2, 'menu.', $i);\n\n\t\t\t\t// no page ID for map > suggesting plugin is on the same page => javascript links\n\t\t\t\tif ($this->config['menu-map'] != '') {\n\t\t\t\t\t$vars['poi'] = $row2['uid'];\n\n\t\t\t\t\tif ($row2['table'] != $this->conf['defaultTable']) {\n\t\t\t\t\t\t$vars['table'] = $row2['table'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$wrappedSubpartArray['###LINK_ITEM###'] = explode('|', $this->pi_linkTP_keepPIvars('|', $vars, 1, 1, $this->config['menu-map']));\n\t\t\t\t} else {\n\t\t\t\t\t$wrappedSubpartArray['###LINK_ITEM###'] = explode('|', '<a onclick=\"myclick(' . $row2['uid'] . ',' . $row2['lng'] . ',' . $row2['lat'] . ', \\'' . $row2['table'] . '\\')\" href=\"javascript:void(0)\">|</a>');\n\t\t\t\t}\n\n\t\t\t\t$content_item2 .= $this->cObj->substituteMarkerArrayCached($template['item2'], $markerArray2, $subpartArray, $wrappedSubpartArray);\n\t\t\t}\n\n\t\t\t$subpartArray['###CONTENT2###'] = $content_item2;\n\t\t\tif ($i > 0) {\n\t\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($template['item'], $markerArray, $subpartArray,$wrappedSubpartArray);\n\t\t\t}\n\t\t}\n\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t\t$subpartArray['###CONTENT###'] = ($i > 0) ? $content_item : '';\n\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['total'], $markerArray, $subpartArray, $wrappedSubpartArray);\n\t\treturn $content;\n\t}\n\n\n\t/**\n\t * Plugin mode SEARCH: Presents a form to search for records\n\t *\n\t * @return\tThe plugin content\n\t */\n\tfunction showSearch () {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_SEARCH###');\n\t\t$subpartArray = array();\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['search.']['LL'], 'search');\n\n\t\t// hide the radisus search by using a subpart\n\t\tif ($this->config['search']['radiusSearch'] != 1) {\n\t\t\t$subpartArray['###HIDE_RADIUSSEARCH###'] = '';\n\t\t}\n\n\t\t$markerArray['###DEFAULT_COUNTRY###'] = $this->config['defaultCountry']; // set the default country\n\t\t$markerArray['###DEFAULT_ZIP###'] = htmlspecialchars($this->piVars['zip']);\n\t\t$markerArray['###AUTOSUBMIT###'] = ($this->piVars['zip'] == '') ? '//' : '';\n\n\t\t// fetch the allowed categories as option list\n\t\t$markerArray['###CATEGORY###'] = $this->helperGetRecursiveCat($this->config['categories']);\n\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\treturn $content;\n\t}\n\n\t/**\n\t * Show the category menu\n\t *\n\t * @return directions\n\t */\n\tfunction showCatMenu() {\n\t\t$template['list'] = $this->cObj2->getSubpart($this->templateCode,'###TEMPLATE_CATMENU_MAIN###');\n\t\t$markerArray = array();\n\t\t$markerArray['###ITEMS###'] = $this->displayCatMenu();\n\n\t\t$content = $this->cObj2->substituteMarkerArrayCached($template['list'], $markerArray);\n\t\treturn $content;\n\t}\n\n\t/**\n\t * Show the directions to some records\n\t *\n\t * @return directions\n\t */\n\tfunction showDirections() {\n\t\t$smallConf = $this->conf['directions.'];\n\n\t\t$subpartArray = array();\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $smallConf['LL'], 'directions');\n\n\t\t// query\n\t\t$table = $this->config['tables'];\n\t\t$field = '*';\n\t\t$where = $this->helperGetAvailableRecords($this->config['categories']);\n\t\t$orderBy = $smallConf['orderBy'];\n\t\t$limit = $smallConf['limit'];\n\t\t$res = $this->generic->exec_SELECTquery($field, $table, $where, '', $orderBy, $limit);\n\n\t\t// if just 1 result, render a different subpart\n\t\tif (count($res) == 1) {\n\t\t\t$suffix = '_SINGLE';\n\t\t\t$subpartArray['###HIDE_MULTISELECTION###'] = '';\n\t\t} else {\n\t\t\t$suffix = '';\n\t\t\t$subpartArray['###HIDE_SINGLESELECTION###'] = '';\n\t\t}\n\n\t\t$template['list'] = $this->cObj2->getSubpart($this->templateCode, '###TEMPLATE_DIRECTIONS###');\n\t\t$template['item'] = $this->cObj2->getSubpart($template['list'], '###SINGLE' . $suffix . '###');\n\n\t\t$content_item = '';\n\t\twhile ($row=array_shift($res)) {\n\t\t\t$markerArray = $this->getMarker($row, 'directions.');\n\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($template['item'], $markerArray, array(), $wrappedSubpartArray);\n\t\t}\n\n\t\t$subpartArray['###CONTENT' . $suffix . '###'] = $content_item;\n\n\t\t$markerArray['###DEFAULT_COUNTRY###'] = $this->config['defaultCountry'];\n\n\t\t$content = $this->cObj2->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\treturn $content;\n\t}\n\n\t/**\n\t * Function for the ajax search results\n\t *\n\t * @param\tstring\t\t$searchFields: The search fiels (search word & search on map only)\n\t * @return\tRecords found with search value\n\t */\n\tfunction ajaxSearch($searchForm) {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_SEARCH_RESULTS###');\n\t\t$template['item'] = $this->cObj->getSubpart( $template['list'], '###SINGLE###');\n\t\t$smallConf = $this->conf['search.'];\n\t\t$objResponse = new tx_xajax_response($GLOBALS['TSFE']->metaCharset);\n\n\t\t$test = '';\n\t\t$debug = array();\n\t\t$error = array();\n\n\t\t$jsResultDelete = 'deleteSearchResult();';\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['search.']['LL'], 'search');\n\n\t\t// minimum characters needed, default = 3\n\t\tif (strlen($searchForm['rggmsearchValue']) >= $this->conf['search.']['minChars'] ||\n\t\t\t ($searchForm['rggmActivateRadius']=='1' && $searchForm['rggmRadius']>0)) {\n\t\t\t$res = array();\n\t\t\t$coordinatesSaved = array();\n\n\t\t\t/*\n\t\t\t * Search for the text\n\t\t\t */\n\n\t\t\t// escaping the search-value\n\t\t\t$delete = array(\"'\", \"\\\"\", \"\\\\\", \"/\", \"\");\n\t\t\t$searchExpression = $searchForm['rggmsearchValue'];\n\t\t\t$searchExpression = str_replace($delete, '', $searchExpression);\n\n\t\t\t$tablelist = explode(',', $this->config['tables']);\n\n\t\t\tforeach ($tablelist as $key => $table) {\n\t\t\t\t$searchClause = array();\n\t\t\t\t$searchClause['general'] = 'lng!=0 AND lat!=0 '.$this->config['pid_list'];\n\n\t\t\t\t// just search the tables where search fields are specified\n\t\t\t\tif ($this->conf['search.']['fields.'][$table]) {\n\t\t\t\t\t$select = '*';\n\t\t\t\t\t$searchField = t3lib_div::trimExplode(',',$this->conf['search.']['fields.'][$table]);\n\t\t\t\t\t$where2 = '';\n\t\t\t\t\tforeach ($searchField as $key => $value) {\n\t\t\t\t\t\t$where2.= \" $value LIKE '%$searchExpression%' OR\";\n\t\t\t\t\t}\n\t\t\t\t\t$searchClause['text'] = ' ( ' . substr($where2, 0, -3) . ' ) ';\n\n\t\t\t\t\t// search only within the map area\n\t\t\t\t\tif ($searchForm['rggmOnMap'] == 'on') {\n\t\t\t\t\t\t$areaArr = $this->intExplode('%2C%20', $searchForm['rggmBound'], 1);\n\t\t\t\t\t\t$searchClause['maparea'] = ' lng between ' . $areaArr[1] . ' AND ' . $areaArr[3] . '\n\t\t\t\t\t\t\tAND\tlat between ' . $areaArr[0] . ' AND ' . $areaArr[2];\n\t\t\t\t\t}\n\n\t\t\t\t\t// radius search (umkreissuche)\n\t\t\t\t\tif ($searchForm['rggmActivateRadius'] == 'on') {\n\n\t\t\t\t\t\t// avoid multiple geocoding calls, just 1 is necessary\n\t\t\t\t\t\tif (count($coordinatesSaved) == 0) {\n\t\t\t\t\t\t\t$coordinates = $this->helperGeocodeAddress('', $searchForm['rggmZip'], '', $searchForm['rggmCountry']);\n\t\t\t\t\t\t\t$coordinatesSaved = $coordinates;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$coordinates = $coordinatesSaved;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if status is ok (200) and accuracy fits settings in TS\n\t\t\t\t\t\tif ($coordinates['status'] == 200 && (intval($coordinates['accuracy']) >= intval($this->conf['search.']['radiusSearch.']['minAccuracy']))) {\n\t\t\t\t\t\t\t$select = '*,SQRT(POW('.$coordinates['lng'].'-lng,2)*6400 + POW('.$coordinates['lat'].'-lat,2)*12100) AS distance';\n\t\t\t\t\t\t\t$searchClause['radius'] = ' SQRT(POW('.$coordinates['lng'].'-lng,2)*6400 + POW('.$coordinates['lat'].'-lat,2)*12100) <'.intval($searchForm['rggmRadius']);\n\t\t\t\t\t\t\t$orderBy = 'distance';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$searchClause['errorWithRadiusSearch'] = '1=2';\n\n\t\t\t\t\t\t\t// if status is ok, the accuracy failed\n\t\t\t\t\t\t\tif ($coordinates['status'] == 200) {\n\t\t\t\t\t\t\t\t$error['accuracy'] = $this->pi_getLL('search_error_geocode-accuracy');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$error['status'] = $this->pi_getLL('search_error_geocode-status-' . $coordinates['status']);\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// if a category is used, search for it\n\t\t\t\t\tif ($searchForm['rggmCat'] != '') {\n\t\t\t\t\t\t$catList = $this->intExplode(',', $searchForm['rggmCat']);\n\t\t\t\t\t\t$whereCat = '';\n\t\t\t\t\t\tforeach ($catList as $key => $value) {\n\t\t\t\t\t\t\t$whereCat .= ' FIND_IN_SET(' . $value . ',rggmcat) OR';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$searchClause['cat'] = ' ( ' . substr($whereCat, 0, -3) . ' ) ';\n\t\t\t\t\t}\n\n\t\t\t\t\t$limit = ''; // no limit, because this is done afterwards from the whole list\n\n\t\t\t\t\t// Adds hook for processing of extra search expressions\n\t\t\t\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraSearchHook'])) {\n\t\t\t\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraSearchHook'] as $_classRef) {\n\t\t\t\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t\t\t\t$searchClause = $_procObj->extraSearchProcessor($table, $searchClause, $orderBy, $limit, $error, $this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$where = implode(' AND ', $searchClause);\n\n\t\t\t\t\tif (count($error) == 0) {\n\t\t\t\t\t\t$res += $this->generic->exec_SELECTquery($select, $table, $where, $groupBy, $orderBy, $limit);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$debug[$table]['where'] = $where;\n\t\t\t}\n\n\t\t\tif (count($error) == 0) {\n\t\t\t\t// todo Limit\n\t\t\t\t$res = array_slice($res, 0, 99);\n\n\t\t\t\t/*\n\t\t\t\t * Create the output of the search\n\t\t\t\t */\n\t\t\t\t$i = 0;\n\n\t\t\t\t$jsResultUpdate = 'var bounds = new GLatLngBounds();';\n\t\t\t\t$debug['count'] = 0;\n\t\t\t\t$debug[$table]['res'] = $res;\n\n\t\t\t\t// run through the results\n\t\t\t\t$content_item = '';\n\t\t\t\twhile ($row = array_shift($res)) {\n\t\t\t\t\t$debug['count']++;\n\n\t\t\t\t\t// check if there is really no records with lng/lat = 0\n\t\t\t\t\tif (floatval($row['lat']) == 0 || floatval($row['lng']) == 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$markerArray = $this->getMarker($row, 'search.', $i);\n\n\t\t\t\t\t$markerArray['###SEARCHID###'] = $i + 1;\n\n\t\t\t\t\t\t// set the correct title\n\t\t\t\t\t$field = ($this->conf['title.']['useRggmTitle'] == 1) ? 'rggmtitle' : $this->conf['title.'][$table];\n\t\t\t\t\t$title = ($this->cObj2->stdWrap(htmlspecialchars($row[$field]), $this->conf['title.']['searchresult.']));\n\t\t\t\t\t$title = str_replace('\\'', '\"', $title);\n\n\t\t\t\t\t// icon for the map\n\t\t\t\t\t$icon = 'marker'. ($i + 1) . '.png';\n\n\t\t\t\t\t// JS which displayes the search markers\n\t\t\t\t\t$jsResultUpdate .= '\n\t\t\t\t\t\tmarker = createMarker(new GLatLng(' . $row['lat'] . ',' . $row['lng'] . '), ' . $row['uid'] . ', \\'' . $icon . '\\', \\'' . $title . '\\', \\'' . $row['table'] . '\\', 1);\n\n\t\t\t\t\t\tmap.addOverlay(marker);\n\t\t\t\t\t\tsearchresultmarkers[' . $i . '] = marker;\n\t\t\t\t\t\tbounds.extend(new GLatLng(' . $row['lat'] . ',' . $row['lng'] . '));\n\t\t\t\t\t';\n\n\t\t\t\t\t$i++;\n\n\t\t\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($template['item'], $markerArray, array(), $wrappedSubpartArray);\n\t\t\t\t}\n\n\t\t\t\t$jsResultUpdate .= $test;\n\n\t\t\t\t$markerArray['###SEARCHEXPRESSION###'] = $searchForm['rggmsearchValue'];\n\t\t\t\t$markerArray['###SEARCHCOUNT###'] = $i;\n\n\t\t\t\t$subpartArray['###CONTENT###'] = $content_item;\n\n\t\t\t\t$jsResultUpdate .= '\n\t\t\t\t\tvar zoom=map.getBoundsZoomLevel(bounds);\n\n\t\t\t\t\tvar centerLat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) /2;\n\t\t\t\t\tvar centerLng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) /2;\n\t\t\t\t\tmap.setCenter(new GLatLng(centerLat,centerLng),zoom);\n\t\t\t\t';\n\n\t\t\t\t// Nothing found\n\t\t\t\tif ($i ==0) {\n\t\t\t\t\t$subpartArray['###CONTENT###'] = $this->pi_getLL('searchNoResult');\n\t\t\t\t\t$jsResultUpdate = '';\n\t\t\t\t}\n\n\t\t\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray, $wrappedSubpartArray);\n\t\t\t}\n\n\t\t\t$debugOut = 0;\n\t\t\tif ($debugOut == 1) {\n\t\t\t\t$content = t3lib_div::view_array($debug) . $content;\n\t\t\t}\n\n\t\t// minimum character length not reached\n\t\t} else {\n\t\t\t$error['minChars'] = sprintf($this->pi_getLL('searchMinChars'), $this->conf['search.']['minChars']);\n\t\t\t$objResponse->addAssign('searchFormError', 'innerHTML', $content);\n\t\t}\n\n\t\t// if any errors are found, load the error template\n\t\tif (count($error) > 0) {\n\t\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_SEARCH_RESULTS_ERROR###');\n\t\t\t$template['item'] = $this->cObj->getSubpart( $template['list'], '###SINGLE###');\n\n\t\t\tforeach ($error as $key) {\n\t\t\t\t$markerArray['###ERROR###'] = $key;\n\t\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($template['item'], $markerArray);\n\t\t\t}\n\t\t\t$subpartArray['###CONTENT###'] = $content_item;\n\n\t\t\t$markerArray['###LL_HEADER###'] = $this->pi_getLL('search_error_header');\n\n\t\t\t$content .= $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\t}\n\n\t\t$objResponse->addScript($this->cObj->stdWrap($jsResultDelete, $smallConf['modify.']['deleteJS.']));\n\t\t$objResponse->addAssign('searchFormResult', 'innerHTML', $content);\n\t\t$objResponse->addScript($this->cObj->stdWrap($jsResultUpdate, $smallConf['modify.']['updateJS.']));\n\n\t\treturn $objResponse->getXML();\n\t}\n\n\n\t/**\n\t * Shows all records which are visible on the map (not all which are available through selected categories!)\n\t *\n\t * @param\tstring\t\t$area: the area of the map\n\t * @return all available (=visible) records\n\t */\n\tfunction ajaxGetActiveRecords($area, $cat)\t{\n\t\t// template\n\t\t$template['allrecords'] = $this->cObj2->getSubpart($this->templateCode, '###TEMPLATE_ACTIVERECORDS###');\n\t\t$template['item'] = $this->cObj2->getSubpart( $template['allrecords'], '###SINGLE###');\n\t\t$smallConf = $this->conf['recordsOnMap.'];\n\n\t\t// language markers\n\t\t$languageMarkers = $this->helperGetLLMarkers(array(), $smallConf['LL'], 'recordsonmap');\n\n\t\t// query\n\t\t$table = $this->config['tables'];\n\t\t$field = '*';\n\t\t$where = $this->helperGetAvailableRecords($cat, $area);\n\t\t$orderBy = $smallConf['orderBy'];\n\t\t$limit = $smallConf['limit'];\n\t\t$res = $this->generic->exec_SELECTquery($field, $table, $where, '', $orderBy, $limit);\n\n\t\t$content_item = '';\n\t\twhile ($row = array_shift($res)) {\n\t\t\t$markerArray = $this->getMarker($row, 'recordsOnMap.', $i);\n\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($template['item'], $markerArray, array(), $wrappedSubpartArray);\n\t\t}\n\n\t\t$subpartArray['###CONTENT###'] = $content_item;\n\n\t\t$markerArray = $languageMarkers;\n\t\t$content = $this->cObj2->substituteMarkerArrayCached($template['allrecords'], $markerArray, $subpartArray);\n\n\t\t$objResponse = new tx_xajax_response($GLOBALS['TSFE']->metaCharset);\n\t\t$objResponse->addAssign('rggooglemap-recordsonmap', 'innerHTML', $content);\n\n\t\treturn $objResponse->getXML();\n\t}\n\n\t/**\n\t * Initialize the map and all of its needed JS\n\t *\n\t * @return\tvoid\n\t */\n\tfunction initMap() {\n\n\t\t// Instantiate the xajax object and configure it\n\t\trequire_once (t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php');\n\t\t$this->xajax = t3lib_div::makeInstance('tx_xajax'); // Make the instance\n\t\tif ($GLOBALS['TSFE']->metaCharset == 'utf-8') {\n\t\t\t$this->xajax->decodeUTF8InputOn(); // Decode form vars from utf8\n\t\t}\n\t\t$this->xajax->setCharEncoding($GLOBALS['TSFE']->metaCharset); \t\t// Encode of the response to utf-8 ???\n\t\t$this->xajax->setWrapperPrefix($this->prefixId); \t\t// To prevent conflicts, prepend the extension prefix\n\t\t$this->xajax->statusMessagesOn(); \t\t// Do you wnat messages in the status bar?\n\n\t\t// register the functions of the ajax requests\n\t\t$this->xajax->registerFunction(array('infomsg', &$this, 'ajaxGetInfomsg'));\n\t\t$this->xajax->registerFunction(array('activeRecords', &$this, 'ajaxGetActiveRecords'));\n\t\t$this->xajax->registerFunction(array('processCat', &$this, 'ajaxProcessCat'));\n\t\t$this->xajax->registerFunction(array('tab', &$this, 'ajaxGetPoiTab'));\n\t\t$this->xajax->registerFunction(array('search', &$this, 'ajaxSearch'));\n\t\t$this->xajax->registerFunction(array('processCatTree', &$this, 'ajaxProcessCatTree'));\n\t\t$this->xajax->registerFunction(array('getDynamicList', &$this, 'ajaxGetDynamicList'));\n\n\t\t$this->xajax->processRequests();\n\n\t\t// additional output using a template\n\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode,'###HEADER###');\n\t\t$markerArray = $subpartArray = array();\n\t\t$markerArray['###PATH###'] = t3lib_extMgm::siteRelpath('rggooglemap');\n\n\t\tif ($this->conf['map.']['addLanguage'] == 1) {\n\t\t\tif ($this->conf['map.']['addLanguage.']['override'] != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $this->conf['map.']['addLanguage.']['override'];\n\t\t\t} elseif ($GLOBALS['TSFE']->lang != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $GLOBALS['TSFE']->lang;\n\t\t\t}\n\t\t}\n\n\t\t$markerArray['###DYNAMIC_JS###'] = $this->getJs();\n\n\t\t// load spefic files if needed for clustering\n\t\tif ($this->conf['map.']['activateCluster'] == 1) { // gxmarkers\n\t\t\t$subpartArray['###CLUSTER_2###'] = '';\n\n\t\t} elseif ($this->conf['map.']['activateCluster'] == 2) { // markerclusterer\n\t\t\t$subpartArray['###CLUSTER_1###'] = '';\n\t\t} else { // no clustering\n\t\t\t$subpartArray['###CLUSTER_1###'] = $subpartArray['###CLUSTER_2###'] = '';\n\t\t}\n\n\t\t$totalJS = $this->cObj2->substituteMarkerArrayCached($template['total'],$markerArray, $subpartArray);\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_xajax'] = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax'));\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_js'] = $totalJS;\n\t}\n\n\t/**\n\t * Load the info message popup window\n\t *\n\t * @param\tstring\t$uid: id of reocord\n\t * @param\tstring\t$table: table of record\n\t * @param int\t$prefix: Prefix for tabs in info window\n\t * @return\tThe content of the info window\n\t */\n\tfunction ajaxGetInfomsg($uid, $table, $tmplPrefix = 1) {\n\t\t$template['infobox'] = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_INFOBOX_' . $tmplPrefix . '###');\n\n\t\t// query for single record\n\t\t$field = '*';\n\t\t$where = 'uid = ' . intval($uid);\n\t\t$res = $this->generic->exec_SELECTquery($field, $table, $where);\n\t\t$row = array_shift($res);\n\n\t\t$markerArray = $this->getMarker($row, 'popup.');\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['infobox'], $markerArray);\n\n\t\t$objResponse = new tx_xajax_response($GLOBALS['TSFE']->metaCharset);\n\t\t$objResponse->addAssign('infobox', 'innerHTML', $content);\n\n\t\treturn $objResponse->getXML();\n\t}\n\n\t/**\n\t * Creates the result records\n\t *\n\t * @param\tstring\t$catList: list of categories\n\t * @param\tstring\t$page: page to display\n\t * @return\tHtml $currentPage List\n\t */\n\tfunction getDynamicList($catList, $currentPage) {\n\t\t$content = '';\n\t\t$smallConf = $this->conf['recordList.'];\n\t\t$currentPage = intval($currentPage);\n\n\t\t// no result if no categories selected\n\t\tif ($catList == '') {\n\t\t\treturn $content;\n\t\t}\n\n\t\t// template\n\t\t$template['all'] = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_RECORDLIST###');\n\t\t$template['item'] = $this->cObj->getSubpart($template['all'], '###SINGLE###');\n\t\t$markerArray = $subpartArray = $wrappedSubpartArray = array();\n\n\t\t// general query parts\n\t\t$field = '*';\n\t\t$table = $this->config['tables'];\n\t\t$where = $this->helperGetAvailableRecords($catList);\n\t\t$limit = ($currentPage * $smallConf['limit']) . ',' . $smallConf['limit'];\n\n\t\t// count\n\t\t$maxRecords = $this->generic->exec_COUNTquery($table, $where);\n\t\t$maxPages = ceil($maxRecords / $smallConf['limit']);\n\t\t$max = ($smallConf['limit'] >= $maxRecords) ? $maxRecords : ($currentPage*$smallConf['limit'] + $smallConf['limit']);\n\n\t\t// query for the results\n\t\t$i = 0;\n\t\t$res = $this->generic->exec_SELECTquery($field, $table, $where, $groupBy, $smallConf['orderBy'], $limit);\n\t\twhile ($row = array_shift($res)) {\n\t\t\t$markerArray = $this->getMarker($row, 'recordList.', $i);\n\t\t\t$i++;\n\n\t\t\t$content_item = $this->cObj->substituteMarkerArrayCached($template['item'], $markerArray);\n\t\t}\n\t\t$subpartArray['###CONTENT###'] = $content_item;\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $smallConf['LL'], 'recordlist');\n\n\t\t/*\n\t\t * Pagebrowser\n\t\t */\n\t\t// general text (Record x - y from z)\n\t\t$markerArray['###PB_STATISTIC###'] = sprintf(\n\t\t\t$this->pi_getLL('pagebrowser'),\n\t\t\t$currentPage*$smallConf['limit'] + 1,\n\t\t\t$max,\n\t\t\t$maxRecords\n\t\t);\n\n\t\t// current page (Page x)\n\t\t$markerArray['###PB_ACT###'] = sprintf(\n\t\t\t$this->pi_getLL('pagebrowser_act'),\n\t\t\t$currentPage + 1\n\t\t);\n\n\t\t// previous page\n\t\tif ($currentPage > 0) {\n\t\t\t$pb = ' onClick=\"' . $this->prefixId . 'getDynamicList(\\'' . $catList . '\\',' . ($currentPage - 1) . ')\" ';\n\t\t\t$wrappedSubpartArray['###PB_PREV###'] = explode('|', '<a href=\"javascript:void(0);\"' . $pb . '>|</a>');\n\t\t} else {\n\t\t\t$subpartArray['###HIDE_PREV###'] = ' ';\n\t\t}\n\n\t\t// next page\n\t\tif ($currentPage + 1 < $maxPages) {\n\t\t\t$pb = ' onClick=\"' . $this->prefixId . 'getDynamicList(\\'' . $catList . '\\',' . ($currentPage + 1) . ')\" ';\n\t\t\t$wrappedSubpartArray['###PB_NEXT###'] = explode('|', '<a href=\"javascript:void(0);\"' . $pb . '>|</a>');\n\t\t} else {\n\t\t\t$subpartArray['###HIDE_NEXT###'] = 'x';\n\t\t}\n\n\t\t$content.= $this->cObj->substituteMarkerArrayCached($template['all'], $markerArray, $subpartArray, $wrappedSubpartArray);\n\n\t\treturn $content;\n\t}\n\n\t/**\n\t * Creates the result records for the first page\n\t *\n\t * @param\tarray\t$data: selected checboxes\n\t * @return\tResult records including the pagebrowser for the 1st result page\n\t */\n\tfunction ajaxProcessCat($data, $page=1)\t{\n\t\t$objResponse = new tx_xajax_response($GLOBALS['TSFE']->metaCharset);\n\n\t\tif (is_Array($data['cb'])){\n\t\t\t$objResponse->addAssign('mapcatlist', 'innerHTML', implode(',', $data['cb']));\n\t\t} else {\n\t\t\t$objResponse->addAssign('mapcatlist', 'innerHTML', '9999');\n\t\t}\n\n\t\t// if the dynamic List is needed\n\t\tif ($this->config['loadDynamicList'] == 1) {\n\t\t\t$objResponse->addAssign('formResult', 'innerHTML',$this->getDynamicList($this->intExplode(',', $data['cb']), 0));\n\t\t}\n\n\t\treturn $objResponse->getXML();\n\t}\n\n\t/**\n\t * Ajax wrapper function which calles the \"real\" list function\n\t *\n\t * @param\tstring\t$catList: list of categories\n\t * @param\tstring\t$page: page to display\n\t * @return\tHtml Dynamix List\n\t */\n\tfunction ajaxGetDynamicList($catList, $page) {\n\t\t$objResponse = new tx_xajax_response($GLOBALS['TSFE']->metaCharset);\n\t\t$content = $this->getDynamicList($catList, $page);\n\n\t\t$objResponse->addAssign('formResult', 'innerHTML', $content);\n\t\t//$objResponse->addScript('setTimeout(\"fdTableSort.init()\", 1000);');\n\t\treturn $objResponse->getXML();\n\t}\n\n\t/**\n\t * Modifies the menu output with including the cateory selection\n\t *\n\t * @param\tarray\t$data: selected checboxes\n\t * @return\tResult records\n\t */\n\tfunction ajaxProcessCatTree($data) {\n\t\t$content = $this->showMenu($data['cb']);\n\n\t\t$objResponse = new tx_xajax_response($GLOBALS['TSFE']->metaCharset);\n\t\t$objResponse->addAssign('rggooglemap-menu', 'innerHTML', $content);\n\n\t\treturn $objResponse->getXML();\n\t}\n\n\t/**\n\t * Creates the categorymenu\n\t *\n\t * @param\tint\t$id: parent_id for the recursive function\n\t * @return\tcategorymenu with parent_id = $id\n\t */\n\tfunction displayCatMenu($id = 0, $level = 0) {\n\t\t$level++;\n\t\t$i = 0;\n\n\t\t// actived checkbox for selected category\n\t\t$checkedBox = t3lib_div::trimExplode(',', $this->config['categoriesActive']);\n\n\t\t// template\n\t\tif ($this->config['menu-categorytree'] == 0) {\n\t\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode, '###TEMPLATE_CATMENU###');\n\t\t} else {\n\t\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode, '###TEMPLATE_CATMENU_TREE###');\n\t\t}\n\t\t$template['item'] = $this->cObj2->getSubpart($template['total'], '###SINGLE###');\n\n\t\t// query\n\t\t$table = 'tx_rggooglemap_cat';\n\t\t$field = '*';\n\t\t$where = 'hidden= 0 AND deleted = 0 AND parent_uid = ' . $id;\n\t\tif ($this->config['categories'] != '') {\n\t\t\t$where .= ' AND uid IN(' . $this->config['categories'] . ')';\n\t\t}\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field, $table, $where);\n\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t$i++;\n\n\t\t\t$markerArray = $this->getMarker($row, 'catMenu.', $i);\n\n\t\t\t// category image\n\t\t\t$imgTSConfig = $this->conf['catMenu.']['icon.'];\n\t\t\t$imgTSConfig['file'] = 'uploads/tx_rggooglemap/' . $row['image'];\n\t\t\t$markerArray['###ICON###'] = $this->cObj2->IMAGE($imgTSConfig);\n\n\t\t\t$markerArray['###CHECKED###'] = (in_array($row['uid'], $checkedBox)) ? ' checked =\"checked\" ' : '';\n\t\t\t$markerArray['###RECURSIVE###'] = $this->displayCatMenu($row['uid']);\n\n\t\t\tif ($markerArray['###RECURSIVE###'] != '') {\n\t\t\t\t// todo\n\t#\t\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode,'###TEMPLATE_CATMENU_NOCHECKBOX###');\n\t\t\t}\n\n\t\t\t$content_item .= $this->cObj2->substituteMarkerArrayCached($template['item'], $markerArray);\n\t\t}\n\n\t\t$subpartArray['###CONTENT###'] = $content_item;\n\n\t\t// general markers\n\t\t$markerArray['###LEVEL###'] = $level;\n\t\t$markerArray['###FIRST_LEVEL###'] = ($id == 0) ? ' id=\"rggmmenulvl1\" ' : '';\n\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\n\n\t\tif ($i > 0) {\n\t\t\t$content = $this->cObj->substituteMarkerArrayCached($template['total'], $markerArray, $subpartArray);\n\t\t} else {\n\t\t\t$content = '';\n\t\t}\n\n\t\treturn $content;\n\t}\n\n\t/**\n\t * Creates the javascript which needs to be build dynamically\n\t *\n\t * @return\tall the js\n\t */\n\tfunction getJs () {\n // some settings for controlling\n\n\t\t// map type\n\t\t$markerArray['###MAP_TYPE_MAPNIK###'] = $markerArray['###MAP_TYPE_TAH###'] = 0;\n\t\tif ($this->config['mapType'] != '') {\n\t\t\t// mapnik typoe\n\t\t\tif (strpos($this->config['mapType'], 'MAPNIK') !== FALSE) {\n\t\t\t\t$this->config['mapType'] = t3lib_div::rmFromList('MAPNIK', $this->config['mapType']);\n\t\t\t\t$markerArray['###MAP_TYPE_MAPNIK###'] = 1;\n\t\t\t\t$markerArray['###MAP_TYPE_MAPNIK_TITLE###'] = $this->conf['map.']['mapnik_title'];\n\t\t\t}\n\t\t\t// tiles@home typoe\n\t\t\tif (strpos($this->config['mapType'], 'TAH') !== FALSE) {\n\t\t\t\t$this->config['mapType'] = t3lib_div::rmFromList('TAH', $this->config['mapType']);\n\t\t\t\t$markerArray['###MAP_TYPE_TAH###'] = 1;\n\t\t\t\t$markerArray['###MAP_TYPE_TAH_TITLE###'] = $this->conf['map.']['tah_title'];\n\t\t\t}\n\n\t\t\t// check again because could be that mapnik / TAH are the only one selected\n\t\t\tif ($this->config['mapType'] == '') {\n\t\t\t\t$this->config['mapType'] = 'G_NORMAL_MAP';\n\t\t\t}\n\n\t\t\t$markerArray['###MAP_TYPES###'] = ',{mapTypes:[' . $this->config['mapType'] . ']}';\n\n\t\t}\n\n\t\tswitch ($this->config['mapNavControl']) {\n\t\t\tcase 'small':\n\t\t\tcase 1:\n\t\t\t\t$settings = 'map.addControl(new GSmallMapControl());';\n\t\t\t\tbreak;\n\t\t\tcase 'large':\n\t\t\tcase 2:\n\t\t\t\t$settings = 'map.addControl(new GLargeMapControl());';\n\t\t\t\tbreak;\n\t\t}\n\t\tif ($this->config['mapTypeControl'] == 'show' || $this->config['mapTypeControl'] == '1') {\n\t\t\t$settings .= 'map.addControl(new GMapTypeControl());';\n\t\t}\n\t\tif ($this->config['mapOverview'] == 1) {\n\t\t\t$settings .= 'map.addControl(new GOverviewMapControl());';\n\t\t}\n\n\t\tif ($this->config['mapControlOnMouseOver'] == 1) {\n\t\t\t$hideControlsOnMouseOut = 'map.hideControls();\n\t\t\t\tGEvent.addListener(map, \"mouseover\", function(){\n\t\t\t\tmap.showControls();\n\t\t\t\t});\n\t\t\t\tGEvent.addListener(map, \"mouseout\", function(){\n\t\t\t\tmap.hideControls();\n\t\t\t\t});';\n\t\t}\n\t\tif ($this->conf['enableDoubleClickZoom'] == 1) {\n\t\t\t$settings .= 'map.enableDoubleClickZoom();';\n\t\t}\n\t\tif ($this->conf['enableContinuousZoom'] == 1) {\n\t\t\t$settings .= 'map.enableContinuousZoom();';\n\t\t}\n\t\tif ($this->conf['enableScrollWheelZoom'] == 1) {\n\t\t\t$settings .= 'map.enableScrollWheelZoom();';\n\t\t}\n\n\t\t// urls\n\t\t$xmlUrlConf = $this->conf['xmlURL.'];\n\n\t\t\t// disable realurl for the xml url\n\t\t$realurlTmp = $GLOBALS['TSFE']->config['config']['tx_realurl_enable'];\n\t\t$GLOBALS['TSFE']->config['config']['tx_realurl_enable'] = 0;\n\t\t$url = $this->cObj2->typolink('', $xmlUrlConf);\n\t\t$GLOBALS['TSFE']->config['config']['tx_realurl_enable'] = $realurlTmp;\n\n\n\n\t\t$urlForIcons = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'uploads/tx_rggooglemap/';\n\t\t$urlExt = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . t3lib_extMgm::siteRelpath('rggooglemap');\n\n\t\t// records for the selected categories\n\t\tif ($this->config['categoriesActive'] != '') {\n\t\t\t$selectedCat = 'var cat = new Array();\n\t\t\tcat[\"cb\"] = new Object();';\n\t\t\t$cats = t3lib_div::trimExplode(',', $this->config['categoriesActive']);\n\t\t\tforeach ($cats as $key => $value) {\n\t\t\t\t$selectedCat .= 'cat[\"cb\"]['.$value.'] = ' . $value . ';';\n\t\t\t}\n\t\t\t$selectedCat .= ' tx_rggooglemap_pi1processCat(cat);';\n\t\t} else {\n\t\t\t$selectedCat = ' tx_rggooglemap_pi1processCat(\"default\");';\n\t\t}\n\n\t\t// use cluster, default = 0\n\t\tswitch ($this->conf['map.']['activateCluster']) {\n\t\t\tcase 1:\n\t\t\t\t$addMarker = 'clusterer.AddMarker(marker,title);';\n\t\t\t\t$markerArray['###MAP_CLUSTER###'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$addMarker = 'map.addOverlay( marker );';\n\t\t\t\t$markerArray['###MAP_CLUSTER###'] = 2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$addMarker = 'map.addOverlay( marker );';\n\t\t\t\t$markerArray['###MAP_CLUSTER###'] = 0;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$markerArray['###HIDECONTROLSMOUSEOUT###'] = $hideControlsOnMouseOut;\n\t\t$markerArray['###POI_ON_START###'] = $this->getPoiOnStart();\n\t\t$markerArray['###SETTINGS###'] = $settings;\n\t\t$markerArray['###MAP_ZOOM###'] = $this->config['mapZoom'];\n\t\t$markerArray['###MAP_LNG###'] = $this->config['mapLng'];\n\t\t$markerArray['###MAP_LAT###'] = $this->config['mapLat'];\n\t\t$markerArray['###MAP_DIV###'] = $this->config['mapDiv'];\n\t\t$markerArray['###SELECTED_CAT###'] = $selectedCat;\n\t\t$markerArray['###ADD_MARKER###'] = $addMarker;\n\t\t$markerArray['###URL_ICONS###'] = $urlForIcons;\n\t\t$markerArray['###URL###'] = $url;\n\t\t$markerArray['###BOUNDS###'] = intval($this->config['useBoundsOnStart']);\n\t\t$markerArray['###DEBUG###'] = ($this->conf['map.']['debug']==1) ? '' : '//';\n\n\t\t// get coordinates from user's browser\n\t\t$markerArray['###USE_USER_LOCATION###'] = intval($this->conf['map.']['useUserLocationForMapCenter']) == 1 ? 1 : 0;\n\t\t$markerArray['###USE_USER_LOCATION_ZOOMLEVEL###'] = intval($this->conf['map.']['useUserLocationForMapCenter.']['zoomLevel']) == 0 ? 0 : intval($this->conf['map.']['useUserLocationForMapCenter.']['zoomLevel']);\n\n\t\t// create the gicons JS, needed for valid sizes, don't trust JS on that...\n\t\t$gicon = '';\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,image', 'tx_rggooglemap_cat', 'hidden=0 AND deleted=0');\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\n\t\t\t// set the correct paths if no icon is found\n\t\t\tif ($row['image'] == '') {\n\t\t\t\t$iconPath = $this->conf['map.']['defaultIcon'];\n\t\t\t\t$iconPathJS\t= t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $this->conf['map.']['defaultIcon'];\n\t\t\t} else {\n\t\t\t\t$iconPath = 'uploads/tx_rggooglemap/' . $row['image'];\n\t\t\t\t$iconPathJS\t= $urlForIcons.$row['image'];\n\t\t\t}\n\n\t\t\t$iconSize = @getimagesize($iconPath);\n\n\t\t\t// If icon size can't be get with php, use settings from TS\n\t\t\tif (!is_array($iconSize)) {\n\t\t\t\t$iconSizeConf = $this->conf['map.']['iconSize.'];\n\n\t\t\t\t$current = $row['uid'] . '.';\n\t\t\t\t$width = (intval($iconSizeConf[$current]['width']) > 0) ? intval($iconSizeConf[$current]['width']) : intval($iconSizeConf['default.']['width']);\n\t\t\t\t$height = (intval($iconSizeConf[$current]['height']) > 0) ? intval($iconSizeConf[$current]['height']) : intval($iconSizeConf['default.']['height']);\n\t\t\t} else {\n\t\t\t\t$width = $iconSize[0];\n\t\t\t\t$height = $iconSize[1];\n\t\t\t}\n\n\t\t\t$key = 'gicons[' . $row['uid'] . ']';\n\t\t\t$gicon .= $key . '= new GIcon(baseIcon);' . chr(10);\n\t\t\t$gicon .= $key . '.image = \"'.$iconPathJS.'\";' . chr(10);\n\t\t\t$gicon .= $key . '.iconSize = new GSize('.$width.', '.$height.');' . chr(10);\n\t\t\t$gicon .= $key . '.iconAnchor = new GPoint(' . ($width / 2) . ', ' . ($height / 2) . ');' . chr(10);\n\t\t\t$gicon .= $key . '.infoWindowAnchor = new GPoint(' . ($width / 2) . ', ' . ($height / 2) . ');' . chr(10) . chr(10);\n\t\t}\n\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\n\t\t$markerArray['###GICONS###'] = $gicon;\n\n\t\tif ($this->conf['map.']['activateCluster'] == 3) {\n\t\t\t$icon = str_replace('###CURRENT_URL###', t3lib_div::getIndpEnv('TYPO3_SITE_URL'), $this->conf['map.']['activateCluster.']['3.']['icon']);\n\t\t\t$markerArray['###GICONS###'].= $icon;\n\t\t}\n\n\t\t\t// Hook for adding client-processing code for the additional datasets which were generated within method getJs()\n\t\t$markerArray['###PROCESS_DATASETS###'] = '';\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['datasetHook'])) {\n\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['datasetHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t\t// Test if method exists as it might make sense not creating it for each corresponding hook entry\n\t\t\t\tif (method_exists($_procObj, 'getDatasetJSProcessing')) {\n\t\t\t\t\t$markerArray['###PROCESS_DATASETS###'] .= $_procObj->getDatasetJSProcessing($this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\t// Hook for processing of extra javascript\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraGetJsHook'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraGetJsHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$markerArray = $_procObj->extraGetJsProcessor($markerArray, $this);\n\t\t\t}\n\t\t}\n\n\t\t$jsTemplateCode = $this->cObj2->fileResource($this->conf['templateFileJS']);\n\t\t$template['all'] = $this->cObj2->getSubpart($jsTemplateCode, '###ALL###');\n\n\t\t$js = $this->cObj2->substituteMarkerArrayCached($template['all'], $markerArray);\n\n\t\treturn $js;\n\t}\n\n\t/**\n\t * Get the correct JS to show a poi after loading the page.\n\t * Tablename + uid can come from piVars or Flexform/TS\n\t *\n\t * @param\tint\t\t$id: the id of the record\n\t * @param\tint\t\t$tan: the id of the tab which should get filled (every tab has got an own template)\n\t * @param\tstring\t\t$tbl: the table name\n * @return the content\n\t */\n\tfunction getPoiOnStart() {\n\t\t$showPOIonStart = '';\n\n\t\t// pivars overrules flexform/ts\n\t\t$defaultPOI = ($this->piVars['poi']!='') ? $this->piVars['poi'] : $this->config['mapShowOnDefault'];\n\t\t$table = $this->conf['defaultTable']; // default table\n\n\t\tif ($defaultPOI!='') {\n\t\t\t// split it up by using '-' to get a possible table\n\t\t\t$split = t3lib_div::trimExplode('-', $defaultPOI);\n\n\t\t\tif (count($split)==1) {\n\t\t\t\t$uid\t\t= $split[0];\n\n\t\t\t\tif (!empty($this->piVars['table']) && t3lib_div::inList($this->config['tables'], $this->piVars['table'])) {\n\t\t\t\t\t$table = $this->piVars['table'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$table\t= $split[0];\n\t\t\t\t$uid\t\t= $split[1];\n\t\t\t}\n\n\t\t\t$uid = intval($uid);\n\n\t\t\t// fetch coords for this record\n\t\t\tif ($uid > 0) {\n\t\t\t\t$where = 'uid = '.$uid.' AND '.$this->helperGetAvailableRecords($this->config['categories']);\n\t\t\t\t$res = $this->generic->exec_SELECTquery('uid, lng, lat',$table,$where,$groupBy,$orderBy,$offset);\n\t\t\t\t$row=array_shift($res);\n\n\t\t\t\tif (floatval($row['lng'])!=0 && floatval($row['lat'])!=0) {\n\t\t\t\t\t$showPOIonStart = 'myclick('.$row['uid'].','.$row['lng'].','.$row['lat'].',\"'.$table.'\");';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $showPOIonStart;\n\t}\n\n\n\t/**\n\t * Ajax call for the function getPoiContent\n\t *\n\t * @param\tint\t\t$var: the id of the record\n\t * @param\tint\t\t$tan: the id of the tab which should get filled (every tab has got an own template)\n\t * @return the content\n\t */\n\tfunction ajaxGetPoiTab($id,$tab,$table)\t{\n\t\t$content = $this->getPoiContent($id,$tab, $table);\n\n\t\t$objResponse = new tx_xajax_response($GLOBALS['TSFE']->metaCharset);\n\t\t$objResponse->addAssign('poi', 'innerHTML', $content);\n\t\treturn $objResponse->getXML();\n\t}\n\n\n\t/**\n\t * Shows the content of a POI bubble\n\t *\n\t * @param\tint\t\t$id: the id of the record\n\t * @param\tint\t\t$tan: the id of the tab which should get filled (every tab has got an own template)\n\t * @param\tstring\t\t$tbl: the table name\n * @return the content\n\t */\n\tfunction getPoiContent($id,$tab,$table) {\n\t\t$id\t\t= intval($id);\n\t\t$tab\t= intval($tab);\n\n\t\t// check if all params are valid\n\t\tif (!t3lib_div::inList($this->config['tables'], $table) || $tab==0 || $id==0) {\n\t\t\treturn sprintf($this->pi_getLL('error_poi-no-valid-params'), $table, $id, $tab);\n\t\t}\n\n\t\t// query for single record\n\t\t$field = '*';\n\t\t$where = 'uid = '.$id;\n\t\t$res = $this->generic->exec_SELECTquery($field,$table,$where,$groupBy='',$orderBy,$offset='');\n\t\t$row=array_shift($res);\n\n\n\t\t$markerArray = $this->getMarker($row, 'poi.');\n\n\t\t$tablePrefix = '_'.strtoupper($table);\n\n \t\t// get the correct template subpart\n\t\t$template['all'] = $this->cObj2->getSubpart($this->templateCode,'###TEMPLATE_INFOPOI'.$tablePrefix.$markerArray['###TABPREFIX###'].'_'.$tab.'###');\n\n\t\t// check if subpart is defined, if not, print out an error which will help to find correct syntax of subpart\n\t\tif ($template['all']=='') {\n\t\t\t$content = sprintf($this->pi_getLL('error_poi-no-template'), '###TEMPLATE_INFOPOI'.$tablePrefix.$markerArray['###TABPREFIX###'].'_'.$tab.'###');\n\t\t} else {\n\t\t\t// having the tablename in every record available\n\t\t\t$markerArray['###TABLE###'] = $table;\n\n\t\t\t$content = $this->cObj2->substituteMarkerArrayCached($template['all'],$markerArray, $subpartArray,$wrappedSubpartArray);\n\t\t}\n\n\t\treturn $content;\n\t}\n\n\n\t/**\n\t * Fills the markerArray with all needed markers\n\t *\n\t * @param\tArray\t\t$row: row of the db query\n\t * @param\tstring\t$prefix: prefix needed for the stdwrap functions\n\t * @param\tinteger\t\t$oddEven: item number to set a odd/even class\n\t * @return the marker array\n\t */\n\tfunction getMarker($row, $prefix, $oddEven=0) {\n\t\t$prefixWithoutDot = trim($prefix, '.');\n\n\t\t// language setting\n\t\tif ($GLOBALS['TSFE']->sys_language_content && $this->conf['getRecordOverlay'] == 1) {\n\t\t\t$OLmode = ($this->sys_language_mode == 'strict'?'hideNonTranslated':'');\n\t\t\t$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($row['table'], $row, $GLOBALS['TSFE']->sys_language_content, $OLmode);\n\t\t}\n\n\t\t// Adds hook for processing of the single record\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraItemPreRowHook'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraItemPreRowHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$row = $_procObj->extraItemPreRowProcessor($row, $this);\n\t\t\t}\n\t\t}\n\n\t\t// general stdWrap handling\n\t\t$short = $this->conf[$prefix][$row['table'].'.'];\n\t\tforeach ($row as $key=>$value) {\n\t\t\t$this->cObj2->data[$key]=$value;\n\t\t\t$output = $this->cObj2->stdWrap($value,$short[$key.'.']);\n\t\t\t$markerArray['###'.strtoupper($key).'###'] = (!isset($short[$key.'.']['htmlSpecialChars']) || $short[$key.'.']['htmlSpecialChars'] != 0) ? htmlspecialchars($output) : $output;\n\t\t}\n\n\t\t$markerArray['###POPUP###'] = ' onClick=\\' show(\"infobox\"); ' . $this->prefixId . 'infomsg('.$row['uid'].', \"'.$row['table'].'\"); \\' ';\n\t\t$markerArray['###PREFIX###'] = $prefix;\n\n\t\t// general odd/even to avoid this in every function\n\t\tif ($oddEven != 0) {\n\t\t\t$markerArray['###ODD_EVEN###'] = ($oddEven%2 == 0) ? 'odd' : 'even';\n\t\t} else {\n\t\t\t$markerArray['###ODD_EVEN###'] = '';\n\t\t}\n\n\n\t\t// get the prefix from the 1st category record for the record\n\t\tif ($row['rggmcat']) {\n\t\t\t$catIds = explode(',',$row['rggmcat']);\n\n\t\t\t$resPrefix = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tabprefix','tx_rggooglemap_cat','uid = '.$catIds[0]);\n\t\t\t$rowPrefix = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resPrefix);\n\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($resPrefix);\n\t\t\t$rowPrefix['tabprefix'] = str_replace(' ', '', $rowPrefix['tabprefix']); // avoid any blanks\n\t\t\t$markerArray['###TABPREFIX###'] = ($rowPrefix['tabprefix']) ? '_'.$rowPrefix['tabprefix'] : '';\n\t\t} else {\n\t\t\t$markerArray['###TABPREFIX###'] = '';\n\t\t}\n\n\t\t// generic markers\n\t\t$short = $this->conf[$prefix][$row['table'].'.']['generic.'];\n\t\tif (is_array($short)) {\n\t\t\tforeach($short as $key=>$value) {\n\t\t\t\t$key2 = trim($key, '.');\n\t\t\t\t$markerArray['###GENERIC_'.strtoupper($key2).'###'] = $this->cObj2->cObjGetSingle($short[$key2] , $short[$key] );\n\t\t\t}\n\t\t}\n\n\t\t// language markers\n\t\t$markerArray = $this->helperGetLLMarkers($markerArray, $this->conf[$prefix]['LL'], strtolower($prefixWithoutDot));\n\n\t\t// Adds hook for processing of extra item markers\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraItemMarkerHook'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraItemMarkerHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$markerArray = $_procObj->extraItemMarkerProcessor($markerArray, $row, $this);\n\t\t\t}\n\t\t}\n\n\t\treturn $markerArray;\n\t}\n\n\t/**\n\t * Predefine the where clause\n\t *\n\t * @param\tstring\t\t$catList: List of current categories\n\t * @param\tstring\t$areaSearch: Coordinates of the map holding the corner points\n\t * @return the marker array\n\t */\n\tfunction helperGetAvailableRecords($catList='', $areaSearch='') {\n\t\t$where = ' lng!=0 AND lat!=0 '.$this->config['pid_list'];\n\n\t\tif (!empty($areaSearch)) {\n\t\t// build the query\n\t\t$areaArr= $this->intExplode('%2C%20',$areaSearch, 1);\n\t\t$where .= ' AND lng between '.$areaArr[1].' AND '.$areaArr[3].'\n\t\t\t\t\t\t\tAND\tlat between '.$areaArr[0].' AND '.$areaArr[2];\n\t\t}\n\n\t\t// if no category chosen, be sure no result gets displayed\n\t\tif($catList==9999) {\n\t\t\t$where .= ' AND 1=2 ';\n\t\t} elseif ($catList!='') {\n\n\t\t\t$catList = $this->intExplode(',', $catList);\n\t\t\tforeach ($catList as $key=>$value) {\n\t\t\t\t$where2 = ' FIND_IN_SET('.$value.',rggmcat) OR';\n\t\t\t}\n\t\t\t$where .= ' AND ( '.substr($where2,0,-3).' ) ';\n\t\t}\n\n\t\treturn $where;\n\t}\n\n\n\t/**\n\t * Get the recursive categories\n\t *\n\t * @param\tstring\t\t$allowedCat: the allowed categories\n\t * @param\tint\t $parentId: Parent id of the record\n\t * @return\tarray with all allowed categories\n\t */\n\tfunction helperGetRecursiveCat($allowedCat, $parentId=0,$level=0 ) {\n\t\t# $catArr = array();\n\t\t$level++;\n\n\t\t$where = 'hidden = 0 AND deleted=0 AND parent_uid='.$parentId;\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('pid,uid,title,parent_uid','tx_rggooglemap_cat',$where);\n\n\t\t// recursive query\n\t\t$catArr = '';\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\tif (in_array($row['uid'], explode(',', $allowedCat))) {\n\t\t\t\t$catArr .= '<option class=\"searchlvl'.$level.'\" value=\"'.$row['uid'].'\">'.$row['title'].'</option>';\n\t\t\t\t$recursiveCat = $this->helperGetRecursiveCat($allowedCat,$row['uid'],$level);\n\t\t\t\tif ($recursiveCat !== '') {\n\t\t\t\t\t$catArr .= $recursiveCat;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\n\t\treturn $catArr;\n\t}\n\n\t/**\n\t * Geocode an adress string, which needs already to be in the correct order\n\t *\n\t * @param\tstring\t\t$address: address\n\t * @param\tstring\t $zip: zip\n\t * @param\tstring\t $city: city\n\t * @param\tstring\t $country: country\n\t * @return\tarray with the status\n\t */\n\tfunction helperGeocodeAddress($address='', $zip='', $city='', $country='') {\n\t\t$geocode\t= array();\n\t\t$coords\t\t= array();\n\t\t$search\t\t= false;\n\n\t\tif ($address != '') {\n\t\t\t$geocode[] = $address;\n\t\t\t$search = true;\n\t\t}\n\t\tif ($zip != '') {\n\t\t\t$geocode[] = $zip;\n\t\t\t$search = true;\n\t\t}\n\t\tif ($city != '') {\n\t\t\t$geocode[] = $city;\n\t\t\t$search = true;\n\t\t}\n\t\tif ($country != '') {\n\t\t\t$geocode[] = $country;\n\t\t} else {\n\t\t\t$geocode[] = $this->config['defaultCountry'];\n\t\t}\n\n\t\t// just if there are some values additional to the country\n\t\tif ($search) {\n\t\t\t$geocode = implode(',', $geocode);\n\n\t\t\t// call google service\n\t\t\t$url = 'http://maps.google.com/maps/geo?q='.urlencode($geocode).'&output=csv&key='.$this->config['mapKey'];\n\t\t\t$response=stripslashes(t3lib_div::getURL($url));\n\n\t\t\t// determain the result\n\t\t\t$response = explode(',', $response);\n\n\t\t\t// if there is a result\n\t\t\t$coords['status'] \t= $response[0];\n\t\t\t$coords['accuracy']\t= $response[1];\n\t\t\t$coords['lat']\t\t\t= $response[2];\n\t\t\t$coords['lng']\t\t\t= $response[3];\n\t\t} else {\n\t\t\t\t$coords['status']\t= 601;\n\t\t}\n\n\t\treturn $coords;\n\t}\n\n\t/**\n\t * Get specific language markers\n\t *\n\t * @param\tarray\t\t$markerArray: the markerarray which will be filled with the language markers\n\t * @param\tstring\t\t$conf: The keys of the language markers\n\t * @param\tstring\t\t$prefix: Prefix which is used in the locallang file\n\t * @return the marker array with the language markers\n\t */\n\tfunction helperGetLLMarkers($markerArray, $conf, $prefix) {\n\t\t// add the general language markers\n\t\tif ($this->conf['generalLL']!='') {\n\t\t\t$markerList = t3lib_div::trimExplode(',', $this->conf['generalLL']);\n\t\t\tforeach($markerList as $key) {\n\t\t\t\t$markerArray['###LL_'.strtoupper($key).'###'] = $this->pi_getLL('general_'.$key);\n\t\t\t}\n\t\t}\n\n\t\t// add the specific language markers\n\t\tif($conf=='') {\n\t\t\treturn $markerArray;\n\t\t} else {\n\t\t\t$prefix = trim($prefix) . '_';\n\t\t\t$markerList = t3lib_div::trimExplode(',', $conf);\n\t\t\tforeach($markerList as $key) {\n\t\t\t\t$markerArray['###LL_'.strtoupper($key).'###'] = $this->pi_getLL($prefix.$key);\n\t\t\t}\n\t\t}\n\n\t\treturn $markerArray;\n\t}\n\n\n\t/**\n\t * Check if ajax url is the same domain as for current url\n\t * no cross site ajax requests possible!\n\t *\n\t * @return\tarray holding the infos for the error msg\n\t */\n\n\tfunction helperCheckForWrongUrl() {\n\t\t$status = array();\n\n\t\tif ($GLOBALS['TSFE']->config['config']['baseURL'] != '' || $GLOBALS['TSFE']->config['config']['absRefPrefix']) {\n\t\t\t$currentDomain = t3lib_div::getIndpEnv('TYPO3_HOST_ONLY');\n\t\t\t$linkDomain = $this->pi_getPageLink($GLOBALS['TSFE']->id);\n\n\t\t\tif ($linkDomain != '' && strpos($linkDomain, $currentDomain) === false) {\n\t\t\t\t$status['current']\t= $currentDomain;\n\t\t\t\t$status['link']\t\t\t= $linkDomain;\n\t\t\t}\n\t\t}\n\n\t\treturn $status;\n\t}\n\n\t/**\n\t * Get the correct Google Maps API key if multidomains are used and key\n\t * for the current domain is found\n\t *\n\t * @param\tstring\t\t$defaultKey: The default key\n\t * @param\tstring\t\t$multiKey: Setting of the EM holding all domains and the keys\n\t * @return string the key for the current domain\n\t */\n\tfunction helperGetMultiDomainKey($defaultKey, $multiKey) {\n\t\t$finalKey = $defaultKey;\n\t\t$multiKey = trim($multiKey);\n\n\t\t// if any multidomain key is found\n\t\tif (trim($multiKey) != '') {\n\t\t\t$keyListTmp = explode('#####', $multiKey); // split by #### because EXT constantsextended uses that\n\t\t\t$keyList = array();\n\t\t\tforeach($keyListTmp as $key) {\n\t\t\t\t$split = t3lib_div::trimExplode('=', $key);\n\t\t\t\t$keyList[$split[0]] = $split[1];\n\t\t\t}\n\n\t\t\t// get current domain and check if there is a API for it\n\t\t\t$currentDomain = t3lib_div::getIndpEnv('TYPO3_HOST_ONLY');\n\t\t\tif ($keyList[$currentDomain] != '') {\n\t\t\t\t$finalKey = $keyList[$currentDomain];\n\t\t\t}\n\t\t}\n\n\t\treturn $finalKey;\n\t}\n\n\t/**\n\t * Get the image of the categories\n\t * todo: create a real recursive function\n\n\t * @param\tarray\t\t$catImg: array holding the record\n\t * @param\tint\t\t$parent: id of the parent category\n\t * @return\tarray list of category records with their images\n\t */\n\tfunction helperGetCategoryImage($catImg, $parent=0) {\n\t\t$table = 'tx_rggooglemap_cat';\n\t\t$field = 'uid,image,parent_uid';\n\t\t$where = 'deleted = 0 AND hidden=0 ';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field,$table,$where,$groupBy='',$orderBy,$limit='');\n\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\tif ($row['image']=='') {\n\t\t\t\t// get image of parent category\n\t\t\t\t$whereTemp = 'deleted = 0 AND hidden=0 AND uid = ' . $row['parent_uid'];\n\t\t\t\t$res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field,$table,$whereTemp);\n\t\t\t\t$row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2);\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res2);\n\t\t\t\t$catImg[$row['uid']] = $row2['image'];\n\t\t\t} else {\n\t\t\t\t$catImg[$row['uid']] = $row['image'];\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\n\t\treturn $catImg;\n\t}\n\n\n\t/**\n\t * Get the value out of the flexforms and if empty, take if from TS\n\t *\n\t * @param\tstring\t\t$sheet: The sheed of the flexforms\n\t * @param\tstring\t\t$key: the name of the flexform field\n\t * @param\tstring\t\t$confOverride: The value of TS for an override\n\t * @return\tstring\tThe value of the locallang.xml\n\t */\n\tfunction helperGetFlexform($sheet, $key, $confOverride='') {\n\t\t// Default sheet is sDEF\n\t\t$sheet = ($sheet == '') ? $sheet = 'sDEF' : $sheet;\n\t\t$flexform = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], $key, $sheet);\n\n\t\t// possible override through TS\n\t\tif ($confOverride=='') {\n\t\t\treturn $flexform;\n\t\t} else {\n\n\t\t\t// hack to work with multiple TS arrays\n\t\t\t$tsparts = explode('.', $confOverride);\n\t\t\tif (count($tsparts) == 1) { // default with no .\n\t\t\t\t$value = $flexform ? $flexform : $this->conf[$confOverride];\n\t\t\t\t$value = $this->cObj->stdWrap($value,$this->conf[$confOverride.'.']);\n\t\t\t} elseif (count($tsparts) == 2) { // 1 sub array\n\t\t\t\t$value = $flexform ? $flexform : $this->conf[$tsparts[0].'.'][$tsparts[1]];\n\t\t\t\t$value = $this->cObj->stdWrap($value,$this->conf[$tsparts[0].'.'][$tsparts[1].'.']);\n\t\t\t}\n\n\t\t\treturn $value;\n\t\t}\n\t}\n\n\t/**\n\t * Generate a unique integer key despite of the table name as string\n\t *\n\t * @param\tstring\t\t$table: name of the table\n\t * @param\tint\t\t$id: uid of the record\n\t * @return integer unique key\n\t */\n\tfunction helperJsKey($table, $id) {\n\t\t$key = substr(hexdec(substr (md5($table) , 0 , 7)), 0, 3).$id;\n\t\treturn $key;\n\t}\n\n\t/**\n\t * Cluster all records by grouping them into different areas\n\t *\n\t * @param\tarray\t\t$list: all records\n\t * @param\tarray\t\t$areaArr: the current area of the map\n\t * @return array the clustered list of records\n\t */\n\tfunction helperClusterRecords($list, $areaArr) {\n\t\t$clusterCount = 1;\n\n\t\t//limit to 30 markers\n\t\t$limit \t\t\t= 30;\n\t\t$gridSize\t\t= 0;\n\t\t$listRemove\t= array();\n\n\t\twhile(count($list)>$limit) {\n\t\t\t//grid size in pixels. if the first pass fails to reduce the\n\t\t\t//number of markers below the limit, the grid will increase\n\t\t\t//again and redo the loop.\n\t\t\t$gridSize += ($areaArr[3]-$areaArr[1])/30;\n\t\t\t$clustered = array();\n\t\t\treset($list);\n\n\t\t\t//loop through the $list and put each one in agrid square\n\t\t\tforeach ($list as $k=>$v) {\n\t\t\t\t//calculate the y position based on the latitude: $v[0]\n\t\t\t\t$y = floor(($v['lat']-$areaArr[0])/$gridSize);\n\t\t\t\t//calculate the x position based on the longitude: $v[1]\n\t\t\t\t$x = floor(($v['lng']-$areaArr[1])/$gridSize);\n\n\t\t\t\t//use the x and y values as the key for the array and append\n\t\t\t\t//the points key to the clustered array\n\t\t\t\t$clustered[\"{$x},{$y}\"][] = $k;\n\t\t\t}\n\n\t\t\t//check if we're below the limit and if not loop again\n\t\t\tif (count($clustered)>$limit) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//reformat the list array\n\t\t\t$listRemove = array();\n\n\t\t\tforeach ($clustered as $k=>$v) {\n\n\t\t\t\t//only merge if there is more than one marker in acell\n\t\t\t\tif(count($v)>1) {\n\n\t\t\t\t\t//create alist of the merged markers\n\t\t\t\t\t$listRemove = array_merge($listRemove,$v);\n\n\t\t\t\t\t//add acluster marker to the list\n\t\t\t\t\t$clusterLat = $list[$v[0]]['lat'];\n\t\t\t\t\t$clusterLng = $list[$v[0]]['lng'];\n\n\t\t\t\t\t// add a clustered record to the list\n\t\t\t\t\t$list[] = array(\n\t\t\t\t\t\t'lat'=> $clusterLat,\n\t\t\t\t\t\t'lng' => $clusterLng,\n\t\t\t\t\t\t'rggmcluster' => 1,\n\t\t\t\t\t\t'rggmtitle' => 'cluster - '.count($v),\n\t\t\t\t\t\t'uid' => $this->helperJsKey('rggmcluster', $clusterCount),\n\t\t\t\t\t\t'table' => 'rggmcluster',\n\t\t\t\t\t\t'rggmcat' => 91919199\n\t\t\t\t\t);\n\n\t\t\t\t\t$clusterCount++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//unset all the merged pins, reverse to start with highest key\n\t\t\trsort($listRemove);\n\t\t\twhile(list($k,$v) = each($listRemove)) {\n\t\t\t\tunset($list[$v]);\n\t\t\t}\n\n\t\t\t//we're done!\n\t\t\tbreak;\n\t\t}\n\n\t\treset($list);\n\t\t#print_r($list);\n\t\treturn $list;\n\t}\n\n\t/**\n\t * Reverse geocoding of a location to get an address from coordinates\n\t *\n\t * @param\tfloat\t\t$lat: latitude\n\t * @param\tfloat\t\t$lng: longitude\n\t * @return array information about the address\n\t */\n\tfunction helperReverseGeocode($lat, $lng) {\n\t\t$addressData = array();\n\t\t$lng = floatval($lat);\n\t\t$lng = floatval($lat);\n\n\t\tif ($key == '' || $lng == 0 || $lat == 0 ) {\n\t\t\treturn $addressData;\n\t\t}\n\n\t\t$coords\t\t= $lat . ',' . $lng;\n\t\t$url\t\t\t= 'http://maps.google.com/maps/geo?q='.$coords.'&output=json&oe=utf8&sensor=false&key='.$this->config['mapKey'];\n\t\t$address\t= json_decode(t3lib_div::getURL($url));\n\n\t\t// get the response\n\t\tif ($address->Status->code == '200' && count($address->Placemark) > 0) {\n\t\t\t$addressObj = $address->Placemark[0];\n\n\t\t\t$addressData['all']\t\t\t\t\t= $addressObj->address;\n\t\t\t$addressData['country']\t\t\t= $addressObj->AddressDetails->Country->CountryName;\n\t\t\t$addressData['countryshort']= $addressObj->AddressDetails->Country->CountryNameCode;\n\t\t\t$addressData['region']\t\t\t= $addressObj->AddressDetails->Country->AdministrativeArea->AdministrativeAreaName;\n\t\t\t$addressData['subarea']\t\t\t= $addressObj->AddressDetails->Country->AdministrativeArea->SubAdministrativeArea->SubAdministrativeAreaName;\n\t\t\t$addressData['city']\t\t\t\t= $addressObj->AddressDetails->Country->AdministrativeArea->SubAdministrativeArea->Locality->LocalityName;\n\t\t\t$addressData['zip']\t\t\t\t\t= $addressObj->AddressDetails->Country->AdministrativeArea->SubAdministrativeArea->Locality->PostalCode->PostalCodeNumber;\n\t\t\t$addressData['address']\t\t\t= $addressObj->AddressDetails->Country->AdministrativeArea->SubAdministrativeArea->Locality->Thoroughfare->ThoroughfareName;\n\t\t}\n\n\t\treturn $addressData;\n\t}\n\n\n\t/**\n\t * explode an array and make either intval or floatval to every value\n\t *\n\t * @param\tchar\t\t$delim: delimiter\n\t * @param\tstring\t\t$string: string which gets exploded\n\t * @param\tboolean\t\t$float: if true, use floatval, otherwise intval\n\t * @return array exploded array\n\t */\n\tfunction intExplode($delim, $string, $float=false) {\n\t $temp = explode($delim, $string);\n\t foreach ($temp as &$val) {\n\t\t\t$val = ($float) ? floatval($val) : intval($val);\n\t }\n\t reset($temp);\n\t return $temp;\n\t}\n\n\n\n\t/**\n\t * **********************************\n\t * ********** X M L *****************\n\t * **********************************\n\t */\n\tfunction xmlFunc($content, $conf) {\n\t\t$this->init($conf);\n\t\t$this->pi_initPIflexForm(); // Init FlexForm configuration for plugin\n\n\t\t$postvars = t3lib_div::_GP('tx_rggooglemap_pi1');\n\t\t$areaArr = $this->intExplode(', ', $postvars['area'], 1);\n\n\t\t// fetch the content of a single poi\n\t\tif ($postvars['detail'] != '') {\n\t\t\t$content = $this->getPoiContent($postvars['detail'],1,$postvars['table']);\n\n\t\t\treturn $content;\n\t\t}\n\n\t\t// categories\n\t\t$cat = $postvars['cat'];\n\t\tif ($cat) { // cat selected\n\t\t\tif ($cat != 9999) { // nothing selected\n\t\t\t\t$catList = $this->intExplode(',', $cat);\n\t\t\t}\n\t\t} else { // nothing selected means 1st call!\n\t\t\t$catList = t3lib_div::trimExplode(',', $this->config['categoriesActive']);\n\t\t}\n\n\t\t$this->xmlRenderHeader();\n\t\t$where = array();\n\n\t\tif ($catList) {\n\t\t\t$catImg = $this->helperGetCategoryImage(array()); // category images\n\n\t\t\t$table = $this->config['tables'];\n\n\t\t\t// smaller and faster query, use smaller select, otherwise fetch all\n\t\t\tif ($this->conf['title.']['useRggmTitle'] == 1)\n\t\t\t\t$field = 'uid,rggmcat,rggmtitle,lat,lng';\n\t\t\telse {\n\t\t\t\t$field = '*';\n\t\t\t}\n\t\t\t$where['basic'] = 'lng!=0 AND lat!= 0 AND lng!=\\'\\' AND lat!=\\'\\' ' . $this->config['pid_list'];\n\n\t\t\tif (count($areaArr) > 1) {\n\t\t\t\t$where['area'] = ' AND lng BETWEEN ' . $areaArr[1] . ' AND ' . $areaArr[3] . '\n\t\t\t\t\tAND\tlat BETWEEN ' . $areaArr[0] . ' AND ' . $areaArr[2];\n\t\t\t}\n\n\t\t\t// category selection\n\t\t\t$catTmp = FALSE;\n\t\t\t$where2 = '';\n\t\t\tforeach ($catList as $key => $value) {\n\t\t\t\tif ($value) {\n\t\t\t\t\t$catTmp = TRUE;\n\t\t\t\t\t$where2 .= ' FIND_IN_SET(' . $value . ',rggmcat) OR';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$where['category'] = ($catTmp) ? ' AND ( ' . substr($where2, 0, -3) . ' ) ' : '';\n\n\t\t\t$limit = '';\n\n\t\t\tif ($this->conf['extraquery'] == 1) {\n\t\t\t\t$extraquery = ($GLOBALS['TSFE']->fe_user->getKey('ses', 'rggmttnews2'));\n\t\t\t\tif ($extraquery != '') {\n\t\t\t\t\t$where['extraquery'] = ' AND uid IN (' . $extraquery . ') ';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t// Adds hook for processing of the xml func\n\t\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['xmlFuncHook'])) {\n\t\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['xmlFuncHook'] as $_classRef) {\n\t\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t\t$where = $_procObj->extraSearchProcessor($table,$where,$orderBy, $limit, $postvars, $this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$where = implode(' ', $where);\n\n\t\t\t$count = 0;\n\t\t\t$res = $this->generic->exec_SELECTquery($field, $table, $where, $groupBy, $orderBy, $limit);\n\n\t\t\tif ($this->conf['map.']['activateCluster'] == 3) {\n\t\t\t\t$res = $this->helperClusterRecords($res, $areaArr);\n\t\t\t}\n\n\t\t\t$this->xmlStartLevel('markers');\n\t\t\twhile ($row = array_shift($res)) {\n\t\t\t\t$test = '';\n\t\t\t\t$count++;\n\t\t\t\t$catList = explode(',', $row['rggmcat']);\n\t\t\t\t$img = $catImg[$catList[0]];\n\t\t\t\t$img = $catList[0];\n\n\t\t\t\t$this->xmlAddRecord($table, $row, $conf, $img, $test);\n\t\t\t}\n\t\t\t$this->xmlEndLevel('markers');\n\n\t\t\t\t// Hook for returning additional datasets\n\t\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['datasetHook'])) {\n\t\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['datasetHook'] as $_classRef) {\n\t\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t\t$params = array(\n\t\t\t\t\t\t'categories' => $catList,\n\t\t\t\t\t\t'zoom' => $postvars['zoom'],\n\t\t\t\t\t);\n\t\t\t\t\tif (count($areaArr) > 1) {\n\t\t\t\t\t\t$params['area'] = array(\n\t\t\t\t\t\t\t'minLatitude' => $areaArr[0],\n\t\t\t\t\t\t\t'maxLatitude' => $areaArr[2],\n\t\t\t\t\t\t\t'minLongitude' => $areaArr[1],\n\t\t\t\t\t\t\t'maxLongitude' => $areaArr[3],\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t$_procObj->prepareDataset($params, $this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->xmlRenderFooter();\n\n\t\t$result = $this->xmlGetResult();\n\t\treturn $result;\n\t}\n\n\t/**\n\t * adds a single record to the xml file\n\t *\n\t * @param\tarray\t\t$row: all fields of one record\n\t * @param\tarray\t\t$conf: The PlugIn configuration\n\t * @param\tstring\t\t$img: the image to show\n\t * @return single line @ xml\n\t */\n\tfunction xmlAddRecord($table, $row, $conf, $img) {\n\t\t// language setting\n\t\tif ($GLOBALS['TSFE']->sys_language_content && $this->conf['getRecordOverlay'] == 1) {\n\t\t\t$OLmode = ($this->sys_language_mode == 'strict'?'hideNonTranslated':'');\n\t\t\t$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($table, $row, $GLOBALS['TSFE']->sys_language_content, $OLmode);\n\t\t}\n\t\t$uid2 = $this->helperJsKey($row['table'], $row['uid']);\n\n\t\t$attributes = array(\n\t\t\t'cat' => $row['rggmcat'],\n\t\t\t'uid2' => $uid2,\n\t\t\t'uid' => $row['uid'],\n\t\t\t'lng' => $row['lng'],\n\t\t\t'lat' => $row['lat'],\n\t\t\t'img' => $img,\n\t\t\t'table' => $row['table'],\n\t\t);\n\t\t$this->xmlStartLevel('marker', $attributes);\n\t\t$this->xmlGetRowInXML($row, $conf);\n\t\t$this->xmlEndLevel('marker');\n\t}\n\n\t/**\n\t * inserts the element/node \"html\" for every record => the content of every POI\n\t *\n\t * @param\tarray\t\t$row: all fields of one record\n\t * @param\tarray\t\t$conf: The PlugIn configuration\n\t * @return element \"html\" @ xml\n\t */\n\tfunction xmlGetRowInXML($row,$conf) {\n\t\t$table = $row['table'];\n\n\t\t// if useRggmTitle > title field is hardcoded\n\t\t$field = ($this->conf['title.']['useRggmTitle'] == 1) ? 'rggmtitle' : $this->conf['title.'][$table];\n\n\t\t$title = $this->cObj2->stdWrap($row[$field], $this->conf['title.'][$table.'.']);\n\t\t$content = '<![CDATA[ ' . $title . ' ]]>';\n\t\t$this->xmlLines[] = $this->xmlIcode . $this->xmlFieldWrap('t', (($content)));\n\t}\n\n\t/**\n\t * Creates a new XML level.\n\t *\n\t * @param\tstring\t\t$name: name of the new level\n\t * @param\tarray\t\t$attributes: attributes of the tag\n\t * @param\tboolean\t\t$isEmpty: whether the tag should be closed right away as it does not contain subitems\n\t * @return\tvoid\n\t */\n\tpublic function xmlStartLevel($name, $attributes = array(), $isEmpty = FALSE) {\n\t\t$tag = '<' . $name;\n\t\tforeach ($attributes as $key => $val) {\n\t\t\t$tag .= ' ' . $key . '=\"' . htmlspecialchars($val) . '\"';\n\t\t}\n\t\t$tag .= $isEmpty ? ' />' : '>';\n\t\t$this->xmlLines[] = $this->xmlIcode . $tag;\n\t}\n\n\t/**\n\t * Ends an XML level.\n\t *\n\t * @param\tstring\t\t$name: name of the level to end\n\t * @return\tvoid\n\t */\n\tpublic function xmlEndLevel($name) {\n\t\t$this->xmlLines[] = $this->xmlIcode . '</' . $name . '>';\n\t}\n\n\tfunction xmlGetResult() {\n\t\t$content = implode(chr(10), $this->xmlLines);\n\t\treturn $content;\n\t}\n\n\tfunction xmlFieldWrap($field,$value) {\n\t\treturn '<' . $field . '>' . $value . '</' . $field . '>';\n\t}\n\n\t// just returns the top level name\n\tprotected function xmlTopLevelName() {\n\t\treturn 'dataset';\n\t}\n\n\t// rendering header\n\tprotected function xmlRenderHeader() {\n\t\t$this->xmlStartLevel($this->xmlTopLevelName());\n\t}\n\n\n\t// rendering footer\n\tprotected function xmlRenderFooter() {\n\t\t$this->xmlEndLevel($this->xmlTopLevelName());\n\t}\n\n}", "public function addCareerMenu(pmJSCookMenu $menu)\n {\n $career = CareerPeer::retrieveByPK($this->getReferenceFor(\"career\"));\n\n sfContext::getInstance()->getConfiguration()->loadHelpers(array(\"I18N\"));\n\n if (!is_null($career))\n {\n $menu->addChild(\"menu_separator\", new pmJSCookMenuSeparator());\n\n $submenu = new pmJSCookMenu();\n $submenu\n ->setTitle(\"<strong>\".__(\"Current career\").\"</strong>\")\n ->setCredentials(\"edit_career\");\n\n $item = new pmJSCookMenuItem();\n $item->setTitle($career);\n $submenu->addChild(\"career_name\", $item);\n\n $submenu->addChild(\"first_separator\", new pmJSCookMenuSeparator());\n\n // edit\n if ($career->canBeEdited())\n {\n $item = new pmJSCookMenuItem();\n $item\n ->setTitle(\"Edit\")\n ->setUrl(\"@career_edit?id=\".$career->getId())\n ->setCredentials(\"edit_career\");\n $submenu->addChild(\"edit\", $item);\n }\n\n // delete\n if ($career->canBeDeleted())\n {\n // TODO: ver esto porque REST no funciona con JS\n $delete_url = url_for(array(\n \"sf_route\" => \"career_delete\",\n \"sf_subject\" => $career,\n \"sf_method\" => \"delete\"\n ));\n $item = new pmJSCookMenuItem();\n $item\n ->setTitle(\"Delete\")\n ->setUrl($delete_url)\n ->setCredentials(\"edit_career\");\n $submenu->addChild(\"delete\", $item);\n }\n\n if ($career->canBeEdited() || $career->canBeDeleted())\n {\n $submenu->addChild(\"second_separator\", new pmJSCookMenuSeparator());\n }\n\n // copy\n $item = new pmJSCookMenuItem();\n $item\n ->setTitle(\"Copy\")\n ->setUrl(\"career/copy?id=\".$career->getId())\n ->setCredentials(\"edit_career\");\n $submenu->addChild(\"copy\", $item);\n\n // subjects\n $item = new pmJSCookMenuItem();\n $item\n ->setTitle(\"Subjects\")\n ->setUrl(\"career/subjects?id=\".$career->getId())\n ->setCredentials(\"edit_career\");\n $submenu->addChild(\"subjects\", $item);\n\n // subject options\n $item = new pmJSCookMenuItem();\n $item\n ->setTitle(\"Subject options\")\n ->setUrl(\"career/subjectOptions?id=\".$career->getId())\n ->setCredentials(\"edit_career\");\n $submenu->addChild(\"subject_options\", $item);\n\n // career view\n $item = new pmJSCookMenuItem();\n $item\n ->setTitle(\"Career view\")\n ->setUrl(\"career/careerView?id=\".$career->getId())\n ->setCredentials(\"edit_career\");\n $submenu->addChild(\"career_view\", $item);\n\n // show inscripted\n $item = new pmJSCookMenuItem();\n $item\n ->setTitle(\"Show inscripted\")\n ->setUrl(\"career/students?id=\".$career->getId())\n ->setCredentials(\"edit_career\");\n $submenu->addChild(\"career_view\", $item);\n\n $menu->addChild(\"career\", $submenu);\n }\n }", "public function addLanguageItem($category, $message)\n {\n $this->_languageElements[$category][$message] = true;\n\n $coloredCategory = Console::ansiFormat($category, [Console::FG_YELLOW]);\n $coloredMessage = Console::ansiFormat($message, [Console::FG_YELLOW]);\n\n $this->stdout('Detected language element: [ ' . $coloredCategory . ' ] ' . $coloredMessage);\n }", "public function letCatIn(Cat $cat) {\r\n\t\t$this->_cats[] = $cat;\r\n\t}", "public function AddCategories($categories) {\n $this->Categories = $categories;\n }", "public function add_category($name = ''){\n\t\t$query = $this->db->insert('categories', array('cat_name'=>$name));\n\t\treturn $query;\n\t}", "function get_addcategory_cat($page_id, $level, $current_id = 0, $pageid_prefix = '') {\n\t\n\tglobal $ft;\n\n\t$query = sprintf(\"\n SELECT \n category_id, \n category_parent_id, \n category_name \n FROM \n %1\\$s \n WHERE \n category_parent_id = '%2\\$d' \n ORDER BY \n category_id \n ASC\", \n\t\n TABLE_CATEGORY, \n $page_id\n );\n\n\t$db = new DB_SQL;\n\t$db->query($query);\n\t\n\t$id = isset($_GET['id']) ? intval($_GET['id']) : 0;\n\t\t\n\twhile($db->next_record()) {\n\t\n\t\t$cat_id = $db->f(\"category_id\");\n\t\t$cat_parent_id = $db->f(\"category_parent_id\");\n\t\t$cat_name = $db->f(\"category_name\");\n\t\n\t\t$ft->assign(array(\n 'C_ID'\t\t=>$pageid_prefix . $cat_id,\n 'C_NAME'\t=>str_repeat('&nbsp; ', $level) . \"- \" .$cat_name,\n 'CURRENT' =>$cat_id == $current_id ? 'selected=\"selected\"' : ''\n ));\n\n $ft->parse('CATEGORY_ROW', \".category_row\");\n\t\t\n\t\tget_addcategory_cat($cat_id, $level+2, $current_id, $pageid_prefix);\n\t}\n}", "function SELLMYHOME_add_category( $cat_name, $taxonomy ){\n //Check if term exists before attempting to create\n if( !term_exists( $cat_name, $taxonomy ) ){\n $my_cat = array('cat_name' => $cat_name, \n 'category_description' => 'Default, Permanent Category', \n 'category_nicename' => SELLMYHOME_clean($cat_name), \n 'category_parent' => '',\n 'taxonomy' => $taxonomy);\n\n // Create the category\n wp_insert_category($my_cat); \n } \n}", "public function addMenuItem($menu, $type, $item)\n {\n array_unshift($item, $menu);\n $item[\"porcelain\"] = null;\n return intval($this->runWpCliCommand(\"menu\", \"item add-\" . $type, $item));\n }", "public function do_add(Request $request){\n\t\t$cat = new category();\n\t\t$c_name = $request->get(\"c_name\");\n\t\t$cat->insert(array(\"c_name\"=>$c_name));\n\t\treturn redirect(url('admin/category-news'));\n\t}", "function add_menu($menu_name, $menu_url, $menu_children = array(), $context = \"\") {\n\tglobal $CONFIG;\n\tif (!isset($CONFIG->menucontexts)) {\n\t\t$CONFIG->menucontexts = array();\n\t}\n\n\tif (empty($context)) {\n\t\t$context = get_plugin_name();\n\t}\n\n\t$CONFIG->menucontexts[] = $context;\n\treturn add_to_register('menu', $menu_name, $menu_url, $menu_children);\n}", "public function page_add_edit_cat()\n\t{\n\t\t// Edition\n\t\t$cat_name = '';\n\t\tif ($this->mode == 'edit_cat')\n\t\t{\n\t\t\t$sql = 'SELECT cat_name\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t$result = Fsb::$db->query($sql);\n\t\t\t$data = Fsb::$db->row($result);\n\t\t\tif (!$data)\n\t\t\t{\n\t\t\t\t$this->mode = 'add_cat';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tFsb::$db->free($result);\n\t\t\t\t$cat_name = $data['cat_name'];\n\t\t\t}\n\t\t}\n\n\t\tFsb::$tpl->set_switch('smileys_add_cat');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'L_ADD_EDIT' =>\t\t($this->mode == 'add_cat') ? Fsb::$session->lang('adm_smiley_add_cat') : Fsb::$session->lang('adm_smiley_edit_cat'),\n\t\t\t'CAT_NAME' =>\t\t$cat_name,\n\n\t\t\t'U_ACTION' =>\t\tsid('index.' . PHPEXT . '?p=posts_smiley&amp;mode=' . $this->mode . '&amp;id=' . $this->id),\n\t\t));\n\t}", "public function addCategory($table, $data)\n {\n\n if (isset($data)) {\n $result=$this->dynamicInsert($table, $data);\n }\n }", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public function addAction()\n {\n $form = $this->getServiceLocator()->get('civcontent_category_form');\n \n // Check if the request is a POST.\n $request = $this->getRequest();\n if ($request->isPost())\n {\n // Create a new category object.\n $category = $this->getServiceLocator()->get('civcontent_category');\n \n $data = (array) $request->getPost();\n $form->bind($category);\n $form->setData($data);\n if ($form->isValid())\n {\n // Persist changes.\n $this->getContentService()->persistCategory($category);\n \n // Redirect to content categories\n return $this->redirect()->toRoute('content/category', array(\n 'action' => 'index'\n ));\n }\n }\n \n // If a GET request, or invalid data then render/re-render the form\n return new ViewModel(array(\n 'form' => $form,\n ));\n }", "public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Game_Service_Category::addCategory($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function addMenuGroup($seed): Menu;", "public function setCategory($aId, $aCategory) {\n list($lId, $lCategory) = array(intval($aId), $aCategory);\n \n $lSql = 'SELECT count(*) FROM `al_cms_ref_category` WHERE `content_id`='.esc($lId);\n $lCount = CCor_Qry::getInt($lSql);\n if($lCount < 1) {\n // insert new category reference\n $lSql = 'INSERT INTO `al_cms_ref_category` (`content_id`, `category`) VALUES ('.esc($lId).', '.esc($lCategory).')';\n CCor_Qry::exec($lSql);\n }\n }", "public static function menu_subpage_categories(){\n \t\t\n\t\t\tadd_submenu_page('edit.php?post_type='.self::$post_type, \n\t\t\t\t\t\t\t self::$page_title_category, \n\t\t\t\t\t\t\t 'Menu Listing', \n\t\t\t\t\t\t\t self::$capability,\n\t\t\t\t\t\t\t 'menu_listings',\n\t\t\t\t\t \t array( __CLASS__, 'menu_generator_listing'));\n\t\t\n\t\t}", "public function addAction()\n {\n $form = new CategoryForm();\n $form->get('submit')->setValue('Add');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $category->exchangeArray($form->getData());\n $this->getCategoryTable()->saveCategory($category);\n\n // Redirect to list of categorys\n return $this->redirect()->toRoute('category');\n }\n }\n return array('form' => $form);\n }", "function set_acl_category($category)\n {\n $this->acl_category = $category;\n foreach ($this->plugins as $name => $obj) {\n $this->plugins[$name]->set_acl_category($category);\n }\n }" ]
[ "0.70198417", "0.6900577", "0.6898877", "0.6847829", "0.66013134", "0.649265", "0.6484575", "0.6368133", "0.6361709", "0.6335254", "0.63196987", "0.6319349", "0.6315013", "0.63022584", "0.6286297", "0.62793344", "0.62701535", "0.6263611", "0.6245445", "0.61762744", "0.6144288", "0.61371815", "0.6097793", "0.6074728", "0.60742676", "0.60674906", "0.60550493", "0.60464996", "0.60439235", "0.60297143", "0.60256517", "0.5968991", "0.5937443", "0.59373605", "0.59344894", "0.5924285", "0.59225076", "0.59212554", "0.5902328", "0.5900356", "0.5899412", "0.58960587", "0.5894067", "0.5886036", "0.588016", "0.5874864", "0.5855302", "0.5849544", "0.58476615", "0.5837315", "0.58368057", "0.58336145", "0.5817262", "0.58160347", "0.58088917", "0.58074695", "0.57897556", "0.5786522", "0.5769648", "0.57607543", "0.5756792", "0.5746828", "0.574138", "0.5724949", "0.5717943", "0.5697578", "0.5692229", "0.5686656", "0.56729543", "0.5664106", "0.5661146", "0.565816", "0.5646736", "0.56465095", "0.56396425", "0.56349844", "0.5631708", "0.5624862", "0.56191045", "0.56164986", "0.5598359", "0.55979186", "0.55967146", "0.55916744", "0.55913043", "0.5579043", "0.55780613", "0.5567955", "0.5564909", "0.55535054", "0.5551088", "0.5546621", "0.55373937", "0.55369645", "0.55326486", "0.55204684", "0.55188054", "0.55121684", "0.55034447", "0.54992145" ]
0.5819434
52
Update category paremeters in MenuLink.
public static function updateMenulink($category) { if(self::isInMenuLinks($category->categoryID)) { $menuLinks = MenuLink::where('belongsToID', $category->categoryID)->where('belongsTo', 'category')->get(); foreach($menuLinks as $menuLink){ $menuLink->params = $category->menuLinkParameters(); $menuLink->save(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "function update_category_detail($siteData, $category_id) {\n $this->db->where('id', $category_id);\n $this->db->update('category', $siteData);\n }", "function update_category_detail($siteData,$category_id)\n\t{\n\t\t$this->db->where('id', $category_id);\n\t\t$this->db->update('category', $siteData); \n\t\t\n\t}", "function fm_update_links_cats($catid) {\r\n\t// Changes all associated links to deleted cat to 0\r\n\tif ($linkcats = get_records('fmanager_link', \"category\", $catid)) {\r\n\t\tforeach ($linkcats as $lc) {\t\t\r\n\t\t\t$lc->category = 0;\r\n\t\t\tif (!update_record('fmanager_link', $lc)) {\r\n\t\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function wp_update_category($catarr)\n {\n }", "function set_acl_category($category)\n {\n $this->acl_category = $category;\n foreach ($this->plugins as $name => $obj) {\n $this->plugins[$name]->set_acl_category($category);\n }\n }", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "public function update_category(){\n $query = \"UPDATE {$this->table} SET cat_title = :cat_title WHERE {$this->table}.cat_id = :cat_id\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_title',$this->cat_title);\n $stmt->bindParam(':cat_id',$this->cat_id);\n $stmt->execute();\n return $stmt;\n }", "public function testUpdateItemSubCategory()\n {\n }", "public function update($menu)\r\n {\r\n\r\n }", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "function update_category($category_id)\n {\n $this->db->update('tbl_category',$this, array('category_id'=>$category_id));\n }", "public function updated(Category $category)\n {\n //\n }", "public function updatecategory($args)\n {\n if (!SecurityUtil::checkPermission('Dizkus::', \"::\", ACCESS_ADMIN)) {\n return LogUtil::registerPermissionError();\n }\n \n // copy all entries from $args to $obj that are found in the categories table\n // this prevents possible SQL errors if non existing keys are passed to this function\n $ztables = DBUtil::getTables();\n $obj = array();\n foreach ($args as $key => $arg) {\n if (array_key_exists($key, $ztables['dizkus_categories_column'])) {\n $obj[$key] = $arg;\n }\n }\n \n if (isset($obj['cat_id'])) {\n $obj = DBUtil::updateObject($obj, 'dizkus_categories', null, 'cat_id');\n return true;\n }\n \n return false;\n }", "public function editCategory()\r\n{\r\n $query_string = \"UPDATE categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function updateCategories()\n {\n $this->updateCategoriesByType();\n $this->updateCategoriesByParent();\n $this->updateCategoriesByID();\n }", "public function UpdateCategory($_category)\n\t\t{\n\t\t\t$query = \"update categories set \";\n\t\t\t$query .= \"categoryname = '\" . $this->CheckString($_category->getCategoryName()) . \"', \";\n\t\t\t$query .= \"parentcategoryid = \" . $_category->getParentCategoryID() . \", \";\n\t\t\t$query .= \"filtered = \" . $this->CheckBoolean($_category->getFiltered()) . \" , \";\n\t\t\t$query .= \"displayorder = \" . $_category->getDisplayOrder() . \" \";\n\t\t\t$query .= \" where categoryid = \" . $_category->getCategoryID();\n\t\t\treturn $query;\n\t\t}", "function update_category_cache()\n {\n }", "function pnAddressBook_admin_updatecategories() {\r\n\r\n\t$output = new pnHTML();\r\n\r\n // Security check\r\n if (!pnSecAuthAction(0, 'pnAddressBook::', '::', ACCESS_ADMIN)) {\r\n $output->Text(pnVarPrepHTMLDisplay(_PNADDRESSBOOK_NOAUTH));\r\n $output->Text(pnAddressBook_themetable('end'));\r\n\t\treturn $output->GetOutput();\r\n }\r\n\r\n\tlist($id,$del,$name,$newname) = pnVarCleanFromInput('id','del','name','newname');\r\n\tif(is_array($del)) {\r\n $dels = implode(',',$del);\r\n }\r\n\r\n\t$modID = $modName = array();\r\n\r\n\tif(isset($id)) {\r\n\t\tforeach($id as $k=>$i) {\r\n \t$found = false;\r\n \tif(count($del)) {\r\n \tforeach($del as $d) {\r\n \tif($i == $d) {\r\n \t$found = true;\r\n \tbreak;\r\n \t}\r\n \t}\r\n \t}\r\n \tif(!$found) {\r\n \tarray_push($modID,$i);\r\n \tarray_push($modName,$name[$k]);\r\n }\r\n \t}\r\n\t}\r\n\r\n\t$pntable = pnDBGetTables();\r\n\t$cat_table = $pntable[pnaddressbook_categories];\r\n\t$cat_column = $pntable['pnaddressbook_categories_column'];\r\n\r\n\t$updates = array();\r\n foreach($modID as $k=>$id) {\r\n array_push($updates,\"UPDATE $cat_table\r\n SET $cat_column[name]='\".pnVarPrepForStore($modName[$k]).\"'\r\n WHERE $cat_column[nr]=$id\");\r\n\t}\r\n\r\n\t$error = '';\r\n\r\n\tif(pnModAPIFunc(__PNADDRESSBOOK__,'admin','updateCategories',array('updates'=>$updates))) {\r\n \tif (empty($error)) { $error .= 'UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\telse { $error .= ' - UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t}\r\n\r\n\t$delete = \"DELETE FROM $cat_table WHERE $cat_column[nr] IN ($dels)\";\r\n\tif(isset($dels)) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','deleteCategories',array('delete'=>$delete))) {\r\n if (empty($error)) { $error .= 'DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n }\r\n }\r\n\r\n\tif( (isset($newname)) && ($newname != '') ) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','addCategories',array('name'=>$newname))) {\r\n if (empty($error)) { $error .= 'INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t}\r\n }\r\n\r\n\t$args=array('msg'=>$error);\r\n\r\n\tpnRedirect(pnModURL(__PNADDRESSBOOK__, 'admin', 'categories',$args));\r\n\treturn true;\r\n}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public static function viewCategoryUpdate($cat_id,$par)\n\t {\n\t\t\t\t\n\t\t\t\t\n\t\t $nsubdata=mysql_query(\"select * from category where cat_par_id='$cat_id'\");\n\t\t\t\twhile($sub_cat=mysql_fetch_array($nsubdata))\n\t\t\t\t{\n\t\t\t\t\tif($sub_cat['cat_id']==$par)\n\t\t\t\t\t{\n\t\t\t\t\t echo '<option selected=\"selected\" value=\"'.$sub_cat['cat_id'].'\" style=\"margin-left:'.Actions::$s*Actions::$r.'px;\">'.ucfirst($sub_cat['cat_title']).'</option>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t echo '<option value=\"'.$sub_cat['cat_id'].'\" style=\"margin-left:'.Actions::$s*Actions::$r.'px;\">'.ucfirst($sub_cat['cat_title']).'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\t\t\t\tActions::$r++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t Actions::viewCategoryUpdate($sub_cat['cat_id'],$par);\n\t\t\t\t\t }\n\t\t\t\t\t \t \t\n\t\t\t\t\t \n\t\t\t\t\n\t\t\t\t}\n\t\t\tActions::$r--;\t\n\n\t }", "function update(){\n\t\t// $update_query .= ' SET ';\n\t\t// $update_query .= ' name = \"'.$this->name.'\"';\n\t\t// $update_query .= ' WHERE category_id = '.$this->id;\n\n\t\t// $this->db->query($update_query);\n\t\t$this->db->update(\n\t\t\t'tb_pages',\n\t\t\tarray(\t\t\t\t\t\n\t\t\t'title' => $this->title,\n\t\t\t'content' => $this->content),\n\t\t\tarray('page_id' => $this->page_id)\n\t\t);\n\t}", "public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "function wp_set_link_cats($link_id = 0, $link_categories = array())\n {\n }", "public function actionUpdate($id)\n { \n $modelLink = new CategoriesLink();\n $modelCategory = new ProductsCategories();\n \n $link = $modelLink->findOne(['id' => $id]);\n \n if(!$link){\n throw new NotFoundHttpException('The requested link does not exist.');\n }\n \n $category = $modelCategory->findOne(['id' => $link->owner_category_id]);\n $menuMain = $modelCategory::getCategoriesRoots();\n \n if(!$category){\n throw new NotFoundHttpException('The requested product does not exist.');\n }\n \n if ($link->load(Yii::$app->request->post())) {\n \n if($link->save()){\n\n return $this->redirect(['index', 'category_id' => $category->id]);\n } else {\n return $this->render('update', [\n 'menuMain' => $menuMain,\n 'category' => $category,\n 'model' => $link,\n 'dataRequest' => Yii::$app->request->post(), \n ]);\n }\n } else {\n \n $categoryRoot = $modelCategory::getRootCategory($link->category_id);\n \n return $this->render('update', [\n 'menuMain' => $menuMain,\n 'category' => $category,\n 'model' => $link,\n 'dataRequest' => ['categoryRoot' => $categoryRoot->id], \n ]);\n }\n }", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "public function updated(Category $category)\n {\n //\n }", "static function add_category($menu_params) {\n\n // requiered parameters\n self::check_params(__CLASS__, __FUNCTION__, $menu_params, array(\n 'title' => 'Param is requiered!',\n 'category_id' => 'Param is requiered! - this is the category id that will be used to generate the mega menu',\n 'add_to_menu_id' => 'A menu id generated by ale_demo_menus::create_menu is requiered'\n ));\n\n\n $itemData = array(\n 'menu-item-title' => $menu_params['title'],\n 'menu-item-object-id' => $menu_params['category_id'],\n 'menu-item-db-id' => 0,\n 'menu-item-url' => get_category_link($menu_params['category_id']),\n 'menu-item-type' => 'taxonomy', //taxonomy\n 'menu-item-status' => 'publish',\n 'menu-item-object' => 'category',\n );\n\n if (!empty($menu_params['parent_id'])) {\n $itemData['menu-item-parent-id'] = $menu_params['parent_id'];\n }\n\n $menu_item_id = wp_update_nav_menu_item($menu_params['add_to_menu_id'], 0, $itemData);\n return $menu_item_id;\n }", "public function categorylist($c){\n $this->cat_id = $c; \n }", "function fm_update_folders_cats($catid) {\r\n\t// Changes all associated links to deleted cat to 0\r\n\tif ($linkcats = get_records('fmanager_folders', \"category\", $catid)) {\r\n\t\tforeach ($linkcats as $lc) {\t\t\r\n\t\t\t$lc->category = 0;\r\n\t\t\tif (!update_record('fmanager_folders', $lc)) {\r\n\t\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function updateCategory($id_category,$name_cate)\n\t\t{\n\t\t\t$sql = \"UPDATE tbl_category_products SET name_cate= :name_cate WHERE id_category = :id_category\";\n\t\t\t$pre = $this->pdo->prepare($sql);\n\n\t\t\t$pre->bindParam(':id_category', $id_category);\n\t\t\t$pre->bindParam(':name_cate', $name_cate);\n\n\t\t\treturn $pre->execute();\n\n\t\t}", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "public function updateCategory($parameters,$id)\n {\n \t $this->db->update('product_category', $parameters, array('product_id' => $id));\n return true;\n }", "public function update(Request $request ,Category $update){\n $update -> category_name_en = $request -> blog_category_name_en;\n $update -> category_name_lng = $request -> blog_category_name_lng;\n $update -> category_name_en_slug = strtolower(str_replace(' ' , '-' , $request -> blog_category_name_en));\n $update -> category_name_lng_slug = str_replace(' ' , '-' , $request -> blog_category_name_lng);\n $update -> update();\n return true;\n }", "public function setCategory($aId, $aCategory) {\n list($lId, $lCategory) = array(intval($aId), $aCategory);\n \n $lSql = 'SELECT count(*) FROM `al_cms_ref_category` WHERE `content_id`='.esc($lId);\n $lCount = CCor_Qry::getInt($lSql);\n if($lCount < 1) {\n // insert new category reference\n $lSql = 'INSERT INTO `al_cms_ref_category` (`content_id`, `category`) VALUES ('.esc($lId).', '.esc($lCategory).')';\n CCor_Qry::exec($lSql);\n }\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 }", "public function category_update(){ \n\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_UPDATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['parent'] = $this->input->post('parent');\n $data['last_modified'] = date(\"Y-m-d H:i:s\");\n $data['name'] = $this->input->post('name');\n \n if(!$this->category_model->is_parent_category($data['parent'])){\n\n $this->session->set_flashdata('category_save_failed', \"Failed to update sub category!!\");\n }else{\n\n \n $category_id = $this->input->post('cat_id');\n\n\n\n\n if($this->category_model->update_category($category_id, $data)){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_update') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('UPDATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' update a category.')\n ->log(); //Add Database Entry\n\n $this->session->set_flashdata('category_save_success', \"Category information Updated Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Category update fialied!!\");\n }\n }\n redirect(base_url('categories'));\n }", "FUNCTION Knowledge_update_Category( &$dbh,\n\t\t\t\t\t$aspid,\n\t\t\t\t\t$catid,\n\t\t\t\t\t$name,\n\t\t\t\t\t$display_order )\n\t{\n\t\tif ( ( $aspid == \"\" ) || ( $catid == \"\" )\n\t\t\t|| ( $name == \"\" ) )\n\t\t{\n\t\t\treturn false ;\n\t\t}\n\t\t$aspid = database_mysql_quote( $aspid ) ;\n\t\t$catid = database_mysql_quote( $catid ) ;\n\t\t$name = database_mysql_quote( $name ) ;\n\t\t$display_order = database_mysql_quote( $display_order ) ;\n\n\t\t$query = \"UPDATE chatkbcats SET name = '$name', display_order = '$display_order' WHERE catID = $catid AND aspID = '$aspid'\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t\n\t\tif ( $dbh[ 'ok' ] )\n\t\t{\n\t\t\treturn true ;\n\t\t}\n\t\treturn false ;\n\t}", "function EditarCategoria($params=null){\n $id_categoria= $params[':ID'];\n $this->modelo->GetCategoria($id_categoria);\n $this->vista->mostrarCategoriaEdit($id_categoria); \n }", "public function update_category ($data) {\n\t\t$slug = \\Illuminate\\Support\\Str::slug($data->category, '-');\n\t\t$category = Category::find($data->category_id);\n\t\t$category->category = $data->category;\n\t\t$category->slug = $slug;\n\t\t$category->description = $data->description;\n\n\t\t$category->save();\n\t\treturn true;\n\t}", "function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "public function testUpdateCategoryUsingPUT()\n {\n }", "function fm_update_category($name, $catid = NULL, $groupid = 0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($catid != NULL) {\r\n\t\t$update->id = $catid;\r\n\t\t$update->name = $name;\r\n\t\t$update->timemodified = time();\r\n\t\tif (!update_record('fmanager_categories', $update)) {\r\n\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\t$new->name = $name;\r\n\t\tif ($groupid == 0){\r\n\t\t\t$new->owner = $USER->id;\r\n\t\t\t$new->ownertype = OWNERISUSER;\r\n\t\t} else {\r\n\t\t\t$new->owner = $groupid;\r\n\t\t\t$new->ownertype = OWNERISGROUP;\r\n\t\t}\r\n\t\t$new->timemodified = time();\r\n\t\tif (!insert_record('fmanager_categories', $new)) {\r\n\t\t\terror(get_string(\"errnoinsert\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "public function update(){\n $facebook = $_POST['facebook'];\n $linkedin = $_POST['linkedin'];\n $twitter = $_POST['twitter'];\n $youtube = $_POST['youtube'];\n $id = $_POST['hiddenid'];\n\t\t $sql= $this->link->query(\"UPDATE category SET facebook='$facebook',linkedin='$linkedin',twitter='$twitter ',youtube='$youtube' WHERE id=$id\");\n if($sql){\n\t\t echo \"<script>alert('Link Update')</script>\";\n\t\t echo \"<script>window.location.href = './social.php'</script>\";\n exit;\n\t }\n\t}", "function update_categoria($idcategoria,$params)\n {\n $this->db->where('idcategoria',$idcategoria);\n return $this->db->update('categoria',$params);\n }", "function showSubCategoryUpdate($par_id)\n\t {\n\t\t\n\t\t $prolist=new Actions();\n\t\t $res=$prolist->fetchAll(\"category\");\n\t\t\t\t\t\t\n\t\t $parentdata=mysql_query(\"select * from category where cat_par_id='0'\");\n\t\t \n\t\t if($par_id==0)\n\t\t {\n\t\t\techo '<option selected=\"selected\" value=\"0\">Parent</option>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t }\n\t\t else\n\t\t {\n\t\t \techo '<option value=\"0\">Parent</option>';\n\t\t }\n\t\t \n\t\t while($parent_sub_cat=mysql_fetch_array($parentdata))\n\t\t {\n\t\t\t if($parent_sub_cat['cat_id']==$par_id)\n\t\t\t {\n\t\t\t\t\techo '<option selected=\"selected\" value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\techo '<option value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\n\t\t\t }\n\t\t\t\t\t\n\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$parent_sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\tActions::$r++;\n\t\t\t\tActions::viewCategoryUpdate($parent_sub_cat['cat_id'],$par_id);\n\t\t\t } \n\t\t\t \n\t\t }\t\t\t\t\t\t\n\t\t \n\t }", "public function update()\n {\n $category = CategoryService::load(\\Request::input('id'))->update(\\Request::all());\n \\Msg::success($category->name . ' has been <strong>updated</strong>');\n return redir('account/categories');\n }", "function set_rights_of_cat($p_catid, $p_suggest_right, $p_suggest_group_right, &$p_changed){\n// Hauptprozedur. Diese wird aufgerufen um die Rechte einer Kategorie zu setzen, inklusive deren Unterkategorien.\n// $p_catid = KategorienID, welche gesetzt werden soll.\n// $p_suggested_right = Die rechte welche gesetzt werden sollen.\n// $p_changed = Anzahl der Korrekturen oder (-1): Gewuenschte aenderung war nicht zulaessig! \n $database = &JFactory::getDBO();\n // Kategorie laden aus Datenbank.\n $l_sql = \"SELECT parent_id, cat_access, cat_group_access FROM #__jdownloads_cats WHERE cat_id = \".$p_catid;\n $database->setQuery($l_sql);\n $l_catrow = $database->loadObjectList();\n if (!isset($l_catrow[0]) && ($p_catid > 0)){\n // Die Kategorie existiert nicht. Nicht weiterfahren.\n return '';\n }\n // Urspruengliche Rechte der Kategorie lesen.\n $l_rights_from = $l_catrow[0]->cat_access;\n //$l_rights_from_group = $l_catrow[0]->cat_group_access;\n if ($l_catrow[0]->parent_id == 0){\n // Es ist eine Hauptkategorie. Darueberliegende Kategorien muessen nicht nach niedrigen Rechten durchsucht werden.\n $l_rights_to_set = $p_suggest_right;\n } else {\n // Es ist eine Unterkategorie. Darueberliegenden Kategoriebaum nach niedrigen Rechten (=hoeherer Wert) durchsuchen.\n // Damit wird gewaehrleitet, dass eine Unterkategorie keine hoeheren Rechte erhalten kann.\n $l_rights_to_set = get_lowest_rights($p_catid, $p_suggest_right);\n if ($l_rights_to_set > $p_suggest_right) $p_changed = -1;\n }\n // Die Rechte der Kategorie und aller Unter- und Unter-Unter-Kategorien setzen.\n set_rights_to_tree($p_catid, $l_rights_to_set, $l_rights_from, $p_suggest_group_right, $p_changed);\n}", "function multi_entry_category_update()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ($this->input->get_post('entry_ids') === FALSE OR $this->input->get_post('type') === FALSE)\n\t\t{\n\t\t\treturn $this->dsp->no_access_message($this->lang->line('unauthorized_to_edit'));\n\t\t}\n\n\t\tif ($this->input->get_post('category') === FALSE OR ! is_array($_POST['category']) OR count($_POST['category']) == 0)\n\t\t{\n\t\t\treturn $this->output->show_user_error('submission', $this->lang->line('no_categories_selected'));\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/**\t Fetch categories\n\t\t/** ---------------------------------*/\n\n\t\t// We do this first so we can destroy the category index from\n\t\t// the $_POST array since we use a separate table to store categories in\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\n\t\tforeach ($_POST['category'] as $cat_id)\n\t\t{\n\t\t\t$this->api_channel_categories->cat_parents[] = $cat_id;\n\t\t}\n\n\t\tif ($this->api_channel_categories->assign_cat_parent == TRUE)\n\t\t{\n\t\t\t$this->api_channel_categories->fetch_category_parents($_POST['category']);\n\t\t}\n\n\t\t$this->api_channel_categories->cat_parents = array_unique($this->api_channel_categories->cat_parents);\n\n\t\tsort($this->api_channel_categories->cat_parents);\n\n\t\tunset($_POST['category']);\n\n\t\t$ids = array();\n\n\t\tforeach (explode('|', $_POST['entry_ids']) as $entry_id)\n\t\t{\n\t\t\t$ids[] = $this->db->escape_str($entry_id);\n\t\t}\n\n\t\tunset($_POST['entry_ids']);\n\n\t\t$entries_string = implode(\"','\", $ids);\n\n\t\t/** -----------------------------\n\t\t/**\t Get Category Group IDs\n\t\t/** -----------------------------*/\n\t\t$query = $this->db->query(\"SELECT DISTINCT exp_channels.cat_group FROM exp_channels, exp_channel_titles\n\t\t\t\t\t\t\t WHERE exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t\t\t\t AND exp_channel_titles.entry_id IN ('\".$entries_string.\"')\");\n\n\t\t$valid = 'n';\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $query->row('cat_group') );\n\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\treturn $this->dsp->show_user_error($this->lang->line('no_category_group_match'));\n\t\t}\n\n\t\t/** -----------------------------\n\t\t/**\t Remove Valid Cats, Then Add...\n\t\t/** -----------------------------*/\n\n\t\t$valid_cat_ids = array();\n\t\t$query = $this->db->query(\"SELECT cat_id FROM exp_categories\n\t\t\t\t\t\t\t WHERE group_id IN ('\".implode(\"','\", $valid_cats).\"')\n\t\t\t\t\t\t\t AND cat_id IN ('\".implode(\"','\", $this->api_channel_categories->cat_parents).\"')\");\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM exp_category_posts WHERE cat_id = \".$row['cat_id'].\" AND entry_id IN ('\".$entries_string.\"')\");\n\t\t\t\t$valid_cat_ids[] = $row['cat_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->input->get_post('type') == 'add')\n\t\t{\n\t\t\t$insert_cats = array_intersect($this->api_channel_categories->cat_parents, $valid_cat_ids);\n\t\t\t// How brutish...\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t\tforeach($insert_cats as $val)\n\t\t\t\t{\n\t\t\t\t\t$this->db->query($this->db->insert_string('exp_category_posts', array('entry_id' => $id, 'cat_id' => $val)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/** ---------------------------------\n\t\t/**\t Clear caches if needed\n\t\t/** ---------------------------------*/\n\n\t\tif ($this->config->item('new_posts_clear_caches') == 'y')\n\t\t{\n\t\t\t$this->functions->clear_caching('all');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->functions->clear_caching('sql');\n\t\t}\n\t\t\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('multi_entries_updated'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}", "function process_edit_category($parent_id, $title, $alias, $description, $date_add, $date_modify, $enabled, $id){\n\t\t $sql = \" Update category SET\n\t\t\t\t\t `parent_id` = ?, \n\t\t\t\t\t `title` = ?, \n\t\t\t\t\t `alias` = ?, \n\t\t\t\t\t `description` = ?, \n\t\t\t\t\t `date_add` = ?, \n\t\t\t\t\t `date_modify` = ?, \n\t\t\t\t\t `enabled` = ?\n\t\t\t\t WHERE cat_id = ?\";\n\t\t if($this->dbObj->SqlQueryInputResult($sql, array($parent_id, $this->dbObj->fix_quotes_dquotes($title), $alias, $description, $date_add, $date_modify, $enabled, $id)) <> FALSE){\n\t\t\t return true;\n\t\t }\n\t }", "public function setUpdateCategory(?UpdateCategory $value): void {\n $this->getBackingStore()->set('updateCategory', $value);\n }", "function modifyCategory()\n{\n global $connection;\n if (isset($_POST['modifyBtn'])) {\n $categoria_id = $_POST['categoria_id'];\n\n $categoria_nome = str_replace([\"'\", '’', '“', '”'], [\"\\'\", \"\\'\", \"\\'\", \"\\'\"], $_POST['categoria_nome']);\n\n $query_update = \"UPDATE video_category SET category_video='$categoria_nome' WHERE id_category='$categoria_id'\";\n $result_update = mysqli_query($connection, $query_update);\n if ($result_update) {\n return header('Location: video_categorie.php?modify=true');\n } else {\n return header('Location: video_categorie.php?modify=false');\n }\n }\n}", "public function update(UpdateCategoryRequest $request)\n {\n $category = Apiato::call('Category@UpdateCategoryAction', [$request]);\n\n // ..\n }", "function editMainCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$sql1 = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t\t$query1 = new Bin_Query();\n\t\t\n\t\t\t$query1->executeQuery($sql1);\n\t\t\n\n\t\t\treturn Display_DManageProducts::displayCategory($query1->records,$query->records[0]['category_id']);\n\t\t\t\n\t\t// \t\t\treturn $category;\n\t }\n\t}", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "public function updateCategory(array $data, int $id): void\n {\n }", "public function update(Request $request, Category $category)\n {\n $this->validate($request, [\n 'name' => 'required|max:191',\n // 'parent_id' => 'required|not_in:0',\n 'image' => 'mimes:jpg,jpeg,png|max:1000'\n ]);\n\n $params = $request->except('_token');\n $collection = collect($params);\n\n if ($collection->has('image') && ($params['image'] instanceof UploadedFile)) {\n if ($category->image != null) {\n $this->deleteOne($category->image);\n }\n $image = $this->uploadOne($params['image'], 'categories');\n } else {\n $image = null;\n }\n\n $featured = $collection->has('featured') ? 1 : 0;\n $menu = $collection->has('menu') ? 1 : 0;\n $merge = $collection->merge(compact('menu', 'image', 'featured'));\n $category->update($merge->all());\n\n return redirect(route('admin.categories.index'))->with('success', 'Category Updated Successfully!');\n }", "public function updated(BlogCategory $blogCategory)\n {\n //\n }", "public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function update(Category $category, Request $request, CategoryRequest $categoryRequest)\n {\n $category->title = $request->get('title');\n $category->alias = $request->get('alias');\n $category->parent_id = $request->get('parent_id');\n $category->save();\n\n if ($request->get('property')) {\n foreach ($request->get('property') as $key => $property) {\n Property::where('id', $key)\n ->update(['name' => $property]);\n }\n }\n\n if ($request->get('subproperty')) {\n $data = [];\n foreach ($request->get('subproperty') as $key => $property) {\n foreach ($property as $key1 => $subProperty) {\n SubProperty::where('id', $key1)\n ->update(['name' => $subProperty]);\n }\n }\n SubProperty::insert($data);\n }\n\n $categoryRequest->createProperties($category->id);\n\n if ($request->get('new_subproperty')) {\n $data = [];\n foreach ($request->get('new_subproperty') as $key => $property) {\n foreach ($property as $newSubproperty) {\n $data[] = [\n 'name' => $newSubproperty,\n 'property_id' => $key,\n ];\n }\n }\n SubProperty::insert($data);\n }\n\n $properties = Property::where('category_id', $category->id)\n ->with('subProperties')\n ->get();\n\n return response()->json([\n 'message' => 'Категорията беше успешно редактирана.',\n 'content' => view('admin.categories.edit-content', [\n 'categories' => Category::all(),\n 'category' => $category,\n 'properties' => $properties,\n 'route' => route('categories.update', $category),\n ])->render(),\n ]);\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function update(Request $request){\n // chake the validation \n\n $validation = $this->chakeValidation($request);\n if($validation->passes()){\n\n //update the Data \n $menu= MemberCategory::find($request->memberCategoryId);\n $menu->categoryHeadding = $request->categoryHeadding;\n $menu->categoryTitle = $request->categoryTitle;\n $menu->position = $request->position;\n $menu->publicationStatus = $request->publicationStatus;\n $menu->save();\n // return to the manage file with value\n return redirect('/member.category.manage')->with('message', 'Team Member Category Information Update SuccessFully !');\n }else{\n return redirect('/member.category.edit')\n ->withErrors($validatoion) \n ->withInput();\n }\n }", "function move_category($src_category_id, $dest_category_id) {\n\t\t$src_category_id = olc_db_prepare_input($src_category_id);\n\t\t$dest_category_id = olc_db_prepare_input($dest_category_id);\n\t\tolc_db_query(\"SQL_UPDATE \".TABLE_CATEGORIES.\"\n\t\t\t\t \t SET parent_id = '\".olc_db_input($dest_category_id).\"', last_modified = now() \n\t\t\t\t \t WHERE categories_id = '\".olc_db_input($src_category_id).\"'\");\n\t}", "public function editAction($cat_id)\n\t{\n\t\t$this->oView->box_title = \"Edit Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\t\t\t\t\n\t\t$this->oView->link_url = site_url('dashboard/category/edit/'.$cat_id);\n\t\t$this->oView->cat_id = $cat_id;\n\t\t\n\t\t$objCat = new Category();\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\n\t\t\t$objCat->update($cat_id,$data);\n\t\t\n\t\t}\n\n\t\t$rowCat = $objCat->get($cat_id);\n\t\t\n\t\t$rowParentCat = $objCat->get($rowCat['parent_id']);\n\t\t$rowCat['parent_code'] = $rowParentCat['code'];\n\t\tif ($rowParentCat['code'] == 0) \n\t\t\t$rowCat['parent_code'] = \"ROOT\";\n\t\t\n\t\t$this->oView->rowCat = $rowCat;\t\t\n\t\t\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function update(Request $request, PageCategory $category)\n {\n// $this->validate($request, [\n// 'name'=>'required|max:120|unique:page_categories,id,' . $category->id,\n// ]);\n\n $category->main_page_category_id = $request->input('main_page_category_id') ? :null;\n $category->save();\n\n foreach (\\Loc::getLocales() as $locale){\n\n if($request->input('name.'.$locale->code) == \"\"){\n continue;\n }\n\n $category->setActiveLocale($locale->code);\n $category->name = $request->input('name.'.$locale->code);\n $category->slug = str_slug($request->input('name.'.$locale->code));\n $category->save();\n }\n\n return redirect()->route(\"backend.page.category.edit\", ['page_category' => $category->id])->withSuccess( __('backend.save_success') );\n }", "function update_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function update()\n {\n $model = $this->model()::findOrFail(request('_id'));\n $data = array_merge(request()->all(), ['slug' => request('name')]);\n $category = $model->update($data);\n return redirect()->route('admin.'.$this->table().'.index');\n }", "protected function updateCategory($req){\n if(!empty($req['parent_id'])){\n $parent_id = $req['parent_id'];\n }else{\n $parent_id=\"0\";\n }\n if(isset($req['cat_image']) && !isset($req['banner_image'])){\n $cat_image_path=public_path('category_images/Normal');\n $sort = $req['sort'];\n $cat_file_name=$this->fileUploading($cat_image_path,$req['cat_image']);\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'thumb_image'=>$cat_file_name,\n 'sort_order' => $sort,\n 'updated_at'=>date('Y-m-d H:i:s'));\n \n }\n else if(isset($req['banner_image']) && !isset($req['cat_image'])){\n $cat_banner_image=public_path('category_images/Banner');\n $banner_file_name=$this->fileUploading($cat_banner_image,$req['banner_image']);\n $sort = $req['sort'];\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'banner_image'=> $banner_file_name,\n 'sort_order' => $sort,\n 'updated_at'=>date('Y-m-d H:i:s'));\n }\n else if(isset($req['banner_image']) && isset($req['cat_image'])){\n $cat_image_path=public_path('category_images/Normal');\n $cat_file_name=$this->fileUploading($cat_image_path,$req['cat_image']);\n $sort = $req['sort'];\n $cat_banner_image=public_path('category_images/Banner');\n $banner_file_name=$this->fileUploading($cat_banner_image,$req['banner_image']);\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'thumb_image'=>$cat_file_name,\n 'banner_image'=> $banner_file_name,\n 'sort_order' => $sort,\n 'updated_at'=>date('Y-m-d H:i:s'));\n }else{\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'sort_order' => $req['sort'],\n 'updated_at'=>date('Y-m-d H:i:s'));\n }\n \n \n if($parent_id != \"0\"){\n $attribute_subcat_id = \"\";\n if($parent_id == 147){\n $attribute_subcat_id = 25;\n }elseif ($parent_id == 143) {\n $attribute_subcat_id = 26;\n }elseif ($parent_id == 78) {\n $attribute_subcat_id = 28;\n }\n $attr_arr=array(\n 'attribute_id'=>$attribute_subcat_id,\n 'option_value'=> $req['name'],\n );\n\n $isAttrExist = DB::table('attribute_options')->where('option_value', $req['name'])->first();\n if(!$isAttrExist){\n $cosplay_yes_insert=DB::table('attribute_options')->insert($attr_arr);\n }\n } \n \n $cond = array('category_id'=>$req['category_id']);\n Site_model::update_data('category',$category,$cond);\n \n if(isset($req['costume_list']) && $parent_id!=\"0\"){\n Site_model::delete_single('costume_to_category',$cond);\n foreach(array_unique($req['costume_list']) as $key=>$value){\n DB::table('costume_to_category')\n ->where('costume_id', $value)\n ->where('category_id', '!=', $req['category_id'])\n ->delete();\n $category_coustume=array('costume_id'=>$value,\n 'category_id'=>$req['category_id'],\n 'sort_no'=>$key,\n );\n Site_model::insert_get_id('costume_to_category',$category_coustume);\n }\n }\n $this->urlRewrites($req['category_id'],\"update\",$req['old_category'],$req['name'],$req['elements_change']);\n return true;\n }", "public function setCategoryId($categoryId);", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function updateCategory(){\n\t\t \n\t\t$file_id = $this->category_model->updateCategory($_POST['id'],$_POST['name']);\n\t\t echo $file_id;\n\t\t\t\t\n }", "public function update(Request $request, Category $category)\n {\n if (Auth::user()->cant('update', $category)) {\n return redirect()->route('admin.home')->with(['message'=>'You don\\'t have permissions']);\n }\n $rules = [\n 'name' => 'required',\n 'url' => 'required|unique:categories,url,'.$category->id\n /*'url' => [\n 'required',\n Rule::unique('categories')->ignore($category->id)\n ]*/\n ];\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return redirect()->route('categories.edit', ['id'=>$category->id])->withErrors($validator)->withInput();\n }\n\n $category->name = $request->get('name');\n $category->url = $request->get('url');\n $category->enabled = $request->filled('enabled');\n $category->meta_title = $request->get('meta_title');\n $category->meta_keywords = $request->get('meta_keywords');\n $category->meta_description = $request->get('meta_description');\n $category->short_text = $request->get('short_text');\n $category->full_text = $request->get('full_text');\n $category->save();\n return redirect()->route('categories.edit', ['id'=>$category->id]);\n }", "public function categoryUpdated($categoryId, $categoryName, $type = 'all')\n {\n $key = 'getCategoryByName' . $categoryName . $categoryId . language;\n // self::$cache->delete($key);\n }", "public static function modifyCategory($categoryId,$categoryName)\n\t{\n\t\t\t$category = Category::find($categoryId);\n\t\t\t$category->categoryName = $categoryName;\n\t\t\t$category->save();\n\t}", "public function run_change_cat($cat,$id){\n\n\t\t$sql = \"UPDATE `categories` SET `cat` = '$cat' WHERE `id` = $id\";\n\n\t\t\t$this->query($sql);\n\t}", "public function updateAction()\n\t{\n\t\t$this->view->disable();\n\t\t$status = array('status' => 'false','messages' => array());\t\n\t\tif ($this->request->isPost()) \n\t\t{\n\t\t\t$post = $this->request->getPost();\n\t\t\t\n\t\t\t/* SAVE THE CATEGORY RELATIONSHIPS START */\n\t\t\tif(isset($post['relaties_beheerder']))\n\t\t\t{\n\t\t\t\t$beheerders = $post['relaties_beheerder'];\n\t\t\t\tif($beheerders)\n\t\t\t\t{\n\t\t\t\t\tforeach($beheerders as $beheerder)\n\t\t\t\t\t{\n\t\t\t\t\t\t$acl = new Acl();\n\t\t\t\t\t\t$acl->id = $this->uuid();\n\t\t\t\t\t\t$acl->entity = 'category';\n\t\t\t\t\t\t$acl->userid = $beheerder;\n\t\t\t\t\t\t$acl->clearance = 900;\n\t\t\t\t\t\t$acl->entityid = $post['id'];\n\t\t\t\t\t\tif($acl->save())\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\tforeach ($acl->getMessages() as $message)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo 'ACL1:'.$message;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isset($post['relaties_leden']))\n\t\t\t{\n\t\t\t\t$leden = $post['relaties_leden'];\n\t\t\t\tif($leden)\n\t\t\t\t{\n\t\t\t\t\tforeach($leden as $lid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$acl = new Acl();\n\t\t\t\t\t\t$acl->id = $this->uuid();\n\t\t\t\t\t\t$acl->entity = 'category';\n\t\t\t\t\t\t$acl->userid = $lid;\n\t\t\t\t\t\t$acl->clearance = 400;\n\t\t\t\t\t\t$acl->entityid = $post['id'];\n\t\t\t\t\t\tif($acl->save())\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\tforeach ($acl->getMessages() as $message)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo 'ACL2:'.$message;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* SAVE THE CATEGORY RELATIONSHIPS END */\t\n\t\t}\n\t\techo json_encode($status);\n\t}", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function view_update_catagories(){\n global $connection;\n\n // if the update variable has been set (url with ?update=cat_id at the end)\n if(isset($_GET['update'])){ \n \n //get the variable from the generated url\n $cat_id = $_GET['update']; \n // echo \"yes: \" . $cat_id;\n\n // create query to find the catagory with the correct id\n $query = \"SELECT * FROM catagories WHERE cat_id = $cat_id\";\n \n // send query to run in mysql database - returning data is put into varaible\n $select_catagories_id = mysqli_query($connection,$query);\n\n // Go through array and assing varaible names to array data\n while($row = mysqli_fetch_assoc($select_catagories_id)){\n $cat_id = $row['cat_id']; \n $cat_title = $row['cat_title'];\n echo $cat_title;\n }\n }\n}", "public function setUpdateCategory($val)\n {\n $this->_propDict[\"updateCategory\"] = $val;\n return $this;\n }", "function ac_change_post_query( $args ) {\n $args['category_name'] = 'mango';\n return $args;\n}", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "function editCategory($category, $id) {\n $data = [\n 'name' => $_POST['name'],\n 'description' => $_POST['description']\n ];\n\n $stmt = $category->update($id, $data);\n header('location: confirm.php?action=Category&type=update&query='.$stmt);\n}", "public function UpdatePost_Category(Request $request){\n $postId = Post::query()->find($request->postID);\n $postId->categories()->detach($request->OldcategoryId);\n $postId->categories()->attach($request->categoryId); \n\n }", "function fm_update_shared_cats($catid) {\r\n\r\n\tif ($sharedlinks = get_records('fmanager_shared', \"sharedlink=$catid AND type\", STYPE_CAT)) {\r\n\t\tforeach ($sharedlinks as $sl) {\t\t\r\n\t\t\tif (!delete_records('fmanager_shared', \"id\", $sl->id)) {\r\n\t\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function setCategory($id, $category){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//category value of a question in the database\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Accepts 2 parameters, the question ID value, and the new value (int)\r\n\t\t$query= \"UPDATE `tbl_question` SET `category` = '$category' WHERE `tbl_question`.`question_id` =$id LIMIT 1 ;\";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while updating the data');\r\n\t\tif(MDB2::isError($result)){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\t\r\n\t}", "public function update(ProductCategory $productCategory):void \n {\n // Generate the query\n $sql = \"UPDATE product_categories\n SET name = :name,\n status = :status\n WHERE id = :id\";\n \n // Open the connection\n $pdo = DbConfig::getPdo();\n \n // Execute the query\n $stmt = $pdo->prepare($sql);\n $stmt->execute([\n ':name' => $productCategory->getName(),\n ':status' => $productCategory->getStatus(),\n ':id' => $productCategory->getId()\n ]);\n \n // Close the connection\n $pdo = null; \n }", "public function setCmsCategoryId($val){\n $this->CmsCategoryId=$val;\n }", "public function multi_entry_category_update()\n {\n // Does the user have permission?\n if ( !ee()->publisher_helper->allowed_group('can_access_content'))\n {\n show_error(lang('unauthorized_access'));\n }\n\n $entries = ee()->input->post('entry_ids', TRUE);\n $cat_ids = ee()->input->post('category', TRUE);\n $type = ee()->input->post('type', TRUE);\n $entry_ids = array();\n\n if ( !$entries || !$type)\n {\n show_error(lang('unauthorized_to_edit'));\n }\n\n if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids))\n {\n return ee()->output->show_user_error('submission', lang('no_categories_selected'));\n }\n\n // For the entries affected, sync publisher_category_posts to category_posts\n\n foreach (explode('|', trim($entries)) as $entry_id)\n {\n $entry_ids[] = $entry_id;\n }\n\n // default states\n $default_language_id = ee()->publisher_model->default_language_id;;\n $default_view_status = ee()->publisher_setting->default_view_status();\n $states = array();\n\n foreach($entry_ids as $entry_id)\n {\n // we'll always have a state for the default language and status\n $states = array(array(\n 'publisher_lang_id' => $default_language_id,\n 'publisher_status' => $default_view_status\n ));\n\n if ($type == 'add')\n {\n // Adding categories\n // ----------------------------------------------------------------\n\n // We want to add categories to all the open and draft versions\n // of an entry without changing existing category selections\n\n // for each entry, look up existing distinct states\n $query = ee()->db->distinct()\n ->select('publisher_lang_id, publisher_status')\n ->where('entry_id', $entry_id)\n ->get('publisher_titles');\n\n if ($query->num_rows() > 0)\n {\n $result = $query->result_array();\n\n foreach($result as $row)\n {\n if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status))\n {\n $states[] = array(\n 'publisher_lang_id' => $row['publisher_lang_id'],\n 'publisher_status' => $row['publisher_status']\n );\n }\n }\n }\n\n // build an an array of records to insert into publisher_category_posts\n $data = array();\n\n foreach($states as $state)\n {\n // add the new categories\n foreach($cat_ids as $cat_id)\n {\n $data[] = array(\n 'entry_id' => $entry_id,\n 'cat_id' => $cat_id,\n 'publisher_lang_id' => $state['publisher_lang_id'],\n 'publisher_status' => $state['publisher_status']\n );\n }\n }\n\n // delete any relationships with the newly added categories that already exist\n // for this entry so that we don't end up with duplicate rows\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n\n // (re)insert the categories with the appropriate states\n ee()->db->insert_batch('publisher_category_posts', $data);\n }\n\n elseif($type == 'remove')\n {\n // Removing categories\n // ----------------------------------------------------------------\n\n // we're simply removing the selected categories from all versions of the entry\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n }\n }\n }", "public function update(CategoryRequest $request, $id)\n {\n $cat= MenuCategories::find($id);\n $cat->title = $request->name;\n $cat->save();\n session()->flash('alert_message', ['message'=>\"Success\", 'icon'=>'success']); \n\n return redirect('dashboard/category');\n }", "public static function updateCategory($a_obj)\n\t{\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarCategory.php');\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarAppointmentColors.php');\n\t\t\n\t\tif($cat = ilCalendarCategory::_getInstanceByObjId($a_obj->getId()))\n\t\t{\n\t\t\t$cat->setTitle($a_obj->getTitle());\n\t\t\t$cat->update();\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.6637239", "0.6608738", "0.6410886", "0.6363308", "0.6350768", "0.6263358", "0.62329215", "0.61355865", "0.610269", "0.60900724", "0.6084934", "0.6017539", "0.59868145", "0.5952465", "0.5940639", "0.5927756", "0.59276575", "0.5925042", "0.5905844", "0.58961517", "0.58833265", "0.58802617", "0.5868064", "0.58644056", "0.5858704", "0.58300805", "0.582375", "0.5807102", "0.57873476", "0.57819027", "0.57692665", "0.576753", "0.57607585", "0.5732115", "0.5722808", "0.5715935", "0.57146543", "0.5694813", "0.569463", "0.5677272", "0.5654942", "0.5646895", "0.56351376", "0.5634348", "0.5632813", "0.56151676", "0.5605754", "0.5603135", "0.55838686", "0.5583476", "0.55728406", "0.557175", "0.5565127", "0.556319", "0.5539464", "0.5538736", "0.5535377", "0.5526693", "0.551069", "0.5510059", "0.5501158", "0.5500721", "0.54905397", "0.5486789", "0.5485318", "0.5480892", "0.54737955", "0.54708284", "0.546742", "0.54606944", "0.54587233", "0.5449251", "0.5447309", "0.54333884", "0.5426597", "0.5407031", "0.5406511", "0.5404872", "0.54030764", "0.5400029", "0.5395493", "0.5389184", "0.5389184", "0.5389184", "0.5389184", "0.5389184", "0.5389184", "0.5389184", "0.5389184", "0.5389184", "0.5389184", "0.53888303", "0.53844833", "0.5382331", "0.53778434", "0.53762454", "0.5373488", "0.5372888", "0.5372103", "0.53577477" ]
0.7517595
0
Make parent child tree. (every category has a children array that contains his children).
public function makeChildrenTree($categories) { $tmp = []; foreach ($categories as $key => $category){ if(!key_exists('children', $category)) { $category->children = []; } // get children $children = $this->getChildren($category->categoryID); // call self to get a loop until every category has his children $category->children = $this->makeChildrenTree($children); $tmp[] = $category; } return Language::filterRows($tmp, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildParentsChildrenCategoriesHierarchy(): array\n {\n $categoriesDepths = $this->buildCategoriesDepths();\n $parentsChildrenDtos = [];\n $skippedCategoriesIds = [];\n\n foreach( $categoriesDepths as $categoryId => $depth ){\n\n $category = $this->app->repositories->myNotesCategoriesRepository->find($categoryId);\n $categoryId = $category->getId();\n\n $childCategoriesIds = $this->app->repositories->myNotesCategoriesRepository->getChildrenCategoriesIdsForCategoriesIds([$categoryId]);\n $parentChildDto = $this->buildParentChildDtoForHierarchy($category, $depth);\n\n //if we have a children then we already added it to parent so we don't want it as separated being\n $skippedCategoriesIds = array_merge($skippedCategoriesIds, $childCategoriesIds);\n\n if( in_array($categoryId, $skippedCategoriesIds) ){\n continue;\n }\n\n $parentsChildrenDtos[] = $parentChildDto;\n }\n\n // sort alphabetically by name\n uasort($parentsChildrenDtos, fn(ParentChildDTO $currentElement, ParentChildDTO $nextElement) =>\n $currentElement->getName() > $nextElement->getName()\n );\n\n return $parentsChildrenDtos;\n }", "public function get_child_ids($parent = 0)\n\t{\n\t\t// First we get all the categories and store it.\n\t\tif (empty($this->_all_cats))\n\t\t{\n\t\t\t$this->_ci->db->select('cat_id,cat_parent')\n\t\t\t\t\t\t->from('categories')\n\t\t\t\t\t\t->where('cat_display', 'yes');\n\t\t\t$query = $this->_ci->db->get();\n\n\t\t\tif ($query->num_rows() == 0) \n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t} \n\n\t\t\t$this->_all_cats = $query->result_array();\n\t\t}\n\t\t\n\t\tforeach ($this->_all_cats as $row)\n\t\t{\n\t\t\t// This assigns all the fields to the array.\n\t\t\tforeach ($row AS $key => $val)\n\t\t\t{\n\t\t\t\t$arr[$key] = $val;\n\t\t\t}\n\t\t\t\n\t\t\t$menu_array[$row['cat_id']] = $arr;\n\t\t}\n\t\t\n\t\tunset($arr);\n\t\t\n\t\tforeach($menu_array as $key => $val)\n\t\t{\n\t\t\t// Now add any children.\n\t\t\tif ($parent == $val['cat_parent'] OR $parent == $val['cat_id'])\n\t\t\t{\n\t\t\t\t$depth = 0;\n\t\t\t\tif ( ! in_array($val['cat_id'], $this->_cat_ids, TRUE)) \n\t\t\t\t{\n\t\t\t\t\t$this->_cat_ids = array_merge(array($val['cat_id']),$this->_cat_ids);\n\t\t\t\t\t$this->_child_subtree($key, $menu_array, $depth);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "function list_to_tree($category = array(),\n\t\t$idField = 'id',$parentField='parent_id'){\n\tif(!is_array($category)) exit(\"配列ではありません\");\n\n\t$index = array();\n\t$tree = array();\n\n\tforeach($category as $value){\n\t\t$id = $value[$idField];\n\t\t$parent = $value[$parentField];\n\n\t\tif(isset($index[$id])){\n\t\t\t$value['child'] = $index[$id]['child'];\n\t\t\t$index[$id] = $value;\n\n\t\t} else {\n\t\t\t$index[$id] = $value;\n\t\t}\n\n\t\tif($parent == 0){\n\t\t\t$tree[] =& $index[$id];\n\n\t\t} else {\n\t\t\t$index[$parent]['child'][] =& $index[$id];\n\t\t}\n\n\n\t}\n\treturn $tree;\n}", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function createTree($categories)\n{\n $tree = [];\n\n foreach ($categories as $category) {\n if (empty($category[\"parent_uid\"])) {\n $tree[] = $category;\n unset($category);\n }\n }\n\n // уровень вложенности 2\n foreach ($tree as &$itemTree) {\n foreach ($categories as $category) {\n /* if(!empty($category[\"parent_uid\"])) {\n print_r($itemTree);\n print_r($category);\n echo \"\\n\";\n echo \"tree:\\n\";\n print_r($itemTree[\"uid\"]);\n echo \"\\n category\";\n print_r($category[\"parent_uid\"]);\n exit();\n }*/\n if ($itemTree[\"uid\"] == $category[\"parent_uid\"]) {\n $itemTree[\"categories\"] = $category;\n unset($category);\n }\n }\n }\n\n return $tree;\n}", "private static function getParentChildren():array\n {\n $parentChildren = [];\n $categories = self::select('*')->get()->toArray();\n\n foreach ($categories as $id){\n $children = [];\n foreach ($categories as $row){\n if ($id['id'] == $row['parent_id']){\n $children[] = $row['id'];\n }\n }\n $parentChildren[$id['id']] = $children;\n }\n\n return $parentChildren;\n\n }", "public static function createTree(&$list, $parent){\n\t\t$tree = array();\n\t\tforeach ($parent as $k=>$l){\n\t\t\tif(isset($list[$l['id']])){\n\t\t\t\t$l['children'] = createTree($list, $list[$l['id']]);\n\t\t\t}\n\t\t\t$tree[] = $l;\n\t\t}\n\t\treturn $tree;\n\t}", "static public function getCategoryTree() {\n $rows = self::find()\n ->where(['!=', 'id', 1]) // exclude root category\n ->andWhere(['=', 'status', self::STATUS_SHOW]) // exclude hidden\n ->orderBy(['tree' => SORT_ASC, 'lft' => SORT_ASC])\n ->all();\n \n // build tree\n $result = [];\n $last_parent_id = null;\n foreach($rows as $row) {\n if($row['depth'] == 1) { // parent\n $last_parent_id = $row['id'];\n $result[$last_parent_id] = [\n 'parent' => $row,\n 'childs' => []\n ];\n\n continue;\n }\n\n // childs\n $result[$last_parent_id]['childs'][$row->id] = $row;\n }\n return $result;\n }", "protected function _addChildren($parent_cat_id,$checked_cat = 0)\n\t{\n\t\t$collection = $this->getCollection();\n\t\t\n\t\tif (is_null($parent_cat_id))\n\t\t{\n\t\t\t//Level one categories\n\t\t\t$collection->addFieldToFilter('category_level',1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//normal categorys\n\t\t\t$collection->addFieldToFilter('category_parent_id',$parent_cat_id); \n\t\t}\t\t\n\t\t\n\t\t//Check if it is a eBay Store Tree\n\t\tif ($this->_ebay_store_flag==1)\n\t\t{\n\t\t\t$collection->addFieldToFilter('store',1);\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$collection->addFieldToFilter('store',0);\n\t\t}\n\t\t\n\t\t$children = array();\n\t\t$lauf = 0;\n\t\tforeach ($collection as $colItem)\n\t\t{\t\t\t \n\t\t\t\t if ($colItem->getCategoryId()!=$colItem->getCategoryParentId() || is_null($parent_cat_id))\n\t\t\t\t {\n\t\t\t\t\t $checked = 0;\n\t\t\t\t\t if ($checked_cat==$colItem->getCategoryId()) $checked = 1;\n\t\t\t\t\t $children[$lauf] = array(\n\t\t\t\t\t\t\t\t\t'text'=>$colItem->getCategoryName(),\n\t\t\t\t\t\t\t\t\t'id'=>$colItem->getCategoryId(),\n\t\t\t\t\t\t\t\t\t'path'=>$this->_buildPath($colItem),\n\t\t\t\t\t\t\t\t\t'cls'=>'folder active-category',\n\t\t\t\t\t\t\t\t\t'allowDrop' => true,\n\t\t\t\t\t\t\t\t\t'allowDrag' => true,\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\tif ($checked==1) $children[$lauf]['checked'] = true;\n\t\t\t\t\t\tif ($checked==1) $children[$lauf]['expanded'] = true;\t\n\t\t\t\t\t\tif ($this->_checkChildren($colItem->getCategoryId())) $children[$lauf]['children'] = array();\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$lauf++;\t\t\t\t \t\n\t\t\t\t }\t\t\n\t\t}\t\n\t\t\n\t\tif (count($children)>0) return $children; else return '';\n\t}", "function buildTree(array $elements, $parentId = 0) {\n $branch = array();\n\n foreach ($elements as $element) {\n if ($element['extention_type'] == 'Category 1') {\n $children = buildTree($elements, $element['id']);\n if ($children) {\n $element['children'] = $children;\n }\n $branch[] = $element;\n }\n }\n return $branch;\n}", "public static function createXTree($array, $currentParent, $currLevel = 0, $prevLevel = -1) {\n \n if ( is_array($array) && count($array) > 0 ) {\n\n foreach ($array as $categoryId => $category) {\n\n if ($currentParent == $category['direct_parent_id']) {\t\t\t\t\t\t\n\n if($category['node_type'] == 1){\n $cbName = 'acl_module[]';\n $cbvalue = $category['name'].'##'.$categoryId;\n }elseif($category['node_type'] == 2){\n $cbName = $category['parents'][0]['name'].'_controller[]';\n $cbvalue = $category['name'].'##'.$categoryId;\n }elseif($category['node_type'] == 3){\n $cbName = $category['parents'][1]['name'].'_'.$category['parents'][0]['name'].'_method[]';\n $cbvalue = $category['name'].'##'.$categoryId;\n }\n\n if ($currLevel > $prevLevel) echo \" <ul> \\n\"; \n\n if ($currLevel == $prevLevel) echo \" </li> \\n\";\n\n echo '<li id=\"'.$categoryId.'\" rel=\"'.$currLevel.'\">\n <input type=\"checkbox\" class=\"events-child-category-all\" \n id=\"id-'.$categoryId.'\"\n name=\"'.$cbName.'\"\n value=\"'.$cbvalue.'\"\n '.$category['checked'].'\n style=\"margin-left:0px;\"\n />\n <span style=\"padding-left:5px;\">'.$category['display_name'].'</span>';\n\n if($category['node_type'] == 1 OR $category['node_type'] == 2)\n echo '<img src=\"' . asset('public/assets/plugins/xtree/images/16-circle-blue-add.png') . '\" alt=\"add subcategory\" width=\"16\" height=\"16\" class=\"add_category\"/>';\n //<img src=\"images/16-circle-red-remove.png\" alt=\"remove\" width=\"16\" height=\"16\" class=\"delete_category\"/>';\n\n if ($currLevel > $prevLevel) { $prevLevel = $currLevel; }\n\n $currLevel++; \n\n self::createXTree ($array, $categoryId, $currLevel, $prevLevel);\n\n $currLevel--;\t \t\t \t\n\n }\t\n\n }\n\n if ($currLevel == $prevLevel) echo \"\\n </li> \\n </ul> \\n\";\n } \n\n }", "private function buildTree ( &$tree, $parentId = null ) {\r\n\t\tif ( !isset ( $parentId ) ) $parentId = 0;\r\n\t\t$param = array(\r\n\t\t\t'conditions' => array('parent_id' => $parentId),\r\n\t\t\t'fields' => array('id','lorder','rorder','CategoryDetail.name'),\r\n\t\t\t'order' => array('CategoryDetail.name')\r\n\t\t );\r\n\t\t$arrRes = $this->Category->find('all', $param);\r\n $tree .= \"<ul>\";\r\n foreach ( $arrRes as $node ) {\r\n \t$tree .= \"<li><a id='\".$node['Category']['id'].\"' ctrl='categories'>\".\r\n \t\t $node['CategoryDetail']['name'].\"</a>\";\r\n if ( $node['Category']['rorder'] - $node['Category']['lorder'] == 1 ) $tree .= \"</li>\";\r\n else {\r\n $this->buildTree ( $tree, $node['Category']['id'] );\r\n $tree .= \"</li>\";\r\n }\r\n\t /*if ( $node['Category']['rorder'] - $node['Category']['lorder'] > 1 ) {\r\n\t \t\t$tree .= \"<li><a id='\".$node['Category']['id'].\"' ctrl='categories'>\".\r\n \t\t $node['CategoryDetail']['name'].\"</a>\";\r\n\t\t\t\r\n\t\t\t $this->buildTree ( $tree, $node['Category']['id'] );\r\n\t $tree .= \"</li>\";\r\n\t }*/\r\n }\r\n $tree .= \"</ul>\";\r\n\t}", "function buildTree(&$parent, $pageIdx) {\n foreach ($pageIdx as $i) {\n if (intval($this->pages[$i]->parent) == intval($parent->get('id'))) {\n $child = $parent->addChild($this->pages[$i]);\n $this->buildTree($child, array_diff($pageIdx, array($i)));\n\n if ($this->pid == $this->pages[$i]->id) {\n $root = $parent->getRoot();\n $root->setCurrentItem($child);\n }\n }\n }\n }", "function _make_relation($parents)\n {\n if(count($parents)<1)\n return array();\n $children = array();\n // first pass - collect children\n $field_parent_id =$this->field_parent_id ;\n foreach ($parents as $t)\n {\n $pt = $t->$field_parent_id ;\n $list = @$children[$pt] ? $children[$pt] : array();\n array_push($list, $t);\n $children[$pt] = $list;\n\n }\n //echo \"<br>---list Child----<br>\";\n //print_r($children);\n return $children;\n }", "public function children()\n {\n return $this->hasMany(Category::class, 'parent_id', 'id');\n }", "public function structure() {\n $list = $this->newQuery()->where('parent_id', 0)->orderBy('order_id', 'asc')->get();\n $list->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $children->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $category->setAttribute('children', $children);\n\n return $category;\n });\n $category->setAttribute('children', $children);\n\n return $category;\n });\n\n return $list->toArray();\n }", "private function setParentChildrenClass() {\n $tmp_schemedata = $this->schemedata;\n \n // replace parents with primary key.\n foreach($this->schemedata as $index => $class) {\n $parents = array();\n $see = array();\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $parent) {\n $tmp = $tmp_class['pkFields'];\n $tmp_cols = $cols;\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n $key = array_shift($tmp_cols);\n $tmp2[$key] = $val;\n }\n $parents[$tmp_class['name']] = $tmp2;\n $see[] = $tmp_class['name'];\n }\n }\n }\n $this->schemedata[$index]['parents'] = $parents;\n $this->schemedata[$index]['see'] = $see;\n }\n\n // children\n foreach($this->schemedata as $index => $class) {\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $this->schemedata[$parent]['table']) {\n if ($class['type'] != 'TO' AND $class['type'] != 'TS' AND $class['type'] != 'TB') {\n $tmp = $class['parents']; // children's parent def\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n if($key == $tmp_class['name']) {\n $tmp2 = $val;\n }\n }\n if($class['name']) {\n $this->schemedata[$tmp_class['name']]['children'][$class['name']] = $tmp2;\n $this->schemedata[$tmp_class['name']]['see'][] = $class['name'];\n } else {\n $this->schemedata[$tmp_class['name']]['children'][$index] = $tmp2;\n }\n }\n }\n }\n }\n }\n\n // relationships\n foreach($this->schemedata as $class) {\n if ($class['type'] == 'TO' OR $class['type'] == 'TS' OR $class['type'] == 'TB') {\n foreach ($class['parents'] as $parent=>$pkFields) {\n if(!isset($this->schemedata[$parent]['relationships'])) {\n $this->schemedata[$parent]['relationships'] = array();\n }\n // add parent to another parent list getter\n foreach ($class['parents'] as $p=>$fs) {\n if ($parent != $p) {\n $type = 'List';\n $mname = '';\n foreach($fs as $k => $v) {\n $name = $k;\n }\n foreach($class['params'] as $param) {\n if($name == $param['name']) {\n $type = ($param['pair']=='N')?'List':'Class';\n break;\n }\n }\n\n $this->schemedata[$parent]['relationships'][$p]= array(\n 'table' => $class['table'],\n 'myFields' => $pkFields,\n 'fields' => $fs,\n 'type' => $type\n );\n }\n }\n }\n }\n }\n\n // rewrite relation key for parents, children and relations\n foreach($this->schemedata as $key => $class) {\n // parent\n foreach($class['parents'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$k2) {\n unset($this->schemedata[$key]['parents'][$k1][$k2]);\n $this->schemedata[$key]['parents'][$k1][$param['mname']] = $value;\n break;\n }\n }\n }\n }\n // children\n foreach($class['children'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['children'][$k1][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n // relations\n if(isset($class['relationships'])) {\n foreach($class['relationships'] as $k1 => $values) {\n foreach($values['myFields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['myFields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n foreach($values['fields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['fields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n }\n }\n }", "public function children()\n {\n return $this->hasMany('App\\Models\\Category', 'parent_id', 'id');\n }", "public function getChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n $children = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $children[] = new self((int) $result->getValue('category_id'), $this->clang_id);\n $result->next();\n }\n return $children;\n }", "function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }", "function tree($parent, $ident, $tree) {\n global $tree;\n $database = &JFactory::getDBO();\n\n $database->setQuery(\"SELECT * FROM #__jdownloads_cats WHERE parent_id =\".$parent.\" ORDER BY ordering\");\n \n $rows = $database->loadObjectList();\n if ($database->getErrorNum()) {\n echo $database->stderr();\n return false;\n }\n foreach ($rows as $v) {\n $v->cat_title = $ident.\".&nbsp;&nbsp;<sup>L</sup>&nbsp;\".$v->cat_title;\n $v->cat_title = str_replace('.&nbsp;&nbsp;<sup>L</sup>&nbsp;','.&nbsp;&nbsp;&nbsp;&nbsp;',$v->cat_title);\n $x = strrpos($v->cat_title,'.&nbsp;&nbsp;&nbsp;&nbsp;');\n $v->cat_title = substr_replace($v->cat_title, '.&nbsp;&nbsp;<sup>L</sup>&nbsp;', $x,7);\n $tree[] = $v;\n \n tree($v->cat_id, $ident.\".&nbsp;&nbsp;<sup>L</sup>&nbsp;\", $tree);\n }\n}", "public function children()\n {\n return $this->hasMany('App\\Model\\Products\\Category', 'parent_id');\n }", "public function findChildren($id_parent){\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.parent', $queryBuilder->createNamedParameter($id_parent))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.sys_language_uid', $queryBuilder->createNamedParameter($GLOBALS['TSFE']->sys_language_uid, \\PDO::PARAM_INT))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.deleted', $queryBuilder->createNamedParameter(0))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.hidden', $queryBuilder->createNamedParameter(0))\n )\n ->execute();\n $list_cat=[];\n while ($row = $statement->fetch()) {\n\n $list= array(\n 'uid' => $row['uid'],\n 'title' => $row['title'],\n 'parent' => $row['parent'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n );\n array_push($list_cat, $list);\n }\n\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.uid', $queryBuilder->createNamedParameter($id_parent))\n )\n \n ->execute();\n while ($row = $statement->fetch()) {\n $list=array(\n 'uid' =>$row['uid'],\n 'title' =>$row['title'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n 'children' => $list_cat);\n }\n return $list;\n }", "public function category_tree($data = array(), $id = 'cat_id', $parent = 'cat_parent')\n\t{\n\t\tif ( ! is_array($data) OR count($data) == 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tforeach ($data as $row)\n\t\t{\n\t\t\t// This assigns all the select fields to the array.\n\t\t\tforeach ($row AS $key => $val)\n\t\t\t{\n\t\t\t\t$arr[$key] = $val;\n\t\t\t}\n\t\t\t\n\t\t\t$menu_array[$row[$id]] = $arr;\n\t\t}\n\t\t\n\t\tunset($arr);\n\t\t\n\t\tforeach($menu_array as $key => $val)\n\t\t{\n\t\t\tif (0 == $val[$parent])\n\t\t\t{\n\t\t\t\t$depth = 0;\n\t\t\t\tforeach ($val AS $the_key => $the_val)\n\t\t\t\t{\n\t\t\t\t\t$arr[$the_key] = $the_val;\n\t\t\t\t}\n\t\t\t\t$this->_categories[$key] = $arr;\n\t\t\t\t$this->_category_subtree($key, $menu_array, $depth);\n\t\t\t}\n\t\t}\n\t}", "public function getCategoryTree() {\n $categories = TableRegistry::get('Categories');\n\n $first_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'slug'\n ])->where([\n 'level' => '0',\n 'status' => '1'\n ])->toArray();\n\n $second_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'parent_id',\n 'slug'\n ])->where([\n 'level' => '1',\n 'status' => '1'\n ])->toArray();\n\n $second_category_array = array();\n\n foreach ($second_level_categories as $second_category) {\n // $second_category_array[$second_category['parent_id']] = array();\n if (!is_array($second_category_array [$second_category ['parent_id']]))\n $second_category_array [$second_category ['parent_id']] = array();\n $second_category_array [$second_category ['parent_id']] [] = $second_category;\n }\n\n $third_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'parent_id',\n 'slug'\n ])->where([\n 'level' => '2',\n 'status' => '1'\n ])->toArray();\n\n $third_category_array = array();\n\n foreach ($third_level_categories as $third_category) {\n // $second_category_array[$second_category['parent_id']] = array();\n if (!is_array($third_category_array [$third_category ['parent_id']]))\n $third_category_array [$third_category ['parent_id']] = array();\n $third_category_array [$third_category ['parent_id']] [] = $third_category;\n }\n\n return [\n $first_level_categories,\n $second_category_array,\n $third_category_array\n ];\n }", "public function makeCategory() {\n $categories = NewsCategory::orderBy('sort', 'asc')->where('parent_id', 0)->get();\n $categories->map(function($d){\n $d['sub_category'] = $d->child;\n return $d;\n });\n return $categories;\n }", "public function buildChildTree($category_id)\n\t{\n\t\treturn $this->_addChildren($category_id);\t\t\t\t\t\t\n\t}", "private function categoryTree($parent_id = 0, $sub_mark = '')\n {\n $query = DB::table('category')\n ->select('*')\n ->where('parent_id',$parent_id)\n ->get()\n ->pluck('cat_name','id');\n\n \n foreach ($query as $id => $value)\n {\n //echo $key.\" : \".$sub_mark.$value.\"</br>\";\n array_push($this->categories, $sub_mark.$value.':'.$id);\n $this->categoryTree($id, $sub_mark.'---');\n }\n return $this->categories;\n }", "function get_categories_tree() {\n\t\tglobal $db;\n\t\t$sql = \" SELECT id, name, parent_id AS parent_id \n\t\t\t\tFROM \" . $this->table_category;\n\t\t$db->query ( $sql );\n\t\t$categories = $db->getObjectList ();\n\t\t\n\t\t$tree = FSFactory::getClass ( 'tree', 'tree/' );\n\t\t$rs = $tree->indentRows ( $categories, 1 );\n\t\treturn $rs;\n\t}", "public function children(): HasMany\n {\n return $this->hasMany(Category::class, 'parent_id');\n }", "abstract protected function getNewChildren(): array ;", "function _setParent($parent_srl, $child_index, &$target)\n\t{\n\t\t$child_srl = $this->itemKeyList[$child_index];\n\t\t$this->checked[$child_srl] = 1;\n\n\t\t$child_node = new stdClass();\n\t\t$child_node->node = $child_srl;\n\t\t$child_node->parent_node = $parent_srl;\n\t\t$child_node->child = array();\n\t\t$target->child[] = $child_node;\n\n\t\twhile(count($this->map[$child_srl]))\n\t\t{\n\t\t\t$this->_setParent($child_srl, array_shift($this->map[$child_srl]), $child_node);\n\t\t}\n\t\t//return $target;\n\t}", "function copy($id, $parent, $child_num = 0)\n\t{\n\t\tglobal $system, $DBPrefix, $db;\n\t\tif(!is_numeric($id) || $id < 0 ||!is_numeric($parent) || $parent < 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t// Get branch left & right id's.\n\t\t$query = \"SELECT left_id, right_id, level FROM \" . $DBPrefix . \"categories WHERE cat_id = :cat_id\";\n\t\t$params = array();\n\t\t$params[] = array(':cat_id', $id, 'int');\n\t\t$db->query($query, $params);\n\n\t\tif($db->numrows() != 1)\n\t\t{ // Row must Exist.\n\t\t\treturn false;\n\t\t}\n\t\t$a = $db->result();\n\t\t// Get child data.\n\t\t$query = \"SELECT * FROM \" . $DBPrefix . \"categories WHERE left_id >= \" . $a['left_id'] . \" AND right_id <= \" . $a['right_id'];\n\t\t$db->direct_query($query);\n\t\twhile($row = $db->fetch())\n\t\t{\n\t\t\t$data[] = $row;\n\t\t}\n\n\t\tif($parent != 0)\n\t\t{\n\t\t\t$query = \"SELECT left_id, right_id, level FROM \" . $DBPrefix . \"categories WHERE cat_id = :parent_id\";\n\t\t\t$params = array();\n\t\t\t$params[] = array(':parent_id', $parent, 'int');\n\t\t\t$db->query($query, $params);\n\n\t\t\tif($db->numrows() != 1)\n\t\t\t{ // Row must exist.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$b = $db->result();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$b = $this->get_virtual_root();\n\t\t}\n\n\t\t// Get target's children.\n\t\t$children = $this->get_children($b['left_id'], $b['right_id'], $b['level']);\n\n\t\tif(count($children) == 0)\n\t\t{\n\t\t\t$child_num = 0;\n\t\t}\n\t\tif($child_num == 0 || (count($children) - $child_num) <= 0 || (count($children) + $child_num + 1) < 0)\n\t\t{\n\t\t\t// First child.\n\t\t\t$boundry = array('left_id', 'right_id', 'right_id', $b['left_id']);\n\t\t}\n\t\telseif($child_num != 0)\n\t\t{\n\t\t\t// Some other child.\n\t\t\tif($child_num < 0)\n\t\t\t{\n\t\t\t\t$child_num = count($children) + $child_num + 1;\n\t\t\t}\n\t\t\tif($child_num > count($children))\n\t\t\t{\n\t\t\t\t$child_num = count($children);\n\t\t\t}\n\t\t\t$boundry = array('right_id', 'left_id', 'right_id', $children[$child_num - 1]['right_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Math.\n\t\t$diff = $a['right_id'] - $a['left_id'] + 1;\n\t\t$dist = $boundry[3] - $a['left_id'] + 1;\n\t\t// Level math.\n\t\t$ldiff = ($a['level'] - $b['level'] - 1);\n\n\t\t// Add hole.\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET left_id = left_id + \" . $diff . \" WHERE \" . $boundry[0] . \" > \" . $boundry[3] . \" AND \" . $boundry[1] . \" > \" . $boundry[3];\n\t\t$db->direct_query($query);\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET right_id = right_id + \" . $diff . \" WHERE \" . $boundry[2] . \" > \" . $boundry[3];\n\t\t$db->direct_query($query);\n\n\t\t// Now we have to insert all the new elements.\n\t\tfor($i = 0, $n = count($data); $i< $n; $i++)\n\t\t{\n\t\t\t// We need a new key.\n\t\t\tunset($data[$i][FIELD_KEY]);\n\n\t\t\t// This fields need new values.\n\t\t\t$data[$i]['left_id'] += $dist;\n\t\t\t$data[$i]['right_id'] += $dist;\n\t\t\t$data[$i]['level'] -= $ldiff;\n\n\t\t\t$data[$i] = $this->build_sql($data[$i]);\n\t\t\t$query = \"INSERT INTO \" . $DBPrefix . \"categories SET \" . $data[$i];\n\t\t\t$db->direct_query($query);\n\t\t}\n\t\treturn true;\n\t}", "public function getChilds();", "public function children()\n{\n return $this->hasMany(Category::class, 'parent_id');\n}", "public function child()\n {\n return $this->hasMany(Category::class,'parent_id');\n \n }", "public function run()\n {\n /*-------------------------------------------*/\n Category::create([ //root id:1\n 'parent_id' => null,\n 'name' => 'programming languages'\n ]);\n Category::create([ //id:2\n 'parent_id' => 1,\n 'name' => 'web'\n ]);\n Category::create([ //id:3\n 'parent_id' => 1,\n 'name' => 'mobile'\n ]);\n Category::create([ //web //id:4\n 'parent_id' => 2, //parent:web\n 'name' => 'php'\n ]);\n Category::create([ //web //id:5\n 'parent_id' => 2, //parent:web\n 'name' => 'html'\n ]);\n Category::create([ //web //id:6\n 'parent_id' => 2, //parent:web\n 'name' => 'css'\n ]);\n Category::create([ //mobile //id:7\n 'parent_id' => 3, //parent:mobile\n 'name' => 'flutter'\n ]);\n Category::create([ //mobile //id:8\n 'parent_id' => 3, //parent:mobile\n 'name' => 'java'\n ]);\n Category::create([ //php //id:9\n 'parent_id' => 4, //parent:web\\php\n 'name' => 'laravel'\n ]);\n Category::create([ //php //id:10\n 'parent_id' => 4, //parent:web\\php\n 'name' => 'lumen'\n ]);\n\n /*-------------------------------------------*/\n\n Category::create([ //root id:11\n 'parent_id' => null, //parent\n 'name' => 'multimedia'\n ]);\n\n Category::create([ //images id:12\n 'parent_id' => 11, //parent:multimedia\n 'name' => 'images'\n ]);\n Category::create([ //sounds id:13\n 'parent_id' => 11, //parent:multimedia\n 'name' => 'sounds'\n ]);\n\n Category::create([ //root id:14\n 'parent_id' => 12, //parent:multimedia\\images\\\n 'name' => 'gif'\n ]);\n Category::create([ //root id:15\n 'parent_id' => 12, //parent:multimedia\\images\\\n 'name' => 'png'\n ]);\n Category::create([ //root id:16\n 'parent_id' => 12, //parent:multimedia\\images\\\n 'name' => 'jpg'\n ]);\n Category::create([ //root id:17\n 'parent_id' => 12, //parent:multimedia\\images\\\n 'name' => 'bmp'\n ]);\n\n Category::create([ //root id:18\n 'parent_id' => 13, //parent:multimedia\\sounds\n 'name' => 'ogg'\n ]);\n Category::create([ //root id:19\n 'parent_id' => 13, //parent:multimedia\\sounds\n 'name' => 'mp3'\n ]);\n\n\n }", "function buildTree(array $elements, $parentId = 0)\n {\n $branch = array();\n foreach ($elements as $element) {\n if ($element['sub_for'] == $parentId) {\n $children = buildTree($elements, $element['id']);\n if ($children) {\n $element['children'] = $children;\n }\n $branch[] = $element;\n }\n }\n return $branch;\n }", "private function generateTree ( &$tree, $parentId = null ) {\r\n\t\tif ( !isset ( $parentId ) ) $parentId = 0;\r\n\t\t$param = array(\r\n\t\t\t'conditions' => array('parent_id' => $parentId, 'is_node' => 1),\r\n\t\t\t'fields' => array('id','lorder','rorder','CategoryDetail.name','CategoryDetail.icon_name'),\r\n\t\t\t'order' => array('CategoryDetail.name')\r\n\t\t );\r\n\t\t$arrRes = $this->Category->find('all', $param);\r\n\t\t\r\n\t\t$isFirst = false;\r\n\t\tif (!isset($tree) || empty($tree)) {\r\n\t\t\t$isFirst = true; \r\n\t\t\t$tree .= \"<ul class='menubar'>\";\r\n\t\t} else {\r\n\t\t\t$tree .= \"<ul><li class='li_top'></li>\";\r\n\t\t}\r\n\r\n \tforeach ( $arrRes as $key=>$node ) {\r\n \t\t$tree .= \"<li class='li_node \" . ($key == 0 ? 'first' : '') . \"' onmouseover='mover(this);' onmouseout='mout(this);'>\" .\r\n \t\t\t\t\t \"<a href='\" . SITE_URL . \"/category/\".$node['Category']['id'].\"' class='\" . \r\n \t\t\t\t\t $node['CategoryDetail']['icon_name'] . \"'>\".\r\n \t\t $node['CategoryDetail']['name'].\"</a>\";\r\n \t\tif ( $node['Category']['rorder'] - $node['Category']['lorder'] == 1 ) $tree .= \"</li>\";\r\n \t\telse {\r\n \t\t$this->generateTree ( $tree, $node['Category']['id'] );\r\n \t\t$tree .= \"</li>\";\r\n \t\t}\r\n \t}\r\n \tif (!$isFirst) $tree .= \"<li class='li_bottom'></li>\";\r\n \t\t$tree .= \"</ul>\";\r\n\t}", "public static function parentCategories()\n {\n return Category::with('children')\n ->orderBy('priority')\n ->where([\n 'category_type' => static::class,\n 'parent_id' => null,\n ])->get();\n }", "function getCategoryHierarchyAsArray()\n{\n return array\n (\n array\n (\n 'idString' => '1' ,\n 'idParentString' => null ,\n 'name' => 'Approved',\n 'children' => array\n (\n array\n (\n 'idString' => '1-1' ,\n 'idParentString' => '1' ,\n 'name' => 'Cons',\n 'children' => array\n (\n array('idString' => '1-1-1', 'idParentString' => '1-1', 'name' => 'ConsultingA', 'children' => array()),\n array('idString' => '1-1-2', 'idParentString' => '1-1', 'name' => 'ConsultingB', 'children' => array()),\n array('idString' => '1-1-3', 'idParentString' => '1-1', 'name' => 'Management ', 'children' => array()),\n array\n (\n 'idString' => '1-1-4' ,\n 'idParentString' => '1-1' ,\n 'name' => 'More Categories',\n 'children' => array\n (\n array('idString' => '1-1-4-1', 'idParentString' => '1-1-4', 'name' => 'Cat1', 'children' => array()),\n array('idString' => '1-1-4-2', 'idParentString' => '1-1-4', 'name' => 'Cat2', 'children' => array()),\n array\n (\n 'idString' => '1-1-4-3' ,\n 'idParentString' => '1-1-4' ,\n 'name' => 'Still more categories',\n 'children' => array\n (\n array\n (\n 'idString' => '1-1-4-3-1',\n 'idParentString' => '1-1-4-3' ,\n 'name' => 'CatA' ,\n 'children' => array()\n ),\n array\n (\n 'idString' => '1-1-4-3-2',\n 'idParentString' => '1-1-4-3' ,\n 'name' => 'CatB' ,\n 'children' => array()\n )\n )\n ),\n array\n (\n 'idString' => '1-1-4-4' ,\n 'idParentString' => '1-1-4' ,\n 'name' => 'Category 3',\n 'children' => array()\n )\n )\n )\n )\n ),\n array('idString' => '1-2', 'idParentString' => '1', 'name' => 'ConsultingA', 'children' => array()),\n array('idString' => '1-3', 'idParentString' => '1', 'name' => 'ConsultingB', 'children' => array())\n )\n ),\n array\n (\n 'idString' => '2' ,\n 'idParentString' => null ,\n 'name' => 'Not Approved',\n 'children' => array\n (\n array\n (\n 'idString' => '2-1' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 1',\n 'children' => array()\n ),\n array\n (\n 'idString' => '2-2' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 2',\n 'children' => array()\n ),\n array\n (\n 'idString' => '2-3' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 3',\n 'children' => array()\n )\n )\n )\n );\n}", "public function build_category_tree($output, $preselected, $parent=0, $indent=''){\t\n $this->db->select('category_id,category_name,parentid');\n $this->db->where('parentid',$parent); \n $sql = $this->db->get('category'); \n \n foreach ($sql->result_array() as $c)\n {\n $selected = ($c[\"category_id\"] == $preselected) ? \"selected=\\\"selected\\\"\" : \"\";\n $output .= \"<option value=\\\"\" . $c[\"category_id\"] . \"\\\" \" . $selected . \">\" . $indent . $c[\"category_name\"] . \"</option>\";\n if($c[\"category_id\"] != $parent){\n $this->crud_model->build_category_tree($output, $preselected, $c[\"category_id\"], $indent . \"&nbsp;&nbsp;\");\n } \n }\n return $sql->result_array();\n}", "public function children() : HasMany\n {\n return $this->hasMany('App\\Category', 'parent_id');\n }", "public function getChildrenIterative(): array\n {\n //not using $this->getTopLevelParents, it would be concerns violation\n $topLevelParents = $this->categoryRepository->getTopLevelParents();\n\n $results[0] = $topLevelParents;\n $parents = $topLevelParents;\n\n $results = $this->iterate($results);\n\n return $results;\n }", "function get_categories_tree()\n\t\t{\n\t\t\t$where = '';\n\t\t\t$is_accessory = FSInput::get('is_accessory',0,'int');\n\t\t\tif($is_accessory){\n\t\t\t\t$where .= ' AND is_accessories = 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND is_accessories = 1 ';\n\t\t\t}\n\t\t\t\n\t\t\tglobal $db ;\n\t\t\t$sql = \" SELECT id, name, parent_id AS parentid \n\t\t\t\tFROM fs_products_categories \n\t\t\t\tWHERE 1 = 1\n\t\t\t\t\".$where;\n\t\t\t// $db->query($sql);\n\t\t\t$categories = $db->getObjectList($sql);\n\t\t\t\n\t\t\t$tree = FSFactory::getClass('tree','tree/');\n\t\t\t$rs = $tree -> indentRows($categories,1); \n\t\t\treturn $rs;\n\t\t}", "public function run()\n {\n\n $categories = [\n ['name'=>'Electronics','is_parent'=>1], //1\n ['name'=>'Mobile','parent_id'=>1], //2\n ['name'=>'Tablets','parent_id'=>1], \n ['name'=>'Laptops','parent_id'=>1], \n \n ['name'=>'kitchn','is_parent'=>true], //5\n ['name'=>'cup','parent_id'=>5], //4\n ['name'=>'furniture','parent_id'=>5], //4\n\n ['name'=>'Personal Care','is_parent'=>true], //8\n ['name'=>'Mens grooming','parent_id'=>8], //4\n ['name'=>'Foundation','parent_id'=>8], //4\n\n ['name'=>'Grocery & Pets','is_parent'=>true], //11\n ['name'=>'Beverages','parent_id'=>11], //4\n ['name'=>'Breakfast','parent_id'=>11], //4\n \n ];\n foreach($categories as $category){\n Category::create([\n 'name'=>$category['name'],\n 'slug'=>Str::slug($category['name']),\n 'is_parent'=>$category['is_parent'] ?? 0,\n 'parent_id'=>$category['parent_id'] ?? null\n ]);\n }\n\n // $categories = [\n // [\n // 'name' => 'Electronics',\n // 'subCategory' => ['Mobile', 'Tablets', 'Laptops', 'Desktops', 'Televisions', 'Gaming Consoles', 'Printers']\n // ],\n // [\n // 'name' => 'Electronic Accessories',\n // 'subCategory' => ['Phone Cases', 'Chargers', 'Headphones', 'SmartWatches', 'BlueTooth Speakers', 'Screen protectors']\n // ],\n // [\n // 'name' => 'Personal Care',\n // 'subCategory' => ['Mens grooming', 'Mens grooming', 'Foundation', 'Deodrants', 'Female hygiene', 'Soap handwash', 'Skin care', 'Hair care']\n // ],\n // [\n // 'name' => 'Babys & Toys',\n // 'subCategory' => ['Disposable Diapers', 'Baby Gear', 'Personal Care', 'Toys & Games']\n // ],\n // [\n // 'name' => 'Grocery & Pets',\n // 'subCategory' => ['Beverages', 'Breakfast', 'Fruits', 'Vegetables', 'Pet Food', 'Daily Food']\n // ],\n // [\n // 'name' => 'Home & Lifestyle',\n // 'subCategory' => ['Bath', 'Bedding', 'Decor', 'Furniture', 'Appliances & Electicals', 'Kitchen Utensils']\n // ],\n // [\n // 'name' => 'Sports & Outdoors',\n // 'subCategory' => ['Mens Collections', 'Womens Collections', 'Exercise & Fitness', 'Travel & Luggage']\n // ],\n // [\n // 'name' => 'AutoMotive & Motorbike',\n // 'subCategory' => ['Auto Motive', 'Motorcycle', 'Moto Parts & Accessories', 'Riding gear']\n // ],\n // ];\n\n // foreach ($categories as $category) {\n\n // $newCategory = Category::create([\n // 'category_name' => $category['name'],\n // ]);\n // foreach ($category['subCategory'] as $item) {\n // $subcategory = SubCategory::create([\n // 'category_id' => $newCategory->id,\n // 'subCategory_name' => $item,\n // ]);\n // }\n // }\n }", "function getCategories($parent=0)\n {\n $sql=\"select * from itf_category where parent ='\".$parent.\"' and status='1' order by catname\";\n $res = $this->dbcon->FetchAllResults($sql);\n\n if(count($res) > 0){\n foreach($res as &$r)\n {\n $re = $this->getCategories($r['id']);\n $r[\"subcat\"] = $re;\n\n }\n }\n return $res;\n\n }", "function getTree( $parentID=0, $level=0 )\r\n {\r\n $category = new eZImageCategory( $parentID );\r\n\r\n $categoryList = $category->getByParent( $category );\r\n\r\n $tree = array();\r\n $level++;\r\n foreach ( $categoryList as $category )\r\n {\r\n array_push( $tree, array( $return_array[] = new eZImageCategory( $category->id() ), $level ) );\r\n\r\n if ( $category != 0 )\r\n {\r\n $tree = array_merge( $tree, $this->getTree( $category->id(), $level ) );\r\n }\r\n }\r\n\r\n return $tree;\r\n }", "function generate_tree_list($array, $parent = 0, $level = 0)\n\t{\n\t\t$has_children = false;\n\n\t\t// Loop through each item of the list array\n\t\tforeach($array as $key => $value)\n\t\t{\n\t\t\t// For the first run, get the first item with a parent_id of 0 (= root category)\n\t\t\t// (or whatever id is passed to the function)\n\t\t\t//\n\t\t\t// For every subsequent run, look for items with a parent_id matching the current item's key (id)\n\t\t\t// (eg. get all items with a parent_id of 2)\n\t\t\t//\n\t\t\t// This will return false (stop) when it find no more matching items/children\n\t\t\t//\n\t\t\t// If this array item's parent_id value is the same as that passed to the function\n\t\t\t// eg. [parent_id] => 0 == $parent = 0 (true)\n\t\t\t// eg. [parent_id] => 20 == $parent = 0 (false)\n\t\t\t//\n\t\t\tif ($value['cat_parent'] == $parent) \n\t\t\t{\n\t\t\t\t// Only print the wrapper ('<ul>') if this is the first child (otherwise just print the item) \n\t\t\t\t// Will be false each time the function is called again\n\t\t\t\tif ($has_children === false)\n\t\t\t\t{\n\t\t\t\t\t// Switch the flag, start the list wrapper, increase the level count\n\t\t\t\t\t$has_children = true; \n\t\t\t\t\tif($level==0)\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<ul id=\"browser\" class=\"filetree\">\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\techo \"\\n\".'<ul>';\n\t\t\t\t\t}\n\t\t\t\t\t$level++;\n\t\t\t\t}\n\t \t\t// Print the list item\n\t\t\t\techo \"\\n\".'<li><span class=\"folder\">' . $value['cat_name'] . '</span>';\n\t\t\t\techo $this->get_articles($value['cat_id'], $value['cat_uri']);\n\t\t\t\t// Repeat function, using the current item's key (id) as the parent_id argument\n\t\t\t\t// Gives us a nested list of subcategories\n\t\t\t\t$this->generate_tree_list($array, $key, $level); \n\t\t\t\t// Close the item\n\t\t\t\techo \"</li>\\n\";\n\t \t}\n\t\t}\n\t\t// If we opened the wrapper above, close it.\n\t \tif ($has_children === true) echo '</ul>'.\"\\n\";\n\t}", "public function parentCategories()\n {\n return $this->hasMany(self::class, 'id', 'parent_id');\n }", "function parseCategories($tree, $root = 0) {\n\n\n $return = [];\n # Traverse the tree and search for direct children of the root\n foreach($tree as $key => $value) {\n # A direct child is found\n if($value[\"parent_id\"] == $root) {\n \n # Remove item from tree (we don't need to traverse this again)\n unset($tree[$key]);\n # Append the child into result array and parse its children\n $return[] = array(\n 'value' => $value,\n 'children' => parseCategories($tree, $value[\"id\"])\n );\n }\n }\n \n return empty($return) ? null : $return;\n}", "static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"&nbsp;&nbsp;&nbsp;&nbsp;Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }", "public static function treeCategories(): array\n {\n return JEasyUi::jsonFormat(self::parentCategories());\n }", "public static function getTree ($category)\n\t{\n\t\t$db = DataAccess::getInstance();\n\t\t$category = (int)$category;\n\t\tif (!$category) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$category_next = $category;\n\t\t\n\t\t$get_parent_stmt = $db->Prepare(\"SELECT c.`parent_id`, c.`in_statement`, l.`category_name` FROM \".geoTables::categories_table.\" as c, \".geoTables::categories_languages_table.\" as l WHERE c.`category_id` = l.`category_id` AND c.`category_id` = ? AND l.`language_id` = \".$db->getLanguage().\" LIMIT 1\");\n\t\t\n\t\tif (!$get_parent_stmt) {\n\t\t\ttrigger_error('ERROR SQL: message: '.$db->ErrorMsg());\n\t\t\treturn false;\n\t\t}\n\t\t$tree = array();\n\t\twhile ($category_next > 0) {\n\t\t\t/*\n\t\t\t * Store the category info in static array, one entry for each category\n\t\t\t * so we only get info for each category once for times that we need\n\t\t\t * to get category tree a bunch of times in same page load. Doing it\n\t\t\t * this way should minimize extra memory usage\n\t\t\t */\n\t\t\tif (!isset(self::$_category_tree_array[$category_next])) {\n\t\t\t\t$category_result = $db->Execute($get_parent_stmt, array($category_next));\r\n\t\t\t\t\r\n\t\t\t\tif (!$category_result) {\r\n\t\t\t\t\ttrigger_error('ERROR SQL: message: '.$db->ErrorMsg());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif ($category_result->RecordCount() == 1) {\r\n\t\t\t\t\t$show = $category_result->FetchRow();\r\n\t\t\t\t\tself::$_category_tree_array[$category_next] = array(\r\n\t\t\t\t\t\t'parent_id' => $show['parent_id'],\r\n\t\t\t\t\t\t'in_statement' => $show['in_statement'],\r\n\t\t\t\t\t\t'category_name' => geoString::fromDB($show['category_name']),\r\n\t\t\t\t\t\t'category_id' => $category_next,\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tree[] = self::$_category_tree_array[$category_next];\n\t\t\t$category_next = self::$_category_tree_array[$category_next]['parent_id'];\n\t \t}\n\t\t\n\t\t//reverse order of tree, or it will be backwards since we started from\n \t\t//the outermost cat and worked our way up.\n \t\treturn array_reverse($tree, true);\n\t}", "public function getChildCat($parent = array(0), $type = false, $data = false)\n {\n global $rlDb;\n\n foreach ($parent as $parent_id) {\n $parent_id = (int) $parent_id;\n\n $sql = \"SELECT *, `Modified` \";\n $sql .= \"FROM `{db_prefix}categories` \";\n $sql .= \"WHERE `Type` = '{$type['Key']}' AND `Status` = 'active' AND `Parent_ID` = '{$parent_id}'\";\n if ($type['Cat_hide_empty']) {\n $sql .= \"AND `Count` > 0 \";\n }\n $sql .= \"ORDER BY `Position`\";\n\n if ($tmp_categories = $rlDb->getAll($sql)) {\n foreach ($tmp_categories as $cKey => $cValue) {\n $ids[] = $cValue['ID'];\n\n $categories[$cValue['ID']] = $cValue;\n $categories[$cValue['ID']]['pName'] = 'categories+name+' . $cValue['Key'];\n $categories[$cValue['ID']]['pTitle'] = 'categories+title+' . $cValue['Key'];\n\n /* get subcategories */\n if ($type['Cat_show_subcats']) {\n // TODO - add this condition in output if needs\n $rlDb->calcRows = true;\n $subCategories = $rlDb->fetch(array('ID', 'Count', 'Path`, CONCAT(\"categories+name+\", `Key`) AS `pName`, CONCAT(\"categories+title+\", `Key`) AS `pTitle', 'Key'), array('Status' => 'active', 'Parent_ID' => $cValue['ID']), \"ORDER BY `Position`\", null, 'categories');\n $rlDb->calcRows = false;\n\n if (!empty($subCategories)) {\n $categories[$cValue['ID']]['sub_categories'] = $subCategories;\n $categories[$cValue['ID']]['sub_categories_calc'] = $rlDb->foundRows;\n }\n\n unset($subCategories);\n }\n }\n unset($tmp_categories);\n\n $data[$parent_id] = $categories;\n\n unset($categories);\n } else {\n continue;\n }\n }\n\n if ($parent) {\n return $this->getChildCat($ids, $type, $data);\n } else {\n return $data;\n }\n }", "public function categories($parentId = null) {\n if (!empty($this->request->data['Category'])) {\n if ($this->Classified->Category->save($this->request->data)) {\n $this->Session->setFlash(__('Category saved'));\n }\n }\n\t\t\n\t\t$conditions = !empty($parentId) ? array('Category.parent_id' => $parentId, 'Category.model' => 'Classified') : array('Category.model' => 'Classified');\n $categories = $this->Classified->Category->find('threaded', array('conditions' => $conditions, 'order' => array('name' => 'ASC')));\n $this->set('parentCategories', $this->Classified->Category->generateTreeList(null, null, null, '--'));\n $this->set(compact('categories'));\n $this->set('page_title_for_layout', __('Classified Categories & Options'));\n\t\t//$this->layout = 'default';\n\t\treturn $categories; // used in element Categories/categories\n }", "private function node_create_nestedset($id_parent, $sort = \"order\", $cachedChildTree = NULL, $cachedChildNodes = NULL) {\n global $db;\n\n\n\t\tif ($cachedChildTree == NULL) {\n\t\t\t$childs = $db->fetch_table(\"SELECT ID_KAT, ORDER_FIELD FROM `\" . $this->table . \"`\n WHERE ROOT=\" . $this->root . \" AND PARENT=\" . $id_parent);\n\t\t} else {\n\t\t\t$childs = $cachedChildTree[$id_parent];\n\t\t}\n\n\t\tif ($childs === NULL) {\n\t\t\t$childs = array();\n\t\t}\n\n\n $childs_order = array(\n \t\"id\" => array(),\n \t\"title\" => array(),\n \t\"order\" => array()\n );\n\n foreach ($childs as $i=>$element) {\n $id_kat = $element[\"ID_KAT\"];\n\t\t if($cachedChildNodes == NULL) {\n\t\t\t $node = $this->element_read($id_kat);\n\t\t } else {\n $node = $cachedChildNodes[$id_kat][0];\n\t\t }\n\n $title = strtoupper($node[\"V1\"]);\n $childs_order[\"id\"][] = $id_kat;\n $childs_order[\"title\"][] = $title;\n $childs_order[\"order\"][] = $node[\"ORDER_FIELD\"];\n }\n\n if ($sort == \"order\") {\n \tarray_multisort($childs_order[\"order\"], $childs_order[\"title\"], $childs_order[\"id\"]);\n } else {\n \tarray_multisort($childs_order[$sort], $childs_order[\"order\"], $childs_order[\"id\"]);\n }\n\n $nestedset = array();\n\t foreach ($childs_order[\"id\"] as $index => $id_kat) {\n $nestedset[] = array(\n \t\"id\"\t\t=> $id_kat,\n \t\"order\" => $childs_order[\"order\"][$index],\n \t\"title\"\t\t=> $childs_order[\"title\"][$index],\n \t\"childs\"\t=> $this->node_create_nestedset($id_kat, $sort, $cachedChildTree, $cachedChildNodes)\n );\n\t }\n return $nestedset;\n }", "function prepareList(array $items, $pid = 0) {\n $output = array();\n foreach ($items as $item) {\n if ((int) $item['parent_id'] == $pid) {\n if ($children = prepareList($items, $item['id'])) {\n $item['children'] = $children;\n }\n $output[] = $item;\n }\n }\n return $output;\n}", "public static function buildTree($arr, $pid = 0);", "public function setParent(CategoryTreeNodeInterface $parent);", "function getParentCategories(){\n\t\t$categoryId = JRequest::getInt('category_id', 0);\n\t\t$parents = array();\t\t\n\t\twhile ( true ){\n\t\t\t$sql = \"SELECT id, name, parent FROM #__eb_categories WHERE id = \".$categoryId.\" AND published=1\";\n\t\t\t$this->_db->setQuery( $sql );\n\t\t\t$row = $this->_db->loadObject();\n\t\t\tif ($row){\n\t\t\t\t$sql = 'SELECT COUNT(*) FROM #__eb_categories WHERE parent='.$row->id.' AND published = 1 ';\n\t\t\t\t$this->_db->setQuery($sql) ;\n\t\t\t\t$total = $this->_db->loadResult();\n\t\t\t\t$row->total_children = $total ;\t\t\t\t\n\t\t\t\t$parents[] = $row ;\n\t\t\t\t$categoryId = $row->parent ;\t\t\t\t\n\t\t\t} else {\t\t\t\t\t\t\t\n\t\t\t \tbreak;\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn $parents ;\t\n\t}", "function buildBranchArray($parent_id, $level = 0, $result = '') {\n if (empty($result)) {\n $result = array();\n }\n\n if (isset($this->_data[$parent_id])) {\n foreach ($this->_data[$parent_id] as $category_id => $category) {\n if ($this->breadcrumb_usage == true) {\n $category_link = $this->buildBreadcrumb($category_id);\n } else {\n $category_link = $category_id;\n }\n\n $result[] = array('id' => $category_link,\n 'title' => str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . $category['name']);\n\n if (isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {\n if ($this->follow_cpath === true) {\n if (in_array($category_id, $this->cpath_array)) {\n $result = $this->buildBranchArray($category_id, $level+1, $result);\n }\n } else {\n $result = $this->buildBranchArray($category_id, $level+1, $result);\n }\n }\n }\n }\n\n return $result;\n }", "protected function getChildK2Categories()\n {\n $db = $this->db;\n $query = $db->getQuery(true);\n $query->select($db->quoteName(array('id', 'parent')));\n $query->from($db->quoteName('#__k2_categories'));\n $query->where($db->quoteName('published') . ' = 1');\n $query->where($db->quoteName('parent') . ' != 0');\n $db->setQuery($query);\n return $db->loadObjectList('id');\n }", "public function run()\n {\n $arr_category = array(\n [],\n [\n 'name' => 'Thời trang',\n 'img' => 's5.png',\n 'child' => [\n 'Áo sơ mi',\n 'Áo khoác',\n 'Áo thun',\n 'Áo vest, blazer',\n ]\n ],\n [\n 'name' => 'Điện thoại & Ipad',\n 'img' => 's3.png',\n ],\n [\n 'name' => 'Mỹ phẩm',\n 'img' => 's6.png',\n ],\n [\n 'name' => 'Thể thao',\n 'img' => 's2.png',\n 'child' => [\n 'Bóng đá',\n 'Bóng chuyền',\n 'Bóng bàn',\n 'Bơi Lội',\n 'Cầu lông',\n ],\n ],\n [\n 'name' => 'Phụ kiện công nghệ',\n 'img' => 's11.png',\n ],\n [\n 'name' => 'Máy ảnh',\n 'img' => 's5.png',\n ],\n [\n 'name' => 'Nội thất',\n 'img' => 's12.png',\n 'child' => [\n 'Ghế cao cấp',\n 'Ghế nhựa',\n 'Bàn cao cấp',\n 'Bàn chân sắt',\n ],\n ],\n \n );\n\n $categories = array();\n \n for ($i=1; $i < count($arr_category); $i++) { \n $categories[$i] = [\n 'id' => $i,\n 'c_name' => $arr_category[$i]['name'],\n 'c_slug' => Str::slug($arr_category[$i]['name']),\n 'c_avatar' => $arr_category[$i]['img'],\n ];\n };\n\n foreach($categories as $category){\n category::create($category);\n }\n \n\n for ($i=1; $i < count($arr_category); $i++) { \n if(array_key_exists('child',$arr_category[$i])){\n for ($j=0; $j < count($arr_category[$i]['child']); $j++) { \n category::create(\n [\n 'c_name' => $arr_category[$i]['child'][$j],\n 'c_slug' => Str::slug($arr_category[$i]['child'][$j]),\n 'c_parent' => $i,\n ]\n );\n }\n }\n };\n }", "static function buildTree( array &$elements, $parentId = 0 )\n\t{\n\t\t$branch = array();\n\t\tforeach ( $elements as &$element )\n\t\t{\n\t\t\tif ( $element->menu_item_parent == $parentId )\n\t\t\t{\n\t\t\t\t$children = self::buildTree( $elements, $element->ID );\n\t\t\t\tif ( $children )\n\t\t\t\t\t$element->child_items = $children;\n\n\t\t\t\t$branch[$element->ID] = $element;\n\t\t\t\tunset( $element );\n\t\t\t}\n\t\t}\n\t\treturn $branch;\n\t}", "public function getParentCategories() {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n\n return $this->fetchAll($select);\n }", "private function constructHierarchy() {\n\t\t//////////////////////////////////////////////////\n\t\t// Construct child-parent linkage for MonadObjects\n\t\t//////////////////////////////////////////////////\n \n $dummyidd = 10000000;\n\n $number_sets = count($this->sentenceSets);\n\n\t\tfor ($msetIndex=0; $msetIndex<$number_sets; ++$msetIndex) {\n $moarr = &$this->monadObjects[$msetIndex]; // Cached here;\n\t\t\tfor ($i=1; $i<$this->maxLevels; ++$i) {\n\t\t\t\t// Find constituent MonadObjects\n \n\t\t\t\tforeach ($moarr[$i] as $parentMo) { // Loop through monads at level i\n\t\t\t\t\tforeach ($moarr[$i-1] as $childMo) { // Loop through mondads at child level\n\t\t\t\t\t\tif ($childMo->contained_in($parentMo))\n\t\t\t\t\t\t\t$parentMo->add_child($childMo);\n\t\t\t\t\t}\n\t\t\t\t}\n \n\t\t\t\t// Find MonadObjects without parents\n\t\t\t\tforeach ($moarr[$i-1] as $childMo) {\n\t\t\t\t\tif ($childMo->get_parent()===null) {\n\t\t\t\t\t\t$matobj = new OlMatchedObject($dummyidd++, 'dummy');\n\t\t\t\t\t\t$matobj->monadset = $childMo->mo->monadset;\n \n\t\t\t\t\t\t$mmo = new MultipleMonadObject($matobj);\n\t\t\t\t\t\t$moarr[$i][] = $mmo;\n\t\t\t\t\t\t$mmo->add_child($childMo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n// // Print hierarchy\n// for ($i=1; $i<$this->maxLevels; ++$i) {\n// foreach ($moarr[$i] as $parentMo) {\n// echo \"<pre>parent = \",$parentMo->get_id_d(),\" : \";\n// foreach ($parentMo->children_idds as $cid)\n// echo $cid,\" \";\n// echo \"</pre>\";\n// }\n// }\n }\n }", "public function getAllMattersParentChildrenListTrimmed()\n {\n $matters = self::getAllMatters();\n $clean_matters = [];\n foreach ($matters as $matter) {\n $clean_matters[] = [\n 'id' => $matter['MatterID'], \n 'text' => $matter['MatterName'], \n 'ParentId' => $matter['ParentId'], \n 'ParentName' => $matter['ParentName'],\n 'MatterName' => $matter['MatterName'],\n 'MatterID' => $matter['MatterID'],\n 'Tag' => $matter['Tag'],\n\n ];\n }\n $matters = self::array_sort( $clean_matters, 'MatterName', SORT_ASC ); \n $output = self::buildTree($matters, 50) ;\n return $output;\n }", "function getAllMainCatsWithChildren() {\r\n $sql = 'SELECT * FROM categories WHERE parent_id = 0';\r\n\r\n include '../config/db.php';\r\n\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n $smartyRs = array();\r\n while ($row = $rs->fetch_assoc()) {\r\n\r\n $rsChildren = getChildrenForCat($row['id']);\r\n\r\n if ($rsChildren) {\r\n $row['children'] = $rsChildren;\r\n }\r\n\r\n $smartyRs[] = $row;\r\n }\r\n\r\n return $smartyRs;\r\n}", "private function _buildTree(array $items, $parentId = null)\r\n {\r\n\r\n $branch = array();\r\n\r\n foreach ($items as $key => $item) {\r\n if ($item['parent_id'] == $parentId) {\r\n $child = $this->_buildTree($items, $item['id']);\r\n if ($child) {\r\n $item['child'] = $child;\r\n }\r\n $branch[$item['id']] = $item;\r\n }\r\n }\r\n\r\n return $branch;\r\n }", "public function populateParentFromSortedByParentIdList() {\n for ($i = 0; $i < sizeof($this->nodeList); $i++) {\n $node = $this->nodeList[$i];\n// echo \"<br>Text: \".$node->getText();\n $this->insertNode($node);\n }\n }", "public static function build_tree(array &$collection, $parent = NULL, $parent_key = 'parent_id', $key = 'id')\n {\n $result = array();\n foreach($collection as $_key => $item) {\n $parent_item = self::property($item, $parent_key);\n $item_key = self::property($item, $key);\n if ( $parent_item === $parent) {\n unset($collection[$_key]);\n $result[$item_key] = array(\n 'object' => $item,\n 'childs' => self::build_tree($collection, $item_key)\n );\n }\n }\n return $result;\n }", "private function generateTreeByLevels($maxLevel=1, $level=0, $parentId = 0) {\r\n\t\t$arrCats = array();\r\n\t\t\r\n\t\tif ($level <= $maxLevel) {\r\n\t\t\t$param = array(\r\n\t\t\t\t'recursive' => 0,\r\n\t\t\t\t// is_node = 0 means don't show category on the website\r\n\t\t\t\t'conditions' => array('parent_id' => $parentId, 'is_node' => 1),\r\n\t\t\t\t'fields' => array(\r\n\t\t\t\t\t'id','lorder','rorder','CategoryDetail.name','CategoryDetail.category_alias',\r\n\t\t\t\t\t'CategoryDetail.icon_name'\r\n\t\t\t\t),\r\n\t\t\t\t'order' => array('CategoryDetail.name')\r\n\t\t\t );\r\n\t\t\t \r\n\t\t\t $arrRes = $this->Category->find('all', $param);\r\n\t\t\t foreach($arrRes as $node) {\r\n\t\t\t \t$tmp = $node['CategoryDetail'];\r\n\t\t\t\tif ( $node['Category']['rorder'] - $node['Category']['lorder'] > 1 ) {\r\n\t\t\t\t\t$newLevel = $level + 1;\r\n\t\t\t\t\t$pid = $node['Category']['id'];\r\n\t\t\t\t\t$tmp['children'] = $this->generateTreeByLevels($maxLevel, $newLevel, $pid);\r\n\t\t\t\t}\r\n\t\t\t\t$arrCats[] = $tmp;\r\n\t\t\t }\r\n\t\t}\r\n\t\t\r\n\t\treturn $arrCats;\r\n\t}", "function L_showChildCats ($parent, $usename) {\n\t\t\n\t\t$idObj = get_category_by_slug($parent); \n\t\t$parent_id = $idObj->term_id;\n\t\t$all_cats_ids = get_all_category_ids();\n\t\t\n\t\tforeach ( $all_cats_ids as $cat_id ) {\n\t\t\t\n\t\t\tif (cat_is_ancestor_of($parent_id, $cat_id)) {\n\t\t\t\n\t\t\t\tif ($usename) {\n\t\t\t\t\t\n\t\t\t\t\t$child_cats[] = get_cat_name($cat_id); \n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t$child_cats[] = (int)$cat_id;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\tif ($child_cats <> NULL) {\n\t\t\t\n\t\t\tsort( $child_cats ); \n\t\t\n\t\t}\n\t\t\n\t\treturn $child_cats; \n\t\t\n\t}", "function categoryTree($id_parent= 0,$sub_mark =''){\n global $db;\n $query = $db->query(\"SELECT * FROM category WHERE id_parent = $id_parent ORDER BY name DESC \" );\n \n if ($query->num_rows > 0){\n while ($row = $query-> fetch_assoc()){\n \n echo '<option value=\"'.$row['id_c'].'\">'.$sub_mark.$row['name'].'</option>';\n \n categoryTree($row['id_c'],$sub_mark.'---');\n }\n \n }\n }", "public function childrenElements() {\n\t\treturn $this->hasMany('\\App\\Hierarchy', 'parent_id', 'id');\n\t}", "function add($parent_id, $child_num = 0, $misc_data = false)\n\t{\n\t\tglobal $DBPrefix, $db;\n\t\tif(!is_numeric($parent_id) || $parent_id < 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif($parent_id != 0)\n\t\t{\n\t\t\t$query = \"SELECT left_id, right_id, level FROM \" . $DBPrefix . \"categories WHERE cat_id = :parent_id\";\n\t\t\t$params = array();\n\t\t\t$params[] = array(':parent_id', $parent_id, 'int');\n\t\t\t$db->query($query, $params);\n\t\t\tif($db->numrows() != 1)\n\t\t\t{ // Row must exist.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$parent = $db->result();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Virtual root element as parent.\n\t\t\t$parent = $this->get_virtual_root();\n\t\t}\n\t\t$children = $this->get_children($parent['left_id'], $parent['right_id'], $parent['level']);\n\n\t\tif(count($children) == 0)\n\t\t{\n\t\t\t$child_num = 0;\n\t\t}\n\t\tif($child_num == 0 || (count($children) - $child_num) <= 0 || (count($children) + $child_num + 1) < 0)\n\t\t{\n\t\t\t$boundry = array('left_id', 'right_id', $parent['left_id']);\n\t\t}\n\t\telseif($child_num != 0)\n\t\t{\n\t\t\t// Some other child.\n\t\t\tif($child_num < 0)\n\t\t\t{\n\t\t\t\t$child_num = count($children) + $child_num + 1;\n\t\t\t}\n\t\t\tif($child_num > count($children))\n\t\t\t{\n\t\t\t\t$child_num = count($children);\n\t\t\t}\n\t\t\t$boundry = array('right_id', 'left_id', $children[$child_num - 1]['right_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Make a hole for the new element.\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET left_id = left_id + 2 WHERE \" . $boundry[0] . \" > \" . $boundry[2] . \" AND \" . $boundry[1] . \" > \" . $boundry[2];\n\t\t$db->direct_query($query);\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET right_id = right_id + 2 WHERE \" . $boundry[1] . \" > \" . $boundry[2];\n\t\t$db->direct_query($query);\n\n\t\t// Insert the new element.\n\t\t$data = array(\n\t\t\t'left_id' => $boundry[2] + 1,\n\t\t\t'right_id' => $boundry[2] + 2,\n\t\t\t'level' => $parent['level'] + 1,\n\t\t\t'parent_id' => $parent_id\n\t\t);\n\t\tif($misc_data && is_array($misc_data))\n\t\t{\n\t\t\t$data = array_merge($misc_data, $data);\n\t\t}\n\n\t\t$query = \"INSERT INTO \" . $DBPrefix . \"categories (parent_id, left_id, right_id, level, cat_name, cat_colour, cat_image)\n\t\t\t\tVALUES (:parent, :left, :right, :level, :name, :colour, :image)\";\n\t\t$params = array();\n\t\t$params[] = array(':parent', $data['parent_id'], 'str');\n\t\t$params[] = array(':left', $data['left_id'], 'str');\n\t\t$params[] = array(':right', $data['right_id'], 'str');\n\t\t$params[] = array(':level', $data['level'], 'str');\n\t\t$params[] = array(':name', $data['cat_name'], 'str');\n\t\t$params[] = array(':colour', $data['cat_colour'], 'str');\n\t\t$params[] = array(':image', $data['cat_image'], 'str');\n\t\t$db->query($query, $params);\n\n\t\tif(!$misc_data)\n\t\t{\n\t\t\treturn $db->lastInsertId();\n\t\t}\n\t\treturn true;\n\t}", "private function _build_page_tree( $parent_id )\n\t{\n\t\t$this->db->where('status', 'live');\n\t\t$pages = $this->pages_m->get_many_by('parent_id', $parent_id);\n\t\t\n\t\t//Unset the parent\n\t\tforeach( $pages as $key => $page )\n\t\t{\n\t\t\tif( $page->id == $parent_id): unset( $pages[$key] ); endif;\n\t\t}\n\t\t\n\t\tif ( ! empty($pages) ):\n\t\t\t\t\n\t\t\t$this->html .= \"\\n\".$this->_level_tabs( $this->level ).\"<ul>\\n\";\n\t\t\t\t\t\n\t\t\tforeach ($pages as $page):\n\t\t\t\t\t\t\t\n\t\t\t\t'/'.$this->uris[$page->id] == $this->uri->uri_string() ? $attr = 'class=\"current\"' : $attr = '';\n\t\t\t\n\t\t\t\t$this->html .= $this->_level_tabs( $this->level+1 ).'<li>';\n\t\t\t\n\t\t\t\tif( !in_array($this->level, $this->disable) ):\n\t\t\t\t\n\t\t\t\t\t$this->html .= anchor($this->uris[$page->id], $page->title, $attr);\n\t\t\t\t\n\t\t\t\telse:\n\t\t\t\t\n\t\t\t\t\t$this->html .= $page->title;\n\t\t\t\t\n\t\t\t\tendif;\t\t\t\t\n\t\t\t\t\n\t\t\t\tif( $page->has_children = $this->pages_m->has_children($page->id) ):\n\t\t\t\t\n\t\t\t\t\t$this->level++;\n\t\t\t\t\n\t\t\t\t\t$this->_build_page_tree( $page->id );\n\t\t\t\t\t\n\t\t\t\t\t$this->level--;\n\t\t\t\t\t\n\t\t\t\t\t$this->html .= $this->_level_tabs( $this->level+1 ).'</li>'.\"\\n\";\n\t\t\t\t\n\t\t\t\telse:\n\t\t\t\t\n\t\t\t\t\t$this->html .= '</li>'.\"\\n\";\n\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\n\t\t\tendforeach;\n\n\t\t\treturn $this->html .= $this->_level_tabs( $this->level ).'</ul>'.\"\\n\";\n\t\t\n\t\tendif;\n\t}", "public function buildTree(array $elements, $parentId = 0) \n {\n $branch = array();\n\n foreach ($elements as $element) {\n if ($element['ParentId'] == $parentId) {\n $children = self::buildTree($elements, $element['MatterID']);\n if ($children) {\n $element['children'] = $children;\n if(isset($element['id'])){\n unset($element['id']);\n }\n }\n $branch[] = $element;\n }\n }\n\n return $branch;\n }", "public static function createStructure():array\n {\n\n\n foreach (self::$categories as $parent){\n\n if (!array_key_exists($parent['parent_id'], self::$structure)){\n\n foreach (self::$categories as $row){\n if ($parent['parent_id'] == $row['parent_id']){\n self::$structure[$parent['parent_id']][] = $row;\n }\n }\n\n }\n }\n return self::$structure;\n\n\n }", "public function run()\n\t{\n\t\tDB::table('categories')->insert([\n\t\t\t[\n\t\t\t\t'name' => 'Agama',\n\t\t\t\t'code' => 'HR; HRA; HRAM; HRAX; HRC; HRCL; HRCL1; HRCS; HRCV; HRCV1; HRCR1; HRCX6',\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Bahasa',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Biografi',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Bisnis & Manajemen',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Buku Anak & Remaja',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Buku Sekolah',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Busana',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Computer & Teknologi',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ekonomi & Akuntansi',\n\t\t\t\t'code' => 'KF; KFFM; KFFX',\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Hukum & Politik',\n\t\t\t\t'code' => 'LA; JP',\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Kesehatan',\n\t\t\t\t'code' => 'VFVG; VFV; VFVK',\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Keterampilan',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Masakan',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Musik',\n\t\t\t\t'code' => 'AVH',\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Novel',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Olahraga',\n\t\t\t\t'code' => 'WSJA1',\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Pengembangan Diri',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Pertanian, Peternakan & Perikanan',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Psikologi',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Seni & Desain',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sosial & Budaya',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Teknik',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Travel',\n\t\t\t\t'code' => 'WTL; WTD; WTHA',\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lihat semua eBook LIVI',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Biograpy : General',\n\t\t\t\t'code' => 'BG; BGA; BGS; BGH; BGX; BGBA; BGXA',\n\t\t\t\t'parent_id' => 3,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'DIARIES, LETTERS & JOURNALS',\n\t\t\t\t'code' => 'BJ',\n\t\t\t\t'parent_id' => 3,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Memoirs',\n\t\t\t\t'code' => 'BM',\n\t\t\t\t'parent_id' => 3,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'True Stories',\n\t\t\t\t'code' => 'BT; BTP',\n\t\t\t\t'parent_id' => 3,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'FINANCE & ACCOUNTING',\n\t\t\t\t'code' => 'KF; KFFM; KFFX',\n\t\t\t\t'parent_id' => 4,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'BUSINESS & MANAGEMENT',\n\t\t\t\t'code' => 'KJB; KJC; KJD; KJM; KJH; KJMV2; KJMV1; KJMV7; KJR; KJS; KJSU; KJMV5',\n\t\t\t\t'parent_id' => 4,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Novel',\n\t\t\t\t'code' => 'YFM; YFY; YNR; YFU; YFW; YFD; YFB; YFC; YFT; YNM; YXF; YFA; YFR',\n\t\t\t\t'parent_id' => 5,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Pendidikan',\n\t\t\t\t'code' => 'YQTU; YQR; YQC',\n\t\t\t\t'parent_id' => 5,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lihat semua buku anak & remaja',\n\t\t\t\t'code' => 'Y',\n\t\t\t\t'parent_id' => 5,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'SMP',\n\t\t\t\t'code' => 'PB; JF; AB; LNDA; PDD; CJB',\n\t\t\t\t'parent_id' => 6,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'SMA',\n\t\t\t\t'code' => 'CJB',\n\t\t\t\t'parent_id' => 6,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'SMK',\n\t\t\t\t'code' => 'TGB; TDPF; TVB; JNT; TQSW1; ANC; PSVH; PSVW1; UYU; KNX; WGM; UGN; TJF',\n\t\t\t\t'parent_id' => 6,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lihat semua buku sekolah',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 6,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Digital',\n\t\t\t\t'code' => 'AJG; UDP',\n\t\t\t\t'parent_id' => 8,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Hardware',\n\t\t\t\t'code' => 'UKPM',\n\t\t\t\t'parent_id' => 8,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Software',\n\t\t\t\t'code' => 'UFBC; UFCE; ULDF; ULL',\n\t\t\t\t'parent_id' => 8,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Programming',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 8,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lihat semua buku computer & teknologi',\n\t\t\t\t'code' => 'U',\n\t\t\t\t'parent_id' => 8,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lihat semua buku Ekonomi & Akuntansi',\n\t\t\t\t'code' => 'K',\n\t\t\t\t'parent_id' => 9,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lihat semua buku Hukum & Politik',\n\t\t\t\t'code' => 'L; JP',\n\t\t\t\t'parent_id' => 10,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Fantasi',\n\t\t\t\t'code' => 'FM',\n\t\t\t\t'parent_id' => 15,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Klasik',\n\t\t\t\t'code' => 'FC',\n\t\t\t\t'parent_id' => 15,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Metropop/Chick lit/ Teen lit',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 15,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Misteri',\n\t\t\t\t'code' => 'FF; FFC; FFH',\n\t\t\t\t'parent_id' => 15,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Romantis',\n\t\t\t\t'code' => 'FR; FRD',\n\t\t\t\t'parent_id' => 15,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sastra',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 15,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sejarah',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 15,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lihat semua novel',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 15,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Arsitektur',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 20,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Desain Grafis',\n\t\t\t\t'code' => 'AKC',\n\t\t\t\t'parent_id' => 20,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Fotografi',\n\t\t\t\t'code' => 'UDP',\n\t\t\t\t'parent_id' => 20,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lihat semua seni & desain',\n\t\t\t\t'code' => 'AK',\n\t\t\t\t'parent_id' => 20,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Lihat semua buku Travel',\n\t\t\t\t'code' => 'WT',\n\t\t\t\t'parent_id' => 23,\n\t\t\t]\n\t\t]);\n\t\tDB::table('categories')->insert([\n\t\t\t// 58\n\t\t\t[\n\t\t\t\t'name' => 'Art, Music & Photography',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Biography & Memoirs',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Business & Money',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Children\\'s eBooks',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Comics & Graphic Novels',\n\t\t\t\t'code' => 'WH; FX; FZ',\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Computers & Technology',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Cookbooks, Food & Wine',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Crafts, Hobbies & Home',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Education & Teaching',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Engineering & Transportation',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Foreign Languanges',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Health, fitness & dieting',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'History',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Humor & Entertaiment',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Law',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Literature & Fiction',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Medical eBooks',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mystery, Thriller & Suspense',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Non-fiction',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Parenting & Relationships',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Politics & Social Sciences',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Reference',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Religion & Spirituality',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Romance',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Science & Math',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Science Fiction & Fanstasy',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Self-help',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sports & Outdoors',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Teen & Young Adult',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Travel',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all LIVI eBooks',\n\t\t\t\t'code' => null,\n\t\t\t\t'parent_id' => 0,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Art',\n\t\t\t\t'code' => 'AC; AF; AG; AJ; AK; AM',\n\t\t\t\t'parent_id' => 58,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Performing Arts',\n\t\t\t\t'code' => 'AN; AP; AS; AV',\n\t\t\t\t'parent_id' => 58,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all art, music & photography',\n\t\t\t\t'code' => 'A',\n\t\t\t\t'parent_id' => 58,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Cultural Heritage',\n\t\t\t\t'code' => 'GM',\n\t\t\t\t'parent_id' => 59,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Historical',\n\t\t\t\t'code' => 'BG; BJ; BK; BT',\n\t\t\t\t'parent_id' => 59,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Literacy',\n\t\t\t\t'code' => 'BM',\n\t\t\t\t'parent_id' => 59,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all biography & memoirs',\n\t\t\t\t'code' => 'B',\n\t\t\t\t'parent_id' => 59,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Accounting',\n\t\t\t\t'code' => 'KF',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Biography & History',\n\t\t\t\t'code' => 'BG; BJ; BK ',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Business Life',\n\t\t\t\t'code' => 'KJ; KN',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Economics',\n\t\t\t\t'code' => 'KC; KF; KJ ',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Education & Reference',\n\t\t\t\t'code' => 'GB; HB; JN; MR; YR; 4',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Entrepreneurship & Small business',\n\t\t\t\t'code' => 'KJ; KN',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Finance',\n\t\t\t\t'code' => 'KF; KJ',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Green Business',\n\t\t\t\t'code' => 'KJ',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Industries',\n\t\t\t\t'code' => 'KN',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'International',\n\t\t\t\t'code' => 'KC; KN',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Investing',\n\t\t\t\t'code' => 'KF; KJ',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Job Hunting & Careers',\n\t\t\t\t'code' => 'VS; KJ',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Marketing & Sales',\n\t\t\t\t'code' => 'KJ',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Organizational Behaviour',\n\t\t\t\t'code' => 'KC; KJ',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Personal Finance',\n\t\t\t\t'code' => 'KF; KJ; VS',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Real Estate',\n\t\t\t\t'code' => 'KF; KJ; LN',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Skills',\n\t\t\t\t'code' => 'MQ; TG; TH; TN; TR; TT; WS; YQ; 4E; 4K',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Taxation',\n\t\t\t\t'code' => 'KF; LN',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Technology',\n\t\t\t\t'code' => 'AJ; BG; JF; JN; KN; MM; PD; PN; RN; T; U; 4K',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all Business & Money',\n\t\t\t\t'code' => 'K',\n\t\t\t\t'parent_id' => 60,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Action & Adventure',\n\t\t\t\t'code' => 'YB',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Activities & Games',\n\t\t\t\t'code' => 'YB',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Animals',\n\t\t\t\t'code' => 'YF; YN',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Art, Music & Photography',\n\t\t\t\t'code' => 'YQ',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Biographies',\n\t\t\t\t'code' => 'YN',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Cars, Trains & Things That Go',\n\t\t\t\t'code' => 'YB',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Comics & Graphic Novels',\n\t\t\t\t'code' => 'FX',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Computer & Technology',\n\t\t\t\t'code' => 'YQ',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Easy Learning',\n\t\t\t\t'code' => 'YB',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Education & Reference',\n\t\t\t\t'code' => 'YF; YR',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Fairy Tales, Folk Tales & Myths',\n\t\t\t\t'code' => 'YF',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Geography & Cultures',\n\t\t\t\t'code' => 'YQ',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Growing Up & Facts of Life',\n\t\t\t\t'code' => 'YX',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'History',\n\t\t\t\t'code' => 'YN',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Humor',\n\t\t\t\t'code' => 'YN',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Literature & Fiction',\n\t\t\t\t'code' => 'YF; YQ',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mysteries & Detectives',\n\t\t\t\t'code' => 'YN',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Religions',\n\t\t\t\t'code' => 'YQ',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Science Fiction, Fantasy & Scary Stories',\n\t\t\t\t'code' => 'YF',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Science, Nature & How it Works',\n\t\t\t\t'code' => 'YQ',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sports & Outdoors',\n\t\t\t\t'code' => 'YN',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all Children\\'s eBooks',\n\t\t\t\t'code' => 'Y',\n\t\t\t\t'parent_id' => 61,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Databases',\n\t\t\t\t'code' => 'UF; UM; UN',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Graphic Design',\n\t\t\t\t'code' => 'AK; UG; UK; UM',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Hardware',\n\t\t\t\t'code' => 'UK; UT',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Microsoft',\n\t\t\t\t'code' => 'UM; UQ',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Networking',\n\t\t\t\t'code' => 'UD; UT; TJ',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Operating Systems',\n\t\t\t\t'code' => 'UL',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Programming',\n\t\t\t\t'code' => 'UM; VS; PB',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Software',\n\t\t\t\t'code' => 'UD; UF; UG; UM; UN; EL',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Systems Analysis & Design',\n\t\t\t\t'code' => 'UY',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Web Graphics',\n\t\t\t\t'code' => 'UG',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Web Marketing',\n\t\t\t\t'code' => 'KJ',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Web Site Design',\n\t\t\t\t'code' => 'UG',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all Computers & Technology',\n\t\t\t\t'code' => 'U',\n\t\t\t\t'parent_id' => 63,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Baking',\n\t\t\t\t'code' => 'WBVS',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Canning & Preserving',\n\t\t\t\t'code' => 'WBW',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Cooking by Ingredient',\n\t\t\t\t'code' => 'WBT',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Drinks & Beverages',\n\t\t\t\t'code' => 'WBX',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Meals',\n\t\t\t\t'code' => 'WBV',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Professional Cooking',\n\t\t\t\t'code' => 'WBB',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Quick & Easy',\n\t\t\t\t'code' => 'WBF',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Regional & International',\n\t\t\t\t'code' => 'WBN',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Special Appliances',\n\t\t\t\t'code' => 'WBS',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Special Diet',\n\t\t\t\t'code' => 'WBHS',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Special Ocassions',\n\t\t\t\t'code' => 'WBR',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Vegetables & Vegetarian',\n\t\t\t\t'code' => 'WBJ',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all cookbooks, food & wine',\n\t\t\t\t'code' => 'WB',\n\t\t\t\t'parent_id' => 64,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Antiques & Colectibles',\n\t\t\t\t'code' => 'WC',\n\t\t\t\t'parent_id' => 65,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Crafts & Hobbies',\n\t\t\t\t'code' => 'WF',\n\t\t\t\t'parent_id' => 65,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Gardening & Horticulture',\n\t\t\t\t'code' => 'WM',\n\t\t\t\t'parent_id' => 65,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Home Design',\n\t\t\t\t'code' => 'WK',\n\t\t\t\t'parent_id' => 65,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'How-to & Home Improvements',\n\t\t\t\t'code' => 'WK',\n\t\t\t\t'parent_id' => 65,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Interior Design',\n\t\t\t\t'code' => 'AK; AM; WJ; WK',\n\t\t\t\t'parent_id' => 65,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Weddings',\n\t\t\t\t'code' => 'VF; WJ',\n\t\t\t\t'parent_id' => 65,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Childhood education',\n\t\t\t\t'code' => 'YB',\n\t\t\t\t'parent_id' => 66,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Higher & continuing education',\n\t\t\t\t'code' => 'YQ; 4E; 4K',\n\t\t\t\t'parent_id' => 66,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Studying & workbooks',\n\t\t\t\t'code' => 'EL',\n\t\t\t\t'parent_id' => 66,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Teacher resources',\n\t\t\t\t'code' => '4E',\n\t\t\t\t'parent_id' => 66,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Test preparation',\n\t\t\t\t'code' => '4E',\n\t\t\t\t'parent_id' => 66,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all education & teaching',\n\t\t\t\t'code' => '4',\n\t\t\t\t'parent_id' => 66,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Automotive',\n\t\t\t\t'code' => 'KN; TR',\n\t\t\t\t'parent_id' => 67,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Engineering',\n\t\t\t\t'code' => 'T',\n\t\t\t\t'parent_id' => 67,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Transportation',\n\t\t\t\t'code' => 'WG; KN; TR',\n\t\t\t\t'parent_id' => 67,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all engineering & transportation',\n\t\t\t\t'code' => 'TR',\n\t\t\t\t'parent_id' => 67,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chinese',\n\t\t\t\t'code' => '2GDC',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'French',\n\t\t\t\t'code' => '2ADF',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'German',\n\t\t\t\t'code' => '2ACG',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Italian',\n\t\t\t\t'code' => '2ADT',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Japanese',\n\t\t\t\t'code' => '2GJ',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Portuguese',\n\t\t\t\t'code' => '2ADP',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Russian',\n\t\t\t\t'code' => '2AGR',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Spanish',\n\t\t\t\t'code' => '2ADS',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Other Languanges',\n\t\t\t\t'code' => '2Z',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all foreign languanges',\n\t\t\t\t'code' => '2',\n\t\t\t\t'parent_id' => 68,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Addicition & recovery',\n\t\t\t\t'code' => 'YX; JF; MM',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Alternative medicine',\n\t\t\t\t'code' => 'MM; VXH',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Beauty, grooming & style',\n\t\t\t\t'code' => 'WJ',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Counselling & Psychology',\n\t\t\t\t'code' => 'VS; JM',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Death & grief',\n\t\t\t\t'code' => 'JH; VF; YX',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Diets & weight loss',\n\t\t\t\t'code' => 'VF; WB',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Diseases & physical ailments',\n\t\t\t\t'code' => 'MJ',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Exercise & fitness',\n\t\t\t\t'code' => 'VF; WS',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Nutrition',\n\t\t\t\t'code' => 'MB',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Personal health',\n\t\t\t\t'code' => 'MB; VF; VS',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Reference',\n\t\t\t\t'code' => 'VF; VS; VX',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Relationships',\n\t\t\t\t'code' => 'WJ; YX; JH; VF',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Safety & first aid',\n\t\t\t\t'code' => 'VF; JF',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sex',\n\t\t\t\t'code' => 'VF; WJ; YX',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sports Health & Safety',\n\t\t\t\t'code' => 'JM; MM',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Teen heath',\n\t\t\t\t'code' => 'YX',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all health, fitness & dieting',\n\t\t\t\t'code' => 'V',\n\t\t\t\t'parent_id' => 69,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Africa',\n\t\t\t\t'code' => 'HBJH',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Americas',\n\t\t\t\t'code' => 'HBJK',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ancient Civilizations',\n\t\t\t\t'code' => 'HBL',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Arctic & Antarctica',\n\t\t\t\t'code' => 'HBJQ',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Art & Literature',\n\t\t\t\t'code' => 'AC',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Asia',\n\t\t\t\t'code' => 'vHBJF',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Australia & Oceania',\n\t\t\t\t'code' => 'HBJM',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Europe',\n\t\t\t\t'code' => 'HBJD',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Food & Cooking',\n\t\t\t\t'code' => 'WB',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Hitorical Study',\n\t\t\t\t'code' => 'HB; YQH',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Middle East',\n\t\t\t\t'code' => 'HBJ',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Military',\n\t\t\t\t'code' => 'HBT',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Modern (16-21 Centuries)',\n\t\t\t\t'code' => 'HBL',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Religion',\n\t\t\t\t'code' => 'HR',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Rusia & Former Soviet Republics',\n\t\t\t\t'code' => 'HBT',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Science & Medicine',\n\t\t\t\t'code' => 'PD',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Social History',\n\t\t\t\t'code' => 'HBT',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'United States',\n\t\t\t\t'code' => 'HB',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'World',\n\t\t\t\t'code' => 'HBG',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all history',\n\t\t\t\t'code' => 'H',\n\t\t\t\t'parent_id' => 70,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Humor',\n\t\t\t\t'code' => 'WH',\n\t\t\t\t'parent_id' => 71,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Movies & Video',\n\t\t\t\t'code' => 'UD; AP',\n\t\t\t\t'parent_id' => 71,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Performing Arts',\n\t\t\t\t'code' => 'AP',\n\t\t\t\t'parent_id' => 71,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Pop Culture',\n\t\t\t\t'code' => 'JF',\n\t\t\t\t'parent_id' => 71,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Puzzles & Games',\n\t\t\t\t'code' => 'UD; WD; WS',\n\t\t\t\t'parent_id' => 71,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Radio',\n\t\t\t\t'code' => 'AP',\n\t\t\t\t'parent_id' => 71,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Television',\n\t\t\t\t'code' => 'AP',\n\t\t\t\t'parent_id' => 71,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all Humor & Entertaiment',\n\t\t\t\t'code' => 'W',\n\t\t\t\t'parent_id' => 71,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Administrative Law',\n\t\t\t\t'code' => 'LND',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Business',\n\t\t\t\t'code' => 'LNC',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Constitutional Law',\n\t\t\t\t'code' => 'LND',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Criminal Law',\n\t\t\t\t'code' => 'LB; LNF',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Environmental & Natural resources Law',\n\t\t\t\t'code' => 'LNK',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Ethics & Profesional Responsibility',\n\t\t\t\t'code' => 'LATC',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Family & health Law',\n\t\t\t\t'code' => 'LNM',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Intellectual Law',\n\t\t\t\t'code' => 'LNR',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Law Practice',\n\t\t\t\t'code' => 'LAS',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Legal Education',\n\t\t\t\t'code' => 'LR',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Media & The Law',\n\t\t\t\t'code' => 'LNJ',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Practical Guides',\n\t\t\t\t'code' => 'LA',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Procedures & Litigation',\n\t\t\t\t'code' => 'LA',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Specialities',\n\t\t\t\t'code' => 'LN',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Taxation',\n\t\t\t\t'code' => 'LNU',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all law',\n\t\t\t\t'code' => 'L',\n\t\t\t\t'parent_id' => 72,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Action & Adventure',\n\t\t\t\t'code' => 'YFC; FJ',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Anthologies & Literature Collections',\n\t\t\t\t'code' => 'YD; DQ; YN',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Classics',\n\t\t\t\t'code' => 'FC; DB',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Contemporary Fiction',\n\t\t\t\t'code' => 'FA; YFT',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Drama & Plays',\n\t\t\t\t'code' => 'DD',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Erotica',\n\t\t\t\t'code' => 'FP',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Essays & Correspondence',\n\t\t\t\t'code' => 'DN',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Foreign Language Fiction',\n\t\t\t\t'code' => 'FYT',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Genre Fiction',\n\t\t\t\t'code' => 'FF; FH; FJ; FK; FL; FM; FP; FQ; FR; FT; FV; FW; FX',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Historical Fiction',\n\t\t\t\t'code' => 'FV',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'History & Critism',\n\t\t\t\t'code' => 'DS',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Horror',\n\t\t\t\t'code' => 'FK',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Humor & Satire',\n\t\t\t\t'code' => 'WH',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Literary Fiction',\n\t\t\t\t'code' => 'DD',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mythology & Folk Tales',\n\t\t\t\t'code' => 'FQ',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Poetry',\n\t\t\t\t'code' => 'YD; DC',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Religious & Inpirational Fiction',\n\t\t\t\t'code' => 'FW',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Short Stories',\n\t\t\t\t'code' => 'YFU; FY',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all Literature & Fiction',\n\t\t\t\t'code' => 'D, F',\n\t\t\t\t'parent_id' => 73,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Administrative & Policy',\n\t\t\t\t'code' => 'MB',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Alternative & Holistic',\n\t\t\t\t'code' => 'VX',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Basic Science',\n\t\t\t\t'code' => 'MF',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Dentistry',\n\t\t\t\t'code' => 'MM; MMD',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Diseases',\n\t\t\t\t'code' => 'MJ',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Education & Training',\n\t\t\t\t'code' => 'MR',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Internal Medicine',\n\t\t\t\t'code' => 'MJ',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Nursing',\n\t\t\t\t'code' => 'MQ',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Pharmcology',\n\t\t\t\t'code' => 'MM; MMG',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Physician & Patient',\n\t\t\t\t'code' => 'MBD',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Reference',\n\t\t\t\t'code' => 'MR',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Reproductive Medicine & Technology',\n\t\t\t\t'code' => 'MFK',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Research',\n\t\t\t\t'code' => 'MM',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Special Topics',\n\t\t\t\t'code' => 'MX',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Veterinary Medicine',\n\t\t\t\t'code' => 'MZ',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all medical eBooks',\n\t\t\t\t'code' => 'M',\n\t\t\t\t'parent_id' => 74,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Crime Fiction',\n\t\t\t\t'code' => 'FF',\n\t\t\t\t'parent_id' => 75,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mystery',\n\t\t\t\t'code' => 'FF',\n\t\t\t\t'parent_id' => 75,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Suspense',\n\t\t\t\t'code' => 'FH',\n\t\t\t\t'parent_id' => 75,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Thriller',\n\t\t\t\t'code' => 'FH',\n\t\t\t\t'parent_id' => 75,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all mystery, thriller & suspense',\n\t\t\t\t'code' => 'F',\n\t\t\t\t'parent_id' => 75,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Arts & Photography',\n\t\t\t\t'code' => 'UD; AG; AJ; AK',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Biographies & Memoirs',\n\t\t\t\t'code' => 'BG; BM',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Bussiness & Investing',\n\t\t\t\t'code' => 'KJ',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Children\\'s Non-fiction',\n\t\t\t\t'code' => 'YN',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Computers & Technology',\n\t\t\t\t'code' => 'TB; UB; UK; UM; UQ; UR; UY',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Cooking, Food & Wine',\n\t\t\t\t'code' => 'WB',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Craft, Hobbies & Home',\n\t\t\t\t'code' => 'WF',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Education & Reference',\n\t\t\t\t'code' => 'JN',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Engineering & Transportation',\n\t\t\t\t'code' => 'WG; TC; TG; TH; TJ; TN; TQ',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Health, Fitness & Dieting',\n\t\t\t\t'code' => 'VF; VX',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'History',\n\t\t\t\t'code' => 'HB',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Law',\n\t\t\t\t'code' => 'LA',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Literary Criticism & Theory',\n\t\t\t\t'code' => 'DS',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Medical ebooks',\n\t\t\t\t'code' => 'MB',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Parenting & Relationships',\n\t\t\t\t'code' => 'VF; JH',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Political & Social Sciences',\n\t\t\t\t'code' => 'JP',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Science',\n\t\t\t\t'code' => 'PD; PS',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Self-Help',\n\t\t\t\t'code' => 'VS',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sports',\n\t\t\t\t'code' => 'WS',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Travel',\n\t\t\t\t'code' => 'WT',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all Non-fiction',\n\t\t\t\t'code' => 'D',\n\t\t\t\t'parent_id' => 76,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Adoption',\n\t\t\t\t'code' => 'VF; JK',\n\t\t\t\t'parent_id' => 77,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Aging Parents',\n\t\t\t\t'code' => 'VF; JK',\n\t\t\t\t'parent_id' => 77,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Family Activities',\n\t\t\t\t'code' => 'VF',\n\t\t\t\t'parent_id' => 77,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Family Health',\n\t\t\t\t'code' => 'VF',\n\t\t\t\t'parent_id' => 77,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Family Relationships',\n\t\t\t\t'code' => 'VFV',\n\t\t\t\t'parent_id' => 77,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Fertility',\n\t\t\t\t'code' => 'MF',\n\t\t\t\t'parent_id' => 77,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Parenting',\n\t\t\t\t'code' => 'VFX',\n\t\t\t\t'parent_id' => 77,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Special Needs',\n\t\t\t\t'code' => 'VFJB',\n\t\t\t\t'parent_id' => 77,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all Parenting & relationships',\n\t\t\t\t'code' => 'V',\n\t\t\t\t'parent_id' => 77,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Crime & Criminals',\n\t\t\t\t'code' => 'BT; FF; JK; YF',\n\t\t\t\t'parent_id' => 78,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Philosophy',\n\t\t\t\t'code' => 'HP',\n\t\t\t\t'parent_id' => 78,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'PolItics & Government',\n\t\t\t\t'code' => 'JP',\n\t\t\t\t'parent_id' => 78,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Social Sciences',\n\t\t\t\t'code' => 'J',\n\t\t\t\t'parent_id' => 78,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all politics & social sciences',\n\t\t\t\t'code' => 'J',\n\t\t\t\t'parent_id' => 78,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Almanacs & Yearbooks',\n\t\t\t\t'code' => 'GB',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Atlases & Maps',\n\t\t\t\t'code' => 'RG; WT; YR',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Catalogs & Directories',\n\t\t\t\t'code' => 'AG; GB',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Consumer Guides',\n\t\t\t\t'code' => 'WJ',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Dictionaries & Thesauruses',\n\t\t\t\t'code' => 'CB; EB; GB',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Encyclopedias',\n\t\t\t\t'code' => 'GB',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Etiquette',\n\t\t\t\t'code' => 'WJ',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Foreign Language Study & Reference',\n\t\t\t\t'code' => 'CB; YQ; YR',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Genealogy',\n\t\t\t\t'code' => 'GT; HB',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Medical Reference',\n\t\t\t\t'code' => 'MB; MF; MJ; MM; MQ; MR; PH; PS; TT',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Quotations',\n\t\t\t\t'code' => 'GB',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Trivia & Fun Facts',\n\t\t\t\t'code' => 'WD; YN',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Words, Language & Grammar',\n\t\t\t\t'code' => 'CB; CF; CJ; EL',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Writing, Research & Publishing Guides',\n\t\t\t\t'code' => 'YQ; GP; KJ; KN',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all reference',\n\t\t\t\t'code' => 'G',\n\t\t\t\t'parent_id' => 79,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Agnoticism',\n\t\t\t\t'code' => 'HR',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Atheism',\n\t\t\t\t'code' => 'HRQ',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Buddhism',\n\t\t\t\t'code' => 'HRE',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Christian Books & Bibles',\n\t\t\t\t'code' => 'HRC',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Earth-Based Religions',\n\t\t\t\t'code' => 'HRQ',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Hinduism',\n\t\t\t\t'code' => 'HRG',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Islam',\n\t\t\t\t'code' => 'HRH',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Judaism',\n\t\t\t\t'code' => 'HRJ',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'New Age',\n\t\t\t\t'code' => 'AV',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Occult',\n\t\t\t\t'code' => 'HRQ',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Other Eastern Religions & Sacred Texts',\n\t\t\t\t'code' => 'HRK',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Other Religions, Practices & Sacred Texts',\n\t\t\t\t'code' => 'HRL',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Religious Fiction',\n\t\t\t\t'code' => 'FW',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Religious Studies & Reference',\n\t\t\t\t'code' => 'JF; JP; YN; YQ',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Spirituality',\n\t\t\t\t'code' => 'HR',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all religion & spirituality',\n\t\t\t\t'code' => 'H',\n\t\t\t\t'parent_id' => 80,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Contemporary',\n\t\t\t\t'code' => 'FA',\n\t\t\t\t'parent_id' => 81,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Fantasy',\n\t\t\t\t'code' => 'FM; YF',\n\t\t\t\t'parent_id' => 81,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Historical Romance',\n\t\t\t\t'code' => 'FR',\n\t\t\t\t'parent_id' => 81,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mystery & Suspense',\n\t\t\t\t'code' => 'FR',\n\t\t\t\t'parent_id' => 81,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Science Fiction',\n\t\t\t\t'code' => 'FX',\n\t\t\t\t'parent_id' => 81,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all romance',\n\t\t\t\t'code' => 'FR',\n\t\t\t\t'parent_id' => 81,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Agricultural Sciences',\n\t\t\t\t'code' => 'PG; TT; WN',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Astronomy & Space Science',\n\t\t\t\t'code' => 'JM; PS',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Behavioural Sciences',\n\t\t\t\t'code' => 'PS; RN; WN',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Biological Sciences',\n\t\t\t\t'code' => 'PN; PS; RB; TD',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Chemistry',\n\t\t\t\t'code' => 'RB; WN',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Earth Sciences',\n\t\t\t\t'code' => 'VS; WS; YQ; YX; 4',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Education',\n\t\t\t\t'code' => 'HD; RN; TQ; WN',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Enviroment',\n\t\t\t\t'code' => 'DN',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Essays & Commentary',\n\t\t\t\t'code' => 'PS',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Evolution',\n\t\t\t\t'code' => 'PD',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Experiments, Instruments & Measurement',\n\t\t\t\t'code' => 'PS; MF',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Genetics',\n\t\t\t\t'code' => 'WQ; CF; HB; HP',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'History & Philosophy',\n\t\t\t\t'code' => 'PB',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mathematics',\n\t\t\t\t'code' => 'M',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Medicine',\n\t\t\t\t'code' => 'PS; RN',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Nature & Ecology',\n\t\t\t\t'code' => 'PH',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Physics',\n\t\t\t\t'code' => 'GB; GL; MR',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Reference',\n\t\t\t\t'code' => 'T; UB; UT; YQ; 4K',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all science & Math',\n\t\t\t\t'code' => 'P',\n\t\t\t\t'parent_id' => 82,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Fantasy',\n\t\t\t\t'code' => 'FM',\n\t\t\t\t'parent_id' => 83,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Science Fiction',\n\t\t\t\t'code' => 'FL',\n\t\t\t\t'parent_id' => 83,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all science fiction & fantasy',\n\t\t\t\t'code' => 'F',\n\t\t\t\t'parent_id' => 83,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Creativity',\n\t\t\t\t'code' => 'CBV',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Eating Disorders & Body Image',\n\t\t\t\t'code' => 'VFJJ',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Happiness',\n\t\t\t\t'code' => 'VSP',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Inner Child',\n\t\t\t\t'code' => 'VSP',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Journal Writing',\n\t\t\t\t'code' => 'CBW; CBV',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Memory Improvement',\n\t\t\t\t'code' => 'VSPT',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Motivational',\n\t\t\t\t'code' => 'VSPM',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Personal Transformation',\n\t\t\t\t'code' => 'VS',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Self-Esteem',\n\t\t\t\t'code' => 'VSPM',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Spiritual',\n\t\t\t\t'code' => 'HRCS; HRLK; HRQM2',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Stress Management',\n\t\t\t\t'code' => 'VFJS',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all self-help',\n\t\t\t\t'code' => 'V',\n\t\t\t\t'parent_id' => 84,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Baseball',\n\t\t\t\t'code' => 'WSJT',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Basketball',\n\t\t\t\t'code' => 'WSJM',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Biographies',\n\t\t\t\t'code' => 'BGS',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Coaching',\n\t\t\t\t'code' => 'WSD',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Extreme Sports',\n\t\t\t\t'code' => 'WSE',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Football (American)',\n\t\t\t\t'code' => 'WSJF',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Golf',\n\t\t\t\t'code' => 'WSJG',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Hockey',\n\t\t\t\t'code' => 'WSJH',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mountaineering',\n\t\t\t\t'code' => 'WSZG',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Outdoors & Nature',\n\t\t\t\t'code' => 'WSZ',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Poker',\n\t\t\t\t'code' => 'WDMC2',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Racket Sports',\n\t\t\t\t'code' => 'WSJR',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Rodeos',\n\t\t\t\t'code' => 'WSN',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Soccer',\n\t\t\t\t'code' => 'WSJA',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Softball',\n\t\t\t\t'code' => 'WSJT',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Training',\n\t\t\t\t'code' => 'WSL',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Water Sports',\n\t\t\t\t'code' => 'WSS',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Winter Sports',\n\t\t\t\t'code' => 'WSW',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all sports & outdoors',\n\t\t\t\t'code' => 'WS',\n\t\t\t\t'parent_id' => 85,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Art, Music & Photography',\n\t\t\t\t'code' => 'YN',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Biography',\n\t\t\t\t'code' => 'BGF',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Comics & Graphic Novels',\n\t\t\t\t'code' => 'YFW',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Education & Reference',\n\t\t\t\t'code' => 'YQ',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Historial Fiction',\n\t\t\t\t'code' => 'YFT',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Horror',\n\t\t\t\t'code' => 'YFD',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Literature & Fiction',\n\t\t\t\t'code' => 'YFA; YNL',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Mysteries & Thrillers',\n\t\t\t\t'code' => 'YFC',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Personal health',\n\t\t\t\t'code' => 'YX',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Religion & Spirituality',\n\t\t\t\t'code' => 'YXZR; YQR',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Romance',\n\t\t\t\t'code' => 'YFM',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Science Fiction & Fantasy',\n\t\t\t\t'code' => 'YFG; YFH',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Social Issues',\n\t\t\t\t'code' => 'YXZ',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Sports & Outdoors',\n\t\t\t\t'code' => 'YNW',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all teen & young adult',\n\t\t\t\t'code' => 'Y',\n\t\t\t\t'parent_id' => 86,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Africa',\n\t\t\t\t'code' => 'WTR; 1H',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Asia',\n\t\t\t\t'code' => 'WTR; 1F',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Australia & South Pacific',\n\t\t\t\t'code' => 'WTR; 1M',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Canada',\n\t\t\t\t'code' => 'WTR; 1KBC',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Caribbean',\n\t\t\t\t'code' => 'WTR; 1KJ',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Central & South Asia',\n\t\t\t\t'code' => 'WTR; 1FC; 1FM',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Europe',\n\t\t\t\t'code' => 'WTR; 1D',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Food, Lodging & Transportation',\n\t\t\t\t'code' => 'WTH',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Middle East',\n\t\t\t\t'code' => 'WTR; 1FB',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Pictorial',\n\t\t\t\t'code' => 'WTM',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Polar Regions',\n\t\t\t\t'code' => 'WTR; 1MT',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Reference',\n\t\t\t\t'code' => 'WZ; GBG',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Travel Writing',\n\t\t\t\t'code' => 'WTL',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'United States',\n\t\t\t\t'code' => 'WTR; 1K',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'See all travel',\n\t\t\t\t'code' => 'WT',\n\t\t\t\t'parent_id' => 87,\n\t\t\t\t'type' => 'international',\n\t\t\t],\n\t\t]);\n\t}", "public function create()\n {\n $parentcategory = Parentcategory::all();\n return view('childcategories.create')->with(compact('parentcategory'));\n }", "function show_cats2($cats_grouped_by_parent, $parent_id = 0) {\n\t\t\t\tglobal $baseurl;\n\t\t\t\tglobal $loc_slug;\n\t\t\t\tglobal $loc_type;\n\t\t\t\tglobal $loc_id;\n\t\t\t\tglobal $cat_items_count;\n\n\t\t\t\tif($parent_id == 0) {\n\t\t\t\t\techo '<ul class=\"cat-tree cat-main-parent\">';\n\t\t\t\t} else {\n\t\t\t\t\techo '<ul class=\"cat-tree\">';\n\t\t\t\t}\n\n\t\t\t\t/*\n$tree .= '<a href=\"' . $baseurl . '/' . $loc_slug . '/list/' . $cat_slug3 . '/' . $loc_type . '-' . $loc_id . '-' . $cat_id3 . '-1\">' . $plural_name3 . \"($this_cat_count3)\" . '</a>';\n\t\t\t\t*/\n\n\t\t\t\tif(!empty($cats_grouped_by_parent)) {\n\t\t\t\t\tforeach ($cats_grouped_by_parent[$parent_id] as $v) {\n\t\t\t\t\t\t$this_cat_slug = (!empty($v['plural_name'])) ? to_slug($v['plural_name']) : to_slug($v['cat_name']);\n\t\t\t\t\t\t$this_cat_name = (!empty($v['plural_name'])) ? $v['plural_name'] : $v['cat_name'];\n\t\t\t\t\t\t$this_cat_id = $v['cat_id'];\n\t\t\t\t\t\t$this_iconfont_tag = (!empty($v['iconfont_tag'])) ? $v['iconfont_tag'] : '';\n\t\t\t\t\t\t$this_cat_count = (!empty($cat_items_count[$this_cat_id])) ? $cat_items_count[$this_cat_id] : 0;\n\n\t\t\t\t\t\techo '<li data-cat-id=\"' . $v['cat_id'] . '\"> ';\n\t\t\t\t\t\t\techo \"<a href='$baseurl/$loc_slug/list/$this_cat_slug/$loc_type-$loc_id-$this_cat_id-1'>\n\t\t\t\t\t\t\t\t$this_iconfont_tag $this_cat_name ($this_cat_count)</a>\";\n\n\n\n\t\t\t\t\t\t\t//if there are children\n\t\t\t\t\t\t\tif (!empty($cats_grouped_by_parent[$this_cat_id])) {\n\t\t\t\t\t\t\t\tshow_cats2($cats_grouped_by_parent, $this_cat_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\techo '</ul>';\n\t\t\t}", "private function _child_subtree($cat_id, $cat_array, $depth)\n\t{\n\t\t$catarray = array();\n\n\t\t$depth++;\n\n\t\tforeach ($cat_array as $key => $val)\n\t\t{\n\t\t\tif ($cat_id == $val['cat_parent'])\n\t\t\t{\n\t\t\t\t// The following if statement is added to try and prevent the same category twice.\n\t\t\t\tif ( ! in_array($val['cat_id'], $this->_cat_ids, TRUE)) \n\t\t\t\t{\n\t\t\t\t\tforeach ($val AS $the_key => $the_val)\n\t\t\t\t\t{\n\t\t\t\t\t\t$arr[$the_key] = $the_val;\n\t\t\t\t\t}\n\n\t\t\t\t\t$arr = array_merge($arr, array('depth' => $depth));\n\n\t\t\t\t\t$this->_cat_ids = array_merge(array($val['cat_id']),$this->_cat_ids);\n\n\t\t\t\t\t$this->_child_subtree($key, $cat_array, $depth);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function cl_woo_get_cat_filter_children( $parent_term_id = null ) {\n\n\t$output = array();\n\t$child_terms = null;\n\n\t//Get children of this term\n\t$child_terms = Prso_Woocom::get_product_terms(\n\t\tarray(\n\t\t\t'parent' => $parent_term_id,\n\t\t)\n\t);\n\n\tif ( isset( $child_terms->terms ) && ! empty( $child_terms->terms ) ) {\n\n\t\tforeach ( $child_terms->terms as $key => $grandchild_term ) {\n\n\t\t\t$child_terms->terms[ $key ]->children = cl_woo_get_cat_filter_children( $grandchild_term->term_id );\n\n\t\t}\n\n\t\t$output = $child_terms->terms;\n\n\t}\n\n\treturn $output;\n}", "function generateallActiveTree(&$tree, $parentid = 0) {\n $this->db->select('id,name,shortdesc,status,parentid,page_uri,orderr');\n $this->db->where ('parentid',$parentid);\n $this->db->where ('status','active');\n $this->db->order_by('orderr asc, parentid asc');\n $res = $this->db->get('adminmenu');\n if ($res->num_rows() > 0) {\n foreach ($res->result_array() as $r) {\n\n // push found result onto existing tree\n $tree[$r['id']] = $r;\n // create placeholder for children\n $tree[$r['id']]['children'] = array();\n // find any children of currently found child\n $this->generateallActiveTree($tree[$r['id']]['children'],$r['id']);\n }\n }\n }", "function tep_make_cat_dmlist($rootcatid = 0, $maxlevel = 0){\n\n global $cPath_array, $show_full_tree, $languages_id;\n\t\t\n global $idname_for_menu, $cPath_array, $show_full_tree, $languages_id;\n\n // Modify category query if not fetching all categories (limit to root cats and selected subcat tree)\n\t\tif (!$show_full_tree) {\n $parent_query\t= 'AND (c.parent_id = \"0\"';\t\n\t\t\t\t\n\t\t\t\tif (isset($cPath_array)) {\n\t\t\t\t\n\t\t\t\t $cPath_array_temp = $cPath_array;\n\t\t\t\t\n\t\t\t\t foreach($cPath_array_temp AS $key => $value) {\n\t\t\t\t\t\t $parent_query\t.= ' OR c.parent_id = \"'.$value.'\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tunset($cPath_array_temp);\n\t\t\t\t}\t\n\t\t\t\t\n $parent_query .= ')';\t\t\t\t\n\t\t} else {\n $parent_query\t= '';\t\n\t\t}\t\t\n\n\t\t$result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and cd.language_id=\"' . (int)$languages_id .'\" '.$parent_query.'order by sort_order, cd.categories_name');\n \n\t\twhile ($row = tep_db_fetch_array($result)) {\t\t\t\t\n $table[$row['parent_id']][$row['categories_id']] = $row['categories_name'];\n }\n\n $output .= tep_make_cat_dmbranch($rootcatid, $table, 0, $maxlevel);\n\n return $output;\n}", "public function childs()\n {\n return $this->hasMany(Category::class, 'procreator_id')->orderBy('index');\n }", "public function create()\n\t{\n\t\t$categories = Category::where('parent_id', 0)->get();\n\t\t$categoriesSelect = [];\n\t\t$categoriesSelect[0] = 'Старша Категорія';\n\t\tforeach ($categories as $parent){\n\t\t\t$categoriesSelect[$parent->id] = $parent->title;\n\t\t\tforeach ($parent->children as $child1){\n\t\t\t\t$categoriesSelect[$child1->id] = '- '.$child1->title;\n\t\t\t\tforeach ($child1->children as $child2){\n\t\t\t\t\t$categoriesSelect[$child2->id] = '-- '.$child2->title;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn View::make('admin.categorynew', compact('categoriesSelect'));\n\t}", "public function getChildren() {\n\t\t$children = $this->categoryRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "public function get_children();", "public function create()\n {\n $parent = $this->categoryRepo->gLevel(0);\n $child = $this->categoryRepo->gLevel(1);\n $subchild = $this->categoryRepo->gLevel(2);\n return Response()->json([$parent, $child, $subchild]);\n // return view('category.create', compact('parent', 'child', 'subchild'));\n }", "private static function get_children($id = 0, $opener = false, $show_post_count = false)\r\n {\r\n self::$categories .= '<ul>' . \"\\n\";\r\n\r\n foreach(parent::$category_path as $key => $value)\r\n {\r\n if($value['parent_id'] == $id && $value['status'] == '1')\r\n {\r\n if($value['id'] == parent::$category_id)\r\n {\r\n $selector = ' class=\"current\"';\r\n } else if(is_array(self::$parents) && in_array($value['id'], self::$parents) === true)\r\n {\r\n $selector = ' class=\"parent\"';\r\n } else\r\n {\r\n $selector = '';\r\n }\r\n\r\n self::$categories .= '<li>';\r\n self::$categories .= _rex488_FrontendCategory::format_category($value, $selector, $show_post_count);\r\n\r\n if($value['children'] > 0 && (self::$parents[$key] == $value['id'] || $opener == true))\r\n {\r\n self::get_children($value['id'], $opener, $show_post_count);\r\n }\r\n\r\n self::$categories .= '</li>' . \"\\n\";\r\n }\r\n }\r\n\r\n self::$categories .= '</ul>' . \"\\n\";\r\n }", "public function children()\n {\n return $this->hasMany(App\\Models\\Catagory::class);\n }", "public function children(){\n return $this->hasMany(self::class, 'parent_id');\n }", "public function getChildProducts(Product $parent);", "public function create($value, $parent)\n {\n $this->category->create([\n 'value' => $value\n ]);\n if ($parent !== 0) {\n $parentCategory = Category::where('id', $parent)->first();\n $parentCategory->makeSiblingOf($this->category);\n } else {\n $this->category->makeRoot();\n }\n }", "public function run()\n {\n Category::create(['name' => 'Sách trong nước']);\n Category::create(['name' => 'Foreign books']);\n Category::create(['name' => 'Sách học ngoại ngữ']);\n\n //Sách trong nước\n Category::create([\n 'name' => 'Nuôi dạy con',\n 'parent_id' => 1,\n ]);\n Category::create([\n 'name' => 'Khoa học kỹ thuật',\n 'parent_id' => 1,\n ]);\n Category::create([\n 'name' => 'Sách thiếu nhi',\n 'parent_id' => 1,\n ]);\n\n //Sách nước ngoài\n Category::create([\n 'name' => 'Popular books',\n 'parent_id' => 2,\n ]);\n Category::create([\n 'name' => 'Books by Category',\n 'parent_id' => 2,\n ]);\n\n //Sách học ngoại ngữ\n Category::create([\n 'name' => 'Sách ngoại ngữ',\n 'parent_id' => 3,\n ]);\n Category::create([\n 'name' => 'Từ điển',\n 'parent_id' => 3,\n ]);\n\n //Nuôi dạy con\n Category::create([\n 'name' => 'Dành cho mẹ bầu',\n 'parent_id' => 4,\n ]);\n Category::create([\n 'name' => 'Dinh dưỡng cho trẻ',\n 'parent_id' => 4,\n ]);\n Category::create([\n 'name' => 'Cẩm nang làm cha mẹ',\n 'parent_id' => 4,\n ]);\n Category::create([\n 'name' => 'Phát triển trí tuệ cho trẻ',\n 'parent_id' => 4,\n ]);\n Category::create([\n 'name' => 'Phát triển kỹ năng cho trẻ',\n 'parent_id' => 4,\n ]);\n Category::create([\n 'name' => 'Giáo dục trẻ tuổi teen',\n 'parent_id' => 4,\n ]);\n\n //Khoa học kỹ thuật\n Category::create([\n 'name' => 'Tin học',\n 'parent_id' => 5,\n ]);\n Category::create([\n 'name' => 'Y học',\n 'parent_id' => 5,\n ]);\n Category::create([\n 'name' => 'Điện - Điện tử',\n 'parent_id' => 5,\n ]);\n Category::create([\n 'name' => 'Cơ khí',\n 'parent_id' => 5,\n ]);\n Category::create([\n 'name' => 'Kiến trúc - Xây dựng',\n 'parent_id' => 5,\n ]);\n Category::create([\n 'name' => 'Nông - Lâm - Ngư nghiệp',\n 'parent_id' => 5,\n ]);\n Category::create([\n 'name' => 'Khoa học - Vũ trụ',\n 'parent_id' => 5,\n ]);\n Category::create([\n 'name' => 'Khoa học khác',\n 'parent_id' => 5,\n ]);\n\n //Sách thiếu nhi\n Category::create([\n 'name' => 'Truyện tranh',\n 'parent_id' => 6,\n ]);\n Category::create([\n 'name' => 'Truyện đọc',\n 'parent_id' => 6,\n ]);\n Category::create([\n 'name' => 'Tô màu - Luyện chữ',\n 'parent_id' => 6,\n ]);\n Category::create([\n 'name' => 'Kiến thức bách khoa',\n 'parent_id' => 6,\n ]);\n Category::create([\n 'name' => 'Manga-Comic',\n 'parent_id' => 6,\n ]);\n\n //Popular books\n Category::create([\n 'name' => 'New Arrivals',\n 'parent_id' => 7,\n ]);\n Category::create([\n 'name' => 'Best Sellers',\n 'parent_id' => 7,\n ]);\n Category::create([\n 'name' => 'The New York Times Best Sellers',\n 'parent_id' => 7,\n ]);\n Category::create([\n 'name' => 'English Language Teaching-ELT',\n 'parent_id' => 7,\n ]);\n Category::create([\n 'name' => 'Dictionary and Thesarus',\n 'parent_id' => 7,\n ]);\n Category::create([\n 'name' => 'Japanese Books',\n 'parent_id' => 7,\n ]);\n Category::create([\n 'name' => 'German Books',\n 'parent_id' => 7,\n ]);\n Category::create([\n 'name' => 'Others',\n 'parent_id' => 7,\n ]);\n\n //Books by Category\n Category::create([\n 'name' => 'Business, Finance and Law',\n 'parent_id' => 8,\n ]);\n Category::create([\n 'name' => 'Self-help',\n 'parent_id' => 8,\n ]);\n Category::create([\n 'name' => 'Fiction',\n 'parent_id' => 8,\n ]);\n Category::create([\n 'name' => 'Biographies and Memoirs',\n 'parent_id' => 8,\n ]);\n Category::create([\n 'name' => 'Young Adult Books',\n 'parent_id' => 8,\n ]);\n Category::create([\n 'name' => 'Children\\'s Books',\n 'parent_id' => 8,\n ]);\n Category::create([\n 'name' => 'Food and Drink',\n 'parent_id' => 8,\n ]);\n Category::create([\n 'name' => 'Crafts and Hobbies',\n 'parent_id' => 8,\n ]);\n Category::create([\n 'name' => 'Other Languages',\n 'parent_id' => 8,\n ]);\n Category::create([\n 'name' => 'Others',\n 'parent_id' => 8,\n ]);\n\n //Sách ngoại ngữ\n Category::create([\n 'name' => 'Tiếng Anh',\n 'parent_id' => 9,\n ]);\n Category::create([\n 'name' => 'Tiếng Pháp',\n 'parent_id' => 9,\n ]);\n Category::create([\n 'name' => 'Tiếng Hàn',\n 'parent_id' => 9,\n ]);\n Category::create([\n 'name' => 'Tiếng Nhật',\n 'parent_id' => 9,\n ]);\n Category::create([\n 'name' => 'Tiếng Hoa',\n 'parent_id' => 9,\n ]);\n Category::create([\n 'name' => 'Tiếng Đức',\n 'parent_id' => 9,\n ]);\n Category::create([\n 'name' => 'Tiếng Việt cho người nước ngoài',\n 'parent_id' => 9,\n ]);\n\n //Từ điển\n Category::create([\n 'name' => 'Từ Điển Tiếng Việt',\n 'parent_id' => 10,\n ]);\n Category::create([\n 'name' => 'Từ Điển Tiếng Anh-Việt, Việt-Anh',\n 'parent_id' => 10,\n ]);\n Category::create([\n 'name' => 'Từ Điển Tiếng Pháp-Việt, Việt-Pháp',\n 'parent_id' => 10,\n ]);\n Category::create([\n 'name' => 'Từ Điển Tiếng Đức-Việt, Việt-Đức',\n 'parent_id' => 10,\n ]);\n Category::create([\n 'name' => 'Từ Điển Tiếng Nhật-Việt, Việt-Nhật',\n 'parent_id' => 10,\n ]);\n Category::create([\n 'name' => 'Từ Điển Tiếng Hàn-Việt, Việt-Hàn',\n 'parent_id' => 10,\n ]);\n Category::create([\n 'name' => 'Từ Điển Hán-Việt',\n 'parent_id' => 10,\n ]);\n Category::create([\n 'name' => 'Từ Điển Chuyên Ngành',\n 'parent_id' => 10,\n ]);\n }", "public function getParents() {}", "public function run()\n {\n DB::table('children')->delete();\n\n $children = array(\n ['id' => 1, 'lastname' => 'Morocho', 'firstname' => 'Nathan','slug' => 'NathanMorocho', 'dob' => new DateTime('05/04/2012'), 'childid' => '20741', 'servicestartdate' => new DateTime('05/04/2014'), 'serviceenddate' => new DateTime('05/04/2016'), 'servicecoordinatorname' => 'Kathleen Hinistroza', 'parentcaregivername' => 'Sonia Meza', 'address' => '735 W 172nd St, New York, NY','zipcode' => '10032', 'phone' => '9173456789', 'frequency' => '2x30', 'document' => '','created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 2, 'lastname' => 'Diaz', 'firstname' => 'Justin','slug' => 'JustinDiaz', 'dob' => new DateTime('05/04/2012'), 'childid' => '20741', 'servicestartdate' => new DateTime('05/04/2014'), 'serviceenddate' => new DateTime('05/04/2016'), 'servicecoordinatorname' => 'Kathleen Hinistroza', 'parentcaregivername' => 'Teresa Diaz', 'address' => '4395 Broadway APT 1D, New York, NY 10040','zipcode' => '10032', 'phone' => '9171234567', 'frequency' => '2x30', 'document' => '','created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 3, 'lastname' => 'Rivera', 'firstname' => 'Isabella','slug' => 'IsabellaRivera', 'dob' => new DateTime('01/04/2012'), 'childid' => '20741', 'servicestartdate' => new DateTime('01/04/2014'), 'serviceenddate' => new DateTime('01/04/2016'), 'servicecoordinatorname' => 'Dileydy Hiches', 'parentcaregivername' => 'Sandra Castro', 'address' => '790 Riverside Dr APT 1F, New York, NY','zipcode' => '10032', 'phone' => '9173456789', 'frequency' => '2x30', 'document' => '','created_at' => new DateTime, 'updated_at' => new DateTime],\n );\n\n // Uncomment the below to run the seeder\n DB::table('children')->insert($children);\n }" ]
[ "0.69632053", "0.68126905", "0.6769302", "0.66860455", "0.6643269", "0.6547215", "0.6450639", "0.64326674", "0.6418922", "0.64078414", "0.6407712", "0.6407447", "0.63696295", "0.6342336", "0.6326364", "0.6314725", "0.62747955", "0.6270214", "0.6259589", "0.6258637", "0.6256193", "0.62473965", "0.62088704", "0.62077963", "0.61916465", "0.617661", "0.6114747", "0.6114713", "0.608693", "0.6079139", "0.6069187", "0.60585207", "0.605816", "0.60567963", "0.60562676", "0.60361856", "0.602876", "0.60123277", "0.6000048", "0.5996685", "0.59946483", "0.59695435", "0.5952508", "0.5944846", "0.59409004", "0.5898236", "0.5855256", "0.585361", "0.5850893", "0.5849964", "0.5819173", "0.5802271", "0.5801171", "0.58002627", "0.5794472", "0.5793971", "0.57888824", "0.57855666", "0.5784802", "0.57764745", "0.5774976", "0.57623017", "0.5758915", "0.5757184", "0.5756122", "0.57521826", "0.57447016", "0.5744274", "0.5734977", "0.57075584", "0.5707123", "0.5707114", "0.57011", "0.5680677", "0.56759447", "0.5670394", "0.566094", "0.5660656", "0.56585485", "0.5652192", "0.56486773", "0.5645723", "0.56456083", "0.56383085", "0.56284046", "0.5622839", "0.5620801", "0.5617871", "0.5614439", "0.5613817", "0.5611234", "0.56071526", "0.5601644", "0.560155", "0.56013113", "0.5598843", "0.5594502", "0.5592395", "0.5585017", "0.556927" ]
0.6209499
22
Get children of a category.
public function getChildren($parentID) { $tmp = []; foreach($this->categoryList as $key => $item){ if($item->parentID == $parentID) { $tmp[] = $item; } } return $tmp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChildren() {\n\t\t$children = $this->categoryRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "public function getChildrensOf(CategoryInterface $category);", "public function getChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n $children = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $children[] = new self((int) $result->getValue('category_id'), $this->clang_id);\n $result->next();\n }\n return $children;\n }", "public function children()\n {\n return $this->hasMany(Category::class, 'parent_id', 'id');\n }", "public function collectChildren($category)\n {\n $children = [];\n //push parent id\n array_push($children, $category->id);\n //push children id\n foreach($category->children as $child) {\n array_push($children, $child->id);\n if($child->children()->count()) {\n return array_merge($children, $this->collectChildren($child));\n }\n }\n return $children;\n }", "public function children()\n {\n return $this->hasMany('App\\Models\\Category', 'parent_id', 'id');\n }", "public function getChildrensOf(CategoryInterface $category)\n {\n return $category->getChildrens();\n }", "public function get_children();", "public function children(): HasMany\n {\n return $this->hasMany(Category::class, 'parent_id');\n }", "public function children()\n {\n return $this->hasMany('App\\Model\\Products\\Category', 'parent_id');\n }", "public function getChilds($category_id) {\n $categoryTableName = $this->info('name');\n\n $category = Engine_Api::_()->getItem('siteevent_category', $category_id);\n\n $select = $this->select()\n ->from($categoryTableName, array('category_id', 'category_name'))\n ->where(\"cat_dependency = ?\", $category_id);\n\n //IF SUBCATEGORY THEN FETCH 3RD LEVEL CATEGORY\n if ($category->cat_dependency != 0 && $category->subcat_dependency == 0) {\n $select->where(\"subcat_dependency = ?\", $category_id);\n }\n //IF CATEGORY THEN FETCH SUB-CATEGORY\n elseif ($category->cat_dependency == 0 && $category->subcat_dependency == 0) {\n $select->where(\"subcat_dependency = ?\", 0);\n }\n //IF 3RD LEVEL CATEGORY\n else {\n return array();\n }\n\n return $this->fetchAll($select);\n }", "public function getChildrenCategories()\n {\n $childrenCategories = $this->getCategory()->getChildrenCategories();\n\n Mage::dispatchEvent(\n 'category_filter_get_children_categories',\n array(\n 'filter' => $this,\n 'category' => $this->getLayer()->getCurrentCategory(),\n 'children_categories' => $childrenCategories\n )\n );\n\n return $childrenCategories;\n }", "public function GetChildCategories()\n\t\t{\n\t\t\t$categoryId = $this->GetCatId();\n\t\t\t$childCatsCache = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('ChildCategories');\n\n\t\t\t// The cache has a cached version of the children for this category so just return it\n\t\t\tif(isset($childCatsCache[$categoryId])) {\n\t\t\t\treturn explode(',', $childCatsCache[$categoryId]);\n\t\t\t}\n\n\t\t\tif(!is_array($childCatsCache)) {\n\t\t\t\t$childCatsCache = array();\n\t\t\t}\n\n\t\t\t$childCats = array();\n\t\t\t$query = \"\n\t\t\t\tSELECT categoryid\n\t\t\t\tFROM [|PREFIX|]categories\n\t\t\t\tWHERE CONCAT(',', catparentlist, ',') LIKE '%,\".(int)$categoryId.\",%' AND categoryid!='\".(int)$categoryId.\"'\n\t\t\t\";\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile($child = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$childCats[] = $child['categoryid'];\n\t\t\t}\n\t\t\t$childCatsCache[$categoryId] = implode(',', $childCats);\n\t\t\t$GLOBALS['ISC_CLASS_DATA_STORE']->Save('ChildCategories', $childCatsCache);\n\t\t\treturn $childCats;\n\t\t}", "public function children() : HasMany\n {\n return $this->hasMany('App\\Category', 'parent_id');\n }", "public function getChildren($categoryID, $type=''){\n\t\t$this -> db -> select('*');\n\t\t$where = array(\n\t\t\t'fid' => intval($cateogryID),\n\t\t\t'type' => $type,\n\t\t\t);\n\t\t$this -> db -> where($categoryID);\n\t\t$this -> db -> order_by('sort');\n\t\treturn $this -> db -> get($this -> tableName) -> result_array();\n\t}", "public function getAllChildCategories($categoryId)\n {\n $select = $this->getConnection()->select()\n ->from($this->getTable(self::MAIN_TABLE_NAME))\n ->where(CategoryInterface::PATH . ' LIKE ?', $categoryId . '/%')\n ->orWhere(CategoryInterface::PATH . ' LIKE ?', '%/' . $categoryId . '/%');\n\n return $this->getConnection()->fetchAll($select);\n }", "public function getAllChildren(Category $category, $with_products = true): Collection\n {\n if($with_products){\n $node = $this->entity();\n $node = $node::with('products');\n } else\n $node = $this->query();\n\n $categories = $node->descendantsOf($category);\n\n return $categories;\n }", "public static function getAllChild($categoryId)\n {\n $category = self::retrieveById($categoryId);\n\n if ($category != null) {\n $childCategories = array();\n $category->getChildSeries($childCategories);\n return $childCategories;\n }\n else {\n return null;\n }\n }", "public function getAllCategories() {\n\n if (!isset(parent::all()[0])) {\n return [];\n }\n return parent::all()[0]->children;\n }", "function get_category_children($id, $before = '/', $after = '', $visited = array())\n {\n }", "public function getChildren()\n {\n $editors = BaseManager::build('FelixOnline\\Core\\Category', 'category', 'id')\n ->filter(\"parent = %i\", array($this->getId()))\n ->values();\n\n return $editors;\n }", "public static function getCategoryChildren($categoryLOC) {\n\t\t\t$db = Db::getInstance();\n\t\t\t// Regex that grabs all of the children of one category using location\n\t\t\t$regexForChildren = \"^\" . $categoryLOC . \".[0-9]+$\";\n\t\t\t$categoryQuery = $db->prepare('SELECT location, description \n\t\t\t\t\t\t\t\t\t\t\t FROM categories \n\t\t\t\t\t\t\t\t\t\t\tWHERE location REGEXP :regex\n\t\t\t\t\t\t\t\t\t\t ORDER BY location'\n\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t$categoryQuery->execute(array('regex' => $regexForChildren));\n\t\t\t$childrenList = $categoryQuery->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $childrenList;\n\t\t}", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "function &getChildren()\n\t{\n global $jlistConfig;\n \n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\t// Order subcategories\n\t\tif (sizeof($this->_children)) {\n\t\t\t$params = $this->getState()->get('params');\n \n // Sort order defined in menu?\n $orderby_pri = $params->get('orderby_pri');\n \n if (!$orderby_pri){\n // When not we use jD settings\n $cats_order = (int)$jlistConfig['cats.order'];\n if ($cats_order == 1){\n $params->set('orderby_pri', 'alpha');\n } elseif ($cats_order == 2){\n $params->set('orderby_pri', 'ralpha');\n } \n }\n \n\t\t\tif ($params->get('orderby_pri') == 'alpha' || $params->get('orderby_pri') == 'ralpha') {\n\t\t\t\t$this->_children = ArrayHelper::sortObjects($this->_children, 'title', ($params->get('orderby_pri') == 'alpha') ? 1 : (-1));\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_children;\n\t}", "function &getChildren()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\t// Order subcategories\n\t\tif (count($this->_children))\n\t\t{\n\t\t\t$params = $this->getState()->get('params');\n\t\t\tif ($params->get('orderby_pri') == 'alpha' || $params->get('orderby_pri') == 'ralpha')\n\t\t\t{\n\t\t\t\tjimport('joomla.utilities.arrayhelper');\n\t\t\t\tJArrayHelper::sortObjects($this->_children, 'title', ($params->get('orderby_pri') == 'alpha') ? 1 : -1);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_children;\n\t}", "public function children() {\n return $this->descendants(1);\n }", "public function get_children() {\n\t\treturn $this->children;\n\t}", "public function getChildren()\n {\n if (!($this->parent_target_group instanceof self)) {\n return [];\n }\n\n // Only target groups without parent can have children\n $query = 'SELECT category_id FROM '. rex::getTablePrefix() .'d2u_courses_url_target_group_childs '\n .'WHERE target_group_id = '. $this->target_group_id .' ';\n if ('priority' === rex_config::get('d2u_courses', 'default_category_sort')) {\n $query .= 'ORDER BY priority';\n } else {\n $query .= 'ORDER BY name';\n }\n $result = rex_sql::factory();\n $result->setQuery($query);\n\n $target_children = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $category = new Category((int) $result->getValue('category_id'));\n $target_child = new self(0);\n $target_child->target_group_id = $category->category_id;\n $target_child->parent_target_group = $this;\n $target_child->name = $category->name;\n $target_child->picture = $category->picture;\n $target_child->updatedate = $category->updatedate;\n $target_children[] = $target_child;\n $result->next();\n }\n return $target_children;\n }", "public function children()\n\t{\n\t\treturn $this->descendants(1);\n\t}", "public function children()\n {\n return $this->hasMany(App\\Models\\Catagory::class);\n }", "public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function children()\r\n\t{\r\n\t\treturn $this->children;\r\n\t}", "public function includeChildren(Category $categories)\n\t{\n\t\tif (!is_null($categories->children)){\n\t\t\treturn $this->collection($categories->children, new CategoryTransformer);\n\t\t}\n\n\t}", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildrenQuery();", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren()\n {\n return $this->_children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->_children;\n\t}", "public function getChildren() \n {\n return $this->children;\n }", "public function findChildren($id_parent){\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.parent', $queryBuilder->createNamedParameter($id_parent))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.sys_language_uid', $queryBuilder->createNamedParameter($GLOBALS['TSFE']->sys_language_uid, \\PDO::PARAM_INT))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.deleted', $queryBuilder->createNamedParameter(0))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.hidden', $queryBuilder->createNamedParameter(0))\n )\n ->execute();\n $list_cat=[];\n while ($row = $statement->fetch()) {\n\n $list= array(\n 'uid' => $row['uid'],\n 'title' => $row['title'],\n 'parent' => $row['parent'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n );\n array_push($list_cat, $list);\n }\n\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.uid', $queryBuilder->createNamedParameter($id_parent))\n )\n \n ->execute();\n while ($row = $statement->fetch()) {\n $list=array(\n 'uid' =>$row['uid'],\n 'title' =>$row['title'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n 'children' => $list_cat);\n }\n return $list;\n }", "public function testGetAllChildren() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get\n $categories = $this->kb_category->get_all_children( $ph_kb_category->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( $name, $category->name );\n }", "public function GetChildren() {\n\t\treturn $this->Children;\n\t}", "public function childrenRecursive()\n\t\t{\n\t\t\treturn $this->children()->with('childrenRecursive');\n\t\t}", "public function getChildrenIterative(): array\n {\n //not using $this->getTopLevelParents, it would be concerns violation\n $topLevelParents = $this->categoryRepository->getTopLevelParents();\n\n $results[0] = $topLevelParents;\n $parents = $topLevelParents;\n\n $results = $this->iterate($results);\n\n return $results;\n }", "public function descendantCategories(Request $request)\n {\n $results = $this->getRepositoryInstance()->getVisibleCategoryTree($request->input('parent_id'));\n\n return $this->getResourceCollection($results);\n }", "public function childrenRecursive()\n {\n return $this->children()->with('childrenRecursive');\n }", "public function childrenRecursive()\n {\n return $this->children()->with('childrenRecursive');\n }", "public function getChildCategories()\n {\n if (!$this->hasData('category_tabs')) {\n $currentCategory = $this->getMainCategory();\n $results = [];\n if ($currentCategory) {\n $tabIds = $currentCategory->getData('sss_category_tab_ids');\n if (!is_array($tabIds)) {\n $tabIds = explode(',', $tabIds);\n }\n /**\n * Enable Catalog Category Flat ... \n * @var $tabCollection \\Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat\\Collection\n */\n if ($currentCategory->getUseFlatResource()) {\n $tabCollection = $currentCategory->getCollection();\n\n $tabCollection\n ->addIsActiveFilter()\n ->addAttributeToSelect('include_in_menu')\n ->addAttributeToSelect('sss_custom_tab_title')\n ->addAttributeToSelect('position')\n ->addAttributeToSelect('sss_tab_position')\n ->addAttributeToSelect('name')\n ->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES)\n ->addFieldToFilter('parent_id', ['eq' => $currentCategory->getId()]);\n\n $tabCollection->getSelect()\n ->orWhere('main_table.entity_id in (?)', $tabIds, \\Magento\\Framework\\DB\\Select::TYPE_CONDITION);\n\n $results = $tabCollection->getItems();\n } else {\n $tabCollection = $currentCategory->getChildrenCategories();\n if ($tabCollection instanceof AbstractCollection) {\n $tabCollection->setLoadProductCount(false);\n $tabCollection->addAttributeToSelect('sss_custom_tab_title');\n $tabCollection->addLevelFilter(3);\n try {\n $tabCollection->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES);\n } catch (\\Exception $e) {\n }\n $results = $tabCollection->getItems();\n } else {\n foreach ($tabCollection as $childCategory) {\n if (3 == $childCategory->getLevel()) {\n $results[] = $childCategory;\n }\n }\n }\n }\n usort($results, function ($first, $second) {\n if ($first->getData('sss_tab_position') || $second->getData('sss_tab_position')) {\n return $first->getData('sss_tab_position') >= $second->getData('sss_tab_position');\n } else {\n return $first->getData('position') >= $second->getData('position');\n }\n });\n }\n $this->setData('category_tabs', $results);\n }\n return $this->getData('category_tabs');\n }", "public function getChildren()\n\t{\n\t\treturn $this->_auth->getItemChildren($this->_calendarId,$this->_name);\n\t}", "public function getChildrenCategories(CategoryInterface $category)\n {\n $categoryLabels = [];\n foreach ($this->repository->findAllChildren($category) as $category) {\n $categoryLabels[] = $category;\n }\n return $categoryLabels;\n }", "function getChildrenForCat($catId) {\r\n $sql = \"SELECT * FROM categories WHERE parent_id = '{$catId}'\";\r\n\r\n include '../config/db.php';\r\n\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n return createSnartyRsArray($rs);\r\n}", "function get_children($left_id, $right_id, $level)\n\t{\n\t\tglobal $DBPrefix, $db;\n\t\t$query = \"SELECT * FROM \" . $DBPrefix . \"categories WHERE left_id > :left_id AND right_id < :right_id AND level = :level ORDER BY cat_name\";\n\t\t$params = array();\n\t\t$params[] = array(':left_id', $left_id, 'int');\n\t\t$params[] = array(':right_id', $right_id, 'int');\n\t\t$params[] = array(':level', ($level + 1), 'int');\n\t\t$db->query($query, $params);\n\t\t$children = array();\n\t\twhile($child = $db->fetch())\n\t\t{\n\t\t\t$children[] = $child;\n\t\t}\n\n\t\treturn $children;\n\t}", "public function children($id);", "public function get_children() : array\n {\n return $this->children;\n }", "public function children() {\n\t\treturn $this->hasMany(Forum::getSectionClass(), \"parent_id\")->orderBy(\"weight\", \"desc\");\n\t}", "public function Children()\n {\n return $this->Root->childrenOfSection($this->URLSegment);\n }", "public function getCategories($id = null, $children = false)\n {\n $call = \"/v{$this->version}/place_categories\";\n if ($id !== null) {\n $call .= '/' . $id;\n if ($children === true) {\n $call .= '/children';\n }\n } elseif ($children === true) {\n throw new Services_Qype_Exception('Cannot get children if no ID is supplied.');\n }\n\n $resp = $this->makeRequest($call);\n return $this->parseResponse($resp);\n }", "public function getAllCategories()\n {\n return $this->AllChildren()->filter('ClassName', PortfolioCategory::class);\n }", "public function children()\n{\n return $this->hasMany(Category::class, 'parent_id');\n}", "public function childrens()\n {\n return $this->hasMany(self::class, 'parent_id');\n }", "public function getChildren() {\n\t\t$placeRepository = t3lib_div::makeInstance('Tx_Wpj_Domain_Repository_PlaceRepository');\n\t\t$children = $placeRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "function get_children($id)\n\t{\n\t\trequire_lang('catalogues');\n\t\trequire_code('catalogues');\n\t\trequire_code('catalogues2');\n\n\t\t$child=1;\n\n\t\t// If the node is not a root node then get the name of the node\n\t\t$name=$GLOBALS['SITE_DB']->query_value_null_ok('catalogue_categories','c_name',array('id'=>intval($id)));\n\n\t\t$pagelinks=get_catalogue_entries_tree($name,NULL,NULL,NULL,NULL,NULL,false);\n\n\t\tif(count($pagelinks)>0)\n\t\t{\n\t\t\tfor($i=0;$i<count($pagelinks);$i++)\n\t\t\t{\n\t\t\t\tif($pagelinks[$i]['id']==$id)\n\t\t\t\t{\n\t\t\t\t\t$child=$pagelinks[$i]['child_count'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $child;\n\t}", "public function children()\n {\n $children = $this->getAttribute('children') ?: [];\n\n if ($children && ! is_array($children) && ! ($children instanceof Collection)) {\n return (array) $children;\n }\n\n return $children;\n }", "public function findAllCategories(): iterable;", "public function getCategories();", "public function getCategories();", "public function getChilds()\n {\n return $this->childs;\n }", "public function children()\n {\n return $this->hasMany(static::class, 'parent_id')->orderBy('name', 'asc');\n }", "public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}", "protected function getChildK2Categories()\n {\n $db = $this->db;\n $query = $db->getQuery(true);\n $query->select($db->quoteName(array('id', 'parent')));\n $query->from($db->quoteName('#__k2_categories'));\n $query->where($db->quoteName('published') . ' = 1');\n $query->where($db->quoteName('parent') . ' != 0');\n $db->setQuery($query);\n return $db->loadObjectList('id');\n }", "public function getAllCategories() {\n $allCategories= $this->getCategories(); \n foreach ($allCategories as $value){\n $value->setChildren($this->getSubCategories($value->getId()));\n }\n return $allCategories;\n \n }", "public function getChildren($selector = 'all') {\r\n\t\tif ($selector == 'all') return $this->children;\r\n\t\t$rslt = array();\r\n\t\t$attrs = $this->parseSelector($selector);\r\n\t\tforeach($this->children as $child) {\r\n\t\t\tif ($child->matchAttrs($attrs)) {\r\n\t\t\t\t$rslt[] = $child;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $rslt;\r\n\t}", "public function makeChildrenTree($categories)\n {\n $tmp = [];\n foreach ($categories as $key => $category){\n if(!key_exists('children', $category)) {\n $category->children = [];\n }\n\n // get children\n $children = $this->getChildren($category->categoryID);\n\n // call self to get a loop until every category has his children\n $category->children = $this->makeChildrenTree($children);\n\n $tmp[] = $category;\n }\n\n return Language::filterRows($tmp, false);\n }", "public function children()\n {\n if (is_a($this->children, 'Kirby\\Cms\\Pages') === true) {\n return $this->children;\n }\n\n return $this->children = Pages::factory($this->inventory()['children'], $this);\n }", "public function children() {\n\n if(isset($this->cache['children'])) return $this->cache['children'];\n\n $this->cache['children'] = new Children($this);\n\n $inventory = $this->inventory();\n\n // with page models\n if(!empty(static::$models)) {\n foreach($inventory['children'] as $dirname) {\n $child = new Page($this, $dirname);\n // let's create a model if one is defined\n if(isset(static::$models[$child->intendedTemplate()])) {\n $model = static::$models[$child->intendedTemplate()];\n $child = new $model($this, $dirname);\n }\n $this->cache['children']->data[$child->id()] = $child;\n }\n // without page models\n } else {\n foreach($inventory['children'] as $dirname) {\n $child = new Page($this, $dirname);\n $this->cache['children']->data[$child->id()] = $child;\n }\n }\n\n return $this->cache['children'];\n\n }", "public function children($self = FALSE, $direction = 'ASC', $limit = FALSE)\n {\n return $this->descendants($self, $direction, TRUE, FALSE, $limit);\n }", "public function getChildren() {\n $childNodes = $this->getNode()->getChildren();\n $children = array();\n foreach ($childNodes as $childNode) {\n $child = $childNode->getPage($this->getLang());\n if ($child) {\n $children[] = $child;\n }\n }\n return $children;\n }", "function get_children_list($left_id, $right_id, $return = 'cat_id')\n\t{\n\t\tglobal $DBPrefix, $db;\n\n\t\tif (empty($left_id) || empty($right_id))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t$query = \"SELECT \" . $return . \" FROM \" . $DBPrefix . \"categories WHERE left_id > :left_id AND right_id < :right_id\";\n\t\t$params = array();\n\t\t$params[] = array(':left_id', $left_id, 'int');\n\t\t$params[] = array(':right_id', $right_id, 'int');\n\t\t$db->query($query, $params);\n\t\t$children = array();\n\t\twhile($child = $db->fetch())\n\t\t{\n\t\t\t$children[] = $child;\n\t\t}\n\n\t\treturn $children;\n\t}", "public function getChilds();", "public function children ($selector = null) { \r\n\t\t\r\n\t\t$l = new XDTNodeList();\r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tforeach ($node->childNodes as $child) $l->add($child);\r\n\t\t\t\r\n\t\tif (!isset($selector)) return $l;\r\n\t\t\r\n\t\t$this->xml_query = $l;\r\n\t\treturn $this->select($selector, null, XDT::SELECT_FILTER);\r\n\t}", "public function childs()\n {\n return $this->hasMany(Category::class, 'procreator_id')->orderBy('index');\n }", "protected function getChildren()\n\t{\n\t\t$listing = $this->modelListing->getListing($this->size, $this->offset);\n\t\treturn $listing;\n\t}", "function cl_woo_get_cat_filter_children( $parent_term_id = null ) {\n\n\t$output = array();\n\t$child_terms = null;\n\n\t//Get children of this term\n\t$child_terms = Prso_Woocom::get_product_terms(\n\t\tarray(\n\t\t\t'parent' => $parent_term_id,\n\t\t)\n\t);\n\n\tif ( isset( $child_terms->terms ) && ! empty( $child_terms->terms ) ) {\n\n\t\tforeach ( $child_terms->terms as $key => $grandchild_term ) {\n\n\t\t\t$child_terms->terms[ $key ]->children = cl_woo_get_cat_filter_children( $grandchild_term->term_id );\n\n\t\t}\n\n\t\t$output = $child_terms->terms;\n\n\t}\n\n\treturn $output;\n}", "public function getAllCategories()\n\t{\n\t\treturn $this->_db->loadAssoc(\"SELECT * FROM @_#_categories ORDER BY title\", 'parent_id', true);\n\t}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function categories()\n {\n /* $categories=Category::where('parent',0)->with('grandchildren')->get()\n ->toArray();*/\n\n //to get parent to child level heirarchy\n /*$categories=Category::with('grandchildren')->get()\n ->toArray();*/\n\n //to get children of specific category\n /*foreach($categories as $category){\n $parent=$category->children()->get();\n\n if(!is_null($parent)){\n print_r($parent);\n \n }\n }*/\n\n /*$categories=Category::orderBy('name', 'asc')\n ->orderBy('parent', 'asc')->get();*/\n\n $categories=Category::where('parent',0)->with('children','children.grandchildren')->orderBy('name', 'asc')->get()\n ->toArray();\n return response()->json(['categories'=>$categories]);\n }" ]
[ "0.8179889", "0.7935016", "0.7770446", "0.7430902", "0.74063325", "0.73630244", "0.72989", "0.71102756", "0.7095638", "0.70528847", "0.7021155", "0.6986702", "0.69866234", "0.69525886", "0.6886143", "0.6864314", "0.68403125", "0.678981", "0.6710297", "0.6689161", "0.6688728", "0.6667266", "0.66386193", "0.66376626", "0.6533573", "0.65275997", "0.6522319", "0.65195906", "0.6507193", "0.64793265", "0.647907", "0.64678174", "0.64678174", "0.64641225", "0.6449822", "0.6446972", "0.6446972", "0.6446972", "0.6446972", "0.6446972", "0.6446972", "0.6446972", "0.6446972", "0.64309686", "0.6421311", "0.6421311", "0.6418191", "0.6417728", "0.6406966", "0.6406966", "0.63925296", "0.63552237", "0.6338172", "0.63369584", "0.6331326", "0.6316318", "0.6296912", "0.62273115", "0.62272954", "0.62272954", "0.62269515", "0.62134147", "0.620834", "0.6192533", "0.6190774", "0.6183762", "0.6152969", "0.6152957", "0.6145856", "0.61419535", "0.61161566", "0.61158895", "0.611565", "0.60986817", "0.60917825", "0.60765105", "0.60703874", "0.6058848", "0.6058848", "0.6032909", "0.6031873", "0.60001594", "0.5961503", "0.5959678", "0.5956439", "0.5951984", "0.59490377", "0.59474844", "0.5943666", "0.59436244", "0.59427184", "0.5942523", "0.59417343", "0.59417045", "0.59386694", "0.5913143", "0.59039044", "0.5899617", "0.5899617", "0.5899617", "0.5894268" ]
0.0
-1
Get all children tree of a parent.
public function getAllChildren($parentID) { $children = $this->getChildren($parentID); foreach ($children as $key => $child){ $this->categoriesToBeDeleted[$child->categoryID] = $child; $this->getAllChildren($child->categoryID); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function childrenRecursive()\n {\n return $this->children()->with('childrenRecursive');\n }", "public function childrenRecursive()\n {\n return $this->children()->with('childrenRecursive');\n }", "public function childrenRecursive()\n\t\t{\n\t\t\treturn $this->children()->with('childrenRecursive');\n\t\t}", "public function getChildren($idParent) {\r\n\t\t$entities = $this->find('all', array(\r\n\t\t\t'conditions' => array(\r\n\t\t\t\t'Entity.parent_id' => $idParent,\r\n\t\t\t\t'Entity.active' => 1\r\n\t\t\t\t),\r\n\t\t\t'order' => array('Entity.order' => 'ASC') \r\n\t\t\t)\r\n\t\t);\r\n\t\treturn $entities ;\r\n\t}", "public function childrens()\n {\n return $this->hasMany(self::class, 'parent_id');\n }", "public function children()\n {\n return $this->hasMany(self::class, 'parent_id', 'id');\n }", "public function getChildrenForParent( $parent )\n {\n $children = array();\n\n foreach($this->table as $row)\n {\n if( $row['parent_id'] === $parent->getId() )\n {\n $children[] = new MeshTestObject($row['child_id']);\n }\n }\n\n return $children;\n }", "public function findAll()\n {\n $sql = \"SELECT * FROM parent\";\n $res = $this->getDb()->fetchAll($sql);\n\n $parents = array();\n foreach($res as $row)\n {\n $id_parent = $row['id_parent'];\n $parents[$id_parent] = $this->buildDomainObject($row);\n }\n\n return $parents;\n }", "public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }", "public function children()\n {\n return $this->hasMany(static::class, 'parent_id')->orderBy('name', 'asc');\n }", "function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }", "private function queryForChildrenOf($parentID)\n {\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(Utility::dataTable);\n $queryResults = $queryBuilder->select('*')\n ->from(Utility::dataTable)\n ->where($queryBuilder->expr()->eq('parent', $queryBuilder->quote($parentID)))\n ->orderBy('notation', 'ASC')\n ->execute();\n\n return $queryResults;\n }", "public function getChildren()\n {\n return $this\n ->hasMany(MenuItem::class, ['menuId' => 'id'])\n ->andWhere(['is', 'parentId', null])\n ->orderBy(['order' => SORT_ASC]);\n }", "public static function getChildrenByParent($parent_id)\n {\n $query = CategoriesLevelOne::find()->select('id')->where([\"parent_category\"=>$parent_id])->all();\n foreach($query as $value)\n {\n $array[]=$value->id;\n }\n\n return $array;\n }", "public function childrenElements() {\n\t\treturn $this->hasMany('\\App\\Hierarchy', 'parent_id', 'id');\n\t}", "public function getChildren() {\n\t\t$children = $this->categoryRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "public function getChildren(MenuItem $parent = null)\n {\n if ($parent === null) {\n return $this->getTopChildren();\n }\n /* @var $request Request */\n $request = $this->requestStack->getCurrentRequest();\n $result = [];\n foreach ($this->getAdaptors() as $menuAdaptor) {\n $menuAdaptor->adaptChildren($this, $result, $parent, $request);\n }\n\n return $result;\n }", "public function getChildren(): array\n {\n return $this->children->toArray();\n }", "public function findAllWithParent() { \n return $this->createQueryBuilder('a')\n ->leftJoin('a.parent', 'p')\n ->getQuery()\n ->getResult();\n }", "public function childs(?int $depth = null, bool $withParent = false, bool $eagerLoading = false): ActiveQuery\n {\n return $this->owner::find()\n ->childs($this->owner->id, $withParent, $depth, $eagerLoading)\n ->orderBy(['treePathsChild.child_level' => SORT_ASC]);\n }", "public function getChildren($id){\n return $this->getTable()->where($this->treeParentRow,$id);\n }", "public function grandChildren() {\n return $this->children()->children();\n }", "public function grandChildren()\n {\n return $this->children()->children();\n }", "public function findChildren($id_parent){\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.parent', $queryBuilder->createNamedParameter($id_parent))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.sys_language_uid', $queryBuilder->createNamedParameter($GLOBALS['TSFE']->sys_language_uid, \\PDO::PARAM_INT))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.deleted', $queryBuilder->createNamedParameter(0))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.hidden', $queryBuilder->createNamedParameter(0))\n )\n ->execute();\n $list_cat=[];\n while ($row = $statement->fetch()) {\n\n $list= array(\n 'uid' => $row['uid'],\n 'title' => $row['title'],\n 'parent' => $row['parent'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n );\n array_push($list_cat, $list);\n }\n\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.uid', $queryBuilder->createNamedParameter($id_parent))\n )\n \n ->execute();\n while ($row = $statement->fetch()) {\n $list=array(\n 'uid' =>$row['uid'],\n 'title' =>$row['title'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n 'children' => $list_cat);\n }\n return $list;\n }", "public function children() {\n return $this->descendants(1);\n }", "public function get_child_ids($parent = 0)\n\t{\n\t\t// First we get all the categories and store it.\n\t\tif (empty($this->_all_cats))\n\t\t{\n\t\t\t$this->_ci->db->select('cat_id,cat_parent')\n\t\t\t\t\t\t->from('categories')\n\t\t\t\t\t\t->where('cat_display', 'yes');\n\t\t\t$query = $this->_ci->db->get();\n\n\t\t\tif ($query->num_rows() == 0) \n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t} \n\n\t\t\t$this->_all_cats = $query->result_array();\n\t\t}\n\t\t\n\t\tforeach ($this->_all_cats as $row)\n\t\t{\n\t\t\t// This assigns all the fields to the array.\n\t\t\tforeach ($row AS $key => $val)\n\t\t\t{\n\t\t\t\t$arr[$key] = $val;\n\t\t\t}\n\t\t\t\n\t\t\t$menu_array[$row['cat_id']] = $arr;\n\t\t}\n\t\t\n\t\tunset($arr);\n\t\t\n\t\tforeach($menu_array as $key => $val)\n\t\t{\n\t\t\t// Now add any children.\n\t\t\tif ($parent == $val['cat_parent'] OR $parent == $val['cat_id'])\n\t\t\t{\n\t\t\t\t$depth = 0;\n\t\t\t\tif ( ! in_array($val['cat_id'], $this->_cat_ids, TRUE)) \n\t\t\t\t{\n\t\t\t\t\t$this->_cat_ids = array_merge(array($val['cat_id']),$this->_cat_ids);\n\t\t\t\t\t$this->_child_subtree($key, $menu_array, $depth);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "public function children()\n\t{\n\t\treturn $this->descendants(1);\n\t}", "public function children(){\n return $this->hasMany(self::class, 'parent_id');\n }", "public function getChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n $children = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $children[] = new self((int) $result->getValue('category_id'), $this->clang_id);\n $result->next();\n }\n return $children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function children()\n {\n return $this->hasMany(static::class, 'parent_id');\n }", "public function children()\n {\n return $this->hasMany(static::class, 'parent_id');\n }", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "private function get_children($parent, $level = 0) {\r\n \t\t$pages = ORM::factory('page')->where('parent_id', $parent)->orderby('display_order','asc')->find_all();\r\n\r\n \t\t// display each child\r\n \t\tforeach ($pages as $page) {\r\n \t\t// indent and display the title of this child\r\n \t\t$this->page_array[] = array($page,$level);\r\n \t\t$this->get_children($page->id, $level+1); \r\n \t\t}\r\n\t}", "public function getChildren($parentID)\n {\n $tmp = [];\n foreach($this->categoryList as $key => $item){\n if($item->parentID == $parentID) {\n $tmp[] = $item;\n }\n }\n\n return $tmp;\n }", "public function getChildren() \n {\n return $this->children;\n }", "public function findChildren()\n {\n return self::where('code_parrent',$this->id)->get();\n }", "public function getChildren(): array {\n return iterator_to_array(clone $this->children);\n }", "public function getChildren()\n {\n return $this->_children;\n }", "public function children()\r\n\t{\r\n\t\treturn $this->children;\r\n\t}", "public function getChildren() {\n\t\treturn $this->_children;\n\t}", "public function getChildrenIterative(): array\n {\n //not using $this->getTopLevelParents, it would be concerns violation\n $topLevelParents = $this->categoryRepository->getTopLevelParents();\n\n $results[0] = $topLevelParents;\n $parents = $topLevelParents;\n\n $results = $this->iterate($results);\n\n return $results;\n }", "#[ReturnTypeWillChange]\n public function getChildren()\n {\n return new self($this->iterator->getChildren(), $this->excluded);\n }", "public function get_children();", "public function getChildren() {\n\t\t$placeRepository = t3lib_div::makeInstance('Tx_Wpj_Domain_Repository_PlaceRepository');\n\t\t$children = $placeRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function children()\n {\n return $this->hasMany(Category::class, 'parent_id', 'id');\n }", "public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}", "function children($parent_id): ?array {\n $list = @$this->children[$parent_id];\n return $list ? array_keys($list) : [];\n }", "public function getChildren($level = 1)\n {\n $result = VDO::meta()->getTableList(\"select wid from webshop_relations where parent = ?\",'Webshop', array($this->wid));\n if(is_null($result))\n {\n return array();\n }\n return array_unique(array_values($result));\n }", "public function get_child_nodes_recursive() {\n\t\t$nodes = array();\n\n\t\tforeach ( $this->child_nodes as $node ) {\n\t\t\t$nodes[ $node->get_code() ] = $node;\n\n\t\t\t$nodes = array_merge( $nodes, $node->get_child_nodes_recursive() );\n\t\t}\n\n\t\treturn $nodes;\n\t}", "public function getChilds()\n {\n return $this->childs;\n }", "public function children()\n {\n return $this->hasMany('App\\Models\\Category', 'parent_id', 'id');\n }", "public function get_children() {\n\t\treturn $this->children;\n\t}", "private static function getParentChildren():array\n {\n $parentChildren = [];\n $categories = self::select('*')->get()->toArray();\n\n foreach ($categories as $id){\n $children = [];\n foreach ($categories as $row){\n if ($id['id'] == $row['parent_id']){\n $children[] = $row['id'];\n }\n }\n $parentChildren[$id['id']] = $children;\n }\n\n return $parentChildren;\n\n }", "public function findChildNodes($parentId)\n {\n return $this->findNodes($parentId);\n }", "public function children()\n {\n return $this->hasMany(Post::class, 'parent_id');\n }", "public function getAllChilds($Parent_ID, $level_identifier=\"\", $start=true) { // get all the childs of all the levels under a parent as a tree\t\t\n $immediate_childs=$this->getImmediateChilds($Parent_ID, $this->extra_condition, $this->order_by_phrase);\n if(count($immediate_childs)) {\n foreach($immediate_childs as $chld) {\n $chld[$this->item_list_field_name]=$level_identifier.$this->item_pointer.$chld[$this->item_list_field_name];\n array_push($this->all_childs,$chld);\n $this->getAllChilds($chld[$this->item_identifier_field_name], ($level_identifier.$this->level_identifier), false);\n }\n }\n if($start) {\n return $this->all_childs; \n }\n }", "function requirement_get_children($parent) {\n\n\tglobal $db;\n\t$tbl_req \t\t\t\t\t= REQ_TBL;\n\t$f_req_id \t\t\t\t\t= REQ_ID;\n\t$f_req_filename \t\t\t= REQ_FILENAME;\n\t$f_req_parent\t \t\t\t= REQ_PARENT;\n\n\t$children = array();\n\n\t# retrieve all children of $parent\n\t$q = \"\tSELECT $f_req_id, $f_req_filename\n\t\t\tFROM $tbl_req\n\t\t\tWHERE $f_req_parent = $parent\";\n\n\t$result = db_query($db, $q);\n\n\t# display each child\n\twhile( $row = db_fetch_row($db, $result) ) {\n\n\t\t# call this function again to display this\n\t\t# child's children\n\t\t# we don't need the child's children in this function\n\n\t\t# for display on the req detail page, we only need immediate children\n\t\t# not sub-children. We'll need sub-children for the tree view\n\t\t$children[] = array(\t\"uid\"\t=> $row[REQ_ID],\n\t\t\t\t\t\t\t\t\"name\"\t=> $row[REQ_FILENAME],\n\t\t\t\t\t\t\t\t\"children\"\t=> requirement_get_children($row[REQ_ID]) );\n\t}\n\n\treturn $children;\n}", "public function getChildrenQuery();", "public function getParents()\n {\n \t$currentPos = trim($this->getPosition());\n \tif($currentPos === '' || $currentPos === '1')\n \t\treturn array($this);\n \t\n \t$posArray = array();\n \t$length = strlen($currentPos);\n \tfor($i = 0; $i < ($length - 1) / self::POS_LENGTH_PER_LEVEL ; $i++)\n \t{\n \t\t$posArray[] = trim(substr($currentPos, 0, ($i * self::POS_LENGTH_PER_LEVEL) + 1));\n \t}\n \treturn self::getAllByCriteria('rootId = ? and position in (' . implode(',', array_fill(0, count($posArray), '?')) . ')', array_merge(array($this->getRoot()->getId()), $posArray), false, null, DaoQuery::DEFAUTL_PAGE_SIZE, array('position' => 'asc'));\n }", "public function getParents($idParent = null){\r\n\t\tif ($idParent){\r\n\t\t\t$entities = $this->find('all', array(\r\n\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t'Entity.id' => $idParent,\r\n\t\t\t\t\t'Entity.parent_id' => 1,\r\n\t\t\t\t\t'Entity.active' => 1\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$entities = $this->find('all', array(\r\n\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t'Entity.parent_id' => 1,\r\n\t\t\t\t\t'Entity.active' => 1\r\n\t\t\t\t\t),\r\n\t\t\t\t'order' => array('Entity.order' => 'ASC') \r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $entities;\r\n\t}", "public function getParents() {}", "public function get_children() : array\n {\n return $this->children;\n }", "public function GetChildren() {\n\t\treturn $this->Children;\n\t}", "public function myChildren()\n {\n return File::get()->filter(\"ParentID\", $this->ID);\n }", "public function children()\n {\n return $this->hasMany('App\\Model\\Products\\Category', 'parent_id');\n }", "public function getAllParents()\n {\n $parents = array();\n\n $parent = $this;\n\n while ($parent = $parent->getParent()) {\n $parents[] = $parent;\n }\n\n return $parents;\n }", "public function all_parent()\r\n\t{\r\n\t\t$query = $this->db->select('*')->get('menu')->result_array(); \r\n\t \treturn $query;\r\n\t}", "public function getListByParentId($parent_id = 0) {\n return $this->where(['parent_id' => $parent_id])->select();\n }", "public function getChildren(BaseObject $node, $peer_method = 'doSelect', Criteria $c = null)\n {\n if(!$c)\n {\n $c = new Criteria();\n }\n $c->addAnd(self::getColumnConstant(get_class($node), 'parent'), $node->getPrimaryKey(), Criteria::EQUAL);\n $c->addAnd(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n $c->addAscendingOrderByColumn(self::getColumnConstant(get_class($node), 'left'));\n\n $children = call_user_func(array(get_class($node->getPeer()), $peer_method), $c);\n\n /*\n * Set children level depending on node's.\n * This prevents many further queries for getting children levels.\n */\n if (is_array($children))\n {\n $child_level = $node->getLevel() + 1;\n for ($i = 0; $i < count($children); $i++)\n {\n $children[$i]->setLevel($child_level);\n }\n }\n\n return $children;\n }", "public function getChildren() {\n $childNodes = $this->getNode()->getChildren();\n $children = array();\n foreach ($childNodes as $childNode) {\n $child = $childNode->getPage($this->getLang());\n if ($child) {\n $children[] = $child;\n }\n }\n return $children;\n }", "final public function getChildren() {\n\t\treturn array();\n\t}", "public function getParents();", "protected function getTreePathParents(): array\n {\n $primaryKey = $this->owner->getAttribute($this->ownerParentIdAttribute);\n if ($primaryKey === null) {\n return [];\n }\n\n return $this->treePathModelClass::find()\n ->byChildId($primaryKey)\n ->orderBy('child_level')\n ->all();\n }", "public function findChildHierarchy($parentId)\n {\n return $this->getChildHierarchyQueryBuilder($parentId)->getQuery()->getResult();\n }", "public function children()\n {\n return $this->hasMany('App\\Models\\Child');\n }", "private function templateDivChildren($parent_id)\n\t{\n\t\t$stmt = $this->stmtTemplate();\n\t\t$stmt->bindValue(':site_id', $this->site_id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':template_id', $this->template_id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':parent_id', $parent_id, PDO::PARAM_INT);\n\t\t$stmt->execute();\n\n\t\t$result = $stmt->fetchAll();\n\n\t\t$children = array();\n\n\t\tif(count($result) > 0) {\n\t\t\tforeach($result as $row) {\n\t\t\t\t$div = array('id'=>$row['id'],\n\t\t\t\t\t'sizes'=>array('width'=>$row['width'],\n\t\t\t\t\t\t'height'=>$row['height'],\n\t\t\t\t\t\t'design_height'=>$row['design_height'],\n\t\t\t\t\t\t'fixed'=>$row['fixed']));\n\n\t\t\t\t$div['children'] = $this->templateDivChildren($row['id']);\n\n\t\t\t\t$children[] = $div;\n\t\t\t}\n\t\t}\n\n\t\treturn $children;\n\t}", "public static function getChildrenString($parent) {\n $model = Pages::find()->where(['parent_id' => $parent])->all();\n $storage = [];\n foreach ($model as $key) {\n $storage[] = $key->id;\n $storage[] = self::getChildrenString($key->id);\n }\n return $storage;\n }", "public function children (){\n\t\treturn array();\n\t}", "public function allChildrenElements() {\n\t\treturn $this->childrenElements()->with('allChildrenElements');\n\t}", "public function children()\n {\n return $this->hasMany(Chart::class, 'parent_id', 'id');\n }", "public function children()\n\t{\t\treturn $this->hasMany(GroupInheritance::class, \"parent\");\n\t}", "public function buildParentsChildrenCategoriesHierarchy(): array\n {\n $categoriesDepths = $this->buildCategoriesDepths();\n $parentsChildrenDtos = [];\n $skippedCategoriesIds = [];\n\n foreach( $categoriesDepths as $categoryId => $depth ){\n\n $category = $this->app->repositories->myNotesCategoriesRepository->find($categoryId);\n $categoryId = $category->getId();\n\n $childCategoriesIds = $this->app->repositories->myNotesCategoriesRepository->getChildrenCategoriesIdsForCategoriesIds([$categoryId]);\n $parentChildDto = $this->buildParentChildDtoForHierarchy($category, $depth);\n\n //if we have a children then we already added it to parent so we don't want it as separated being\n $skippedCategoriesIds = array_merge($skippedCategoriesIds, $childCategoriesIds);\n\n if( in_array($categoryId, $skippedCategoriesIds) ){\n continue;\n }\n\n $parentsChildrenDtos[] = $parentChildDto;\n }\n\n // sort alphabetically by name\n uasort($parentsChildrenDtos, fn(ParentChildDTO $currentElement, ParentChildDTO $nextElement) =>\n $currentElement->getName() > $nextElement->getName()\n );\n\n return $parentsChildrenDtos;\n }", "public function tree() {\n return $this->children()->with(['user', 'children.user', 'children.children.user', 'children.children.children.user', 'children.children.children.children.user'])->get();\n }", "public static function parentCategories()\n {\n return Category::with('children')\n ->orderBy('priority')\n ->where([\n 'category_type' => static::class,\n 'parent_id' => null,\n ])->get();\n }", "public function children()\n {\n return $this->hasMany(config('rbac.models.role'),'parent_id');\n }" ]
[ "0.7453203", "0.7453203", "0.73830986", "0.72617626", "0.712919", "0.699496", "0.6988644", "0.69607943", "0.69370115", "0.6924143", "0.69212365", "0.6914096", "0.69106394", "0.6815943", "0.68080294", "0.67347986", "0.67284364", "0.67167115", "0.66863865", "0.66629815", "0.663425", "0.66231513", "0.659596", "0.6590238", "0.65773827", "0.6576298", "0.6558339", "0.6551491", "0.6550807", "0.6545268", "0.65401316", "0.65401316", "0.65401316", "0.65401316", "0.65401316", "0.65401316", "0.65401316", "0.65401316", "0.6537922", "0.6537922", "0.6529601", "0.6529601", "0.65210456", "0.651473", "0.651473", "0.65005904", "0.6470104", "0.6452266", "0.6451581", "0.64418614", "0.6422154", "0.6421056", "0.64145154", "0.64118034", "0.6397801", "0.639523", "0.6384341", "0.63830036", "0.63830036", "0.6380543", "0.63785046", "0.63694996", "0.6366439", "0.6344956", "0.63230324", "0.63060874", "0.63034755", "0.6301886", "0.6296174", "0.62901837", "0.62633026", "0.62597543", "0.6249375", "0.6245635", "0.6242965", "0.6232458", "0.62322", "0.6228024", "0.6214393", "0.6197769", "0.61936176", "0.6190646", "0.6185415", "0.6184316", "0.6171601", "0.6168628", "0.61392486", "0.61326146", "0.61271", "0.6123342", "0.6117918", "0.61177385", "0.6103315", "0.61021745", "0.6090281", "0.6084", "0.60822344", "0.60642165", "0.60621524", "0.6061263" ]
0.62622577
71
Delete List of children.
public function deleteChildren(int $parentID, int $postTypeID) { $this->categoryList = self::where("postTypeID", $postTypeID)->get(); $this->getAllChildren($parentID); foreach($this->categoriesToBeDeleted as $cat){ // Post type should not be able to be deleted if it has posts if(self::isInMenuLinks($cat->categoryID)) { return $this->response("You can't delete this Category because it is part of a menu.", 403); } $postType = PostType::findByID($postTypeID); // delete relations DB::table($postType->slug.'_categories')->where("categoryID", $cat->categoryID)->delete(); // delete children $cat->delete(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function deleteChildren() {}", "public function deleteChildren(){\n $this->publicEnvironments()->delete();\n $this->privateEnvironments()->delete();\n $collections = Collection::where('project_id', $this->id)->get();\n\n foreach($collections as $collection){\n $collection->items()->delete();\n $collection->delete();\n }\n }", "function deleteChilds(){\n\t\t$this->db->query(\"SELECT ID FROM \" . EXPORT_TABLE . ' WHERE ParentID=' . intval($this->ID));\n\t\twhile($this->db->next_record()){\n\t\t\t$child = new we_export_export($this->db->f(\"ID\"));\n\t\t\t$child->delete();\n\t\t}\n\t}", "function delete($deleteChildren = true)\n\t{\n\t\t$sections = $this->getSections();\n\t\t\n\t\tforeach($sections as $section)\n\t\t{\n\t\t\t$this->detach($section);\n\t\t}\n\t\t\n\t\t$this->destroy();\n\t}", "public function afterDelete()\n {\n foreach (static::find()->where(['parent_id' => $this->id])->all() as $item) {\n $item->delete();\n }\n }", "public function testDeleteAllChildrenInFacility(){\n $childDAO = new childDAO();\n $children = $childDAO->findChildrenInFacility(5);\n $this->assertEquals(10,count($children));\n\n $childDAO->deleteAllChildrenInFacility(5);\n $children = $childDAO->findChildrenInFacility(5);\n $this->assertEquals(0,count($children));\n }", "public function removeChildNodes() {}", "public function deleteChildren(BaseObject $node)\n {\n // array_reverse() call is necessary for root node properties to be correctly updated\n foreach (array_reverse($node->getChildren()) as $child)\n {\n $child->delete();\n }\n }", "public function removeChildren($from, $to = null, $forceDelete = false);", "public function del() {\n\t\t\tif (!empty($this->params['form']['items'])) {\n\t\t\t\t/* Convert string with ids to array */\n\t\t\t\t$allIds = explode(',', $this->params['form']['items']);\n\t\t\t\t$allIds = Sanitize::clean($allIds);\n\t\t\t\t\n\t\t\t\t/* Remove menu item(s) from tree */\n\t\t\t\t/* @todo Check if this could be done with a single method call/db request instead */\n\t\t\t\tforeach ($allIds AS $id) {\n\t\t\t\t\t$this->MyMenu->removefromtree($id, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Get list of menu items */\n\t\t\t$this->menuList = $this->getThreadedList();\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 deleting(Content $content)\n\t{\n\t\tif ( $content::$FIRE_EVENTS ) {\n\t\t\tif ( $content->childrenRecursive ) {\n\t\t\t\t$firstLevelChilds = Content::where( 'parent_id' , '=', $content->id )->get();\n\t\t\t\tif ( $content->parent_id ) {\n\t\t\t\t\t$parentID = $content->parent_id;\n\t\t\t\t} else {\n\t\t\t\t\t$parentID = null;\n\t\t\t\t}\n\t\t\t\tforeach ( $firstLevelChilds as $item ) {\n\t\t\t\t\t$item->parent_id = $parentID;\n\t\t\t\t\t$item->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function deleteList()\n {\n if (!request()->ajax()) {\n return response()->json(['error' => 1, 'msg' => 'Method not allow!']);\n } else {\n $ids = request('ids');\n $arrID = explode(',', $ids);\n $arrDontPermission = [];\n foreach ($arrID as $key => $id) {\n if(!$this->checkPermisisonItem($id)) {\n $arrDontPermission[] = $id;\n }\n }\n if (count($arrDontPermission)) {\n return response()->json(['error' => 1, 'msg' => sc_language_render('admin.remove_dont_permisison') . ': ' . json_encode($arrDontPermission)]);\n }\n AdminCmsContent::destroy($arrID);\n sc_clear_cache('cache_cms_content');\n return response()->json(['error' => 0, 'msg' => '']);\n }\n }", "public function clearChildren(): void\n {\n if ($this->children instanceof Collection) {\n $this->children = new Collection;\n return;\n }\n\n $this->children = [];\n }", "public function testdeleteAllChildren()\n\t{\n\t\t$this->assertEquals(1,1);\n\t}", "public function delete()\n {\n $this->changeChildrenParent();\n $this->removeFromCache();\n return parent::delete();\n }", "abstract public function deleteAll();", "private function actionListDelete() {\n $put_vars = $this->actionListPutConvert();\n $this->loadModel($put_vars['id'])->delete();\n }", "public function delete_child_posts( $post_id ) {\n\t\t$post = get_post( $post_id );\n\t\t$children = get_posts( array(\n\t\t\t'post_type' => $post->post_type,\n\t\t\t'post_parent' => $post->ID,\n\t\t) );\n\t\tforeach ( $children as $child ) {\n\t\t\twp_trash_post( $child->ID );\n\t\t\tclean_post_cache( $child );\n\t\t\t$this->clear_linked_cache( $child->ID );\n\t\t}\n\t}", "public function deleteList(){\n\n $posts=$this->articleDAO->getPosts();\n $this->view->adminRender ('delete_view', ['posts' =>$posts]);\n\n }", "private function deleteNodes( ezcTreeNodeList $list )\n {\n $db = $this->dbh;\n $q = $db->createDeleteQuery();\n\n $nodeIdList = array();\n foreach ( array_keys( $list->nodes ) as $nodeId )\n {\n $nodeIdList[] = (string) $nodeId;\n }\n\n // DELETE FROM indexTable\n // WHERE id in ( $list );\n $q->deleteFrom( $db->quoteIdentifier( $this->indexTableName ) );\n $q->where( $q->expr->in( 'id', $nodeIdList ) );\n $s = $q->prepare();\n $s->execute();\n }", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public function delete() {\n $this->remove_content();\n\n parent::delete();\n }", "public function unlinkAll()\n {\n return $this->pivotTable()->delete($this->wherePivot($this->parentKey(), null))->run();\n }", "public function deleteAll(): void;", "public function destroy(children $children,$id)\n {\n $children = children::findOrFail($id);\n $children->delete();\n return response()->json(['message'=>'Persona quitada', 'Persona'=>$children],200);\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function deleteWithReplies()\n\t{\n\t\tif(count($this->replies) > 0) {\n\t\t\t// Delete children recursive\n\t\t\tforeach ($this->replies as $reply) {\n\t\t\t\t$reply->deleteWithReplies();\n\t\t\t}\n\t\t}\n\t\t$this->delete();\n\t}", "public function testDelete_Deep()\n\t{\n\t\t$this->parent_->AddObject($this->object);\n\t\t$this->object->AddChild($this->child);\n\t\t$this->object->AddSibling($this->sibling);\n\t\t$this->parent_->Save();\n\n\t\t$this->parent_->Delete(true, true);\n\n\t\t$someParent = new parent_();\n\t\t$parentList = $someParent->GetList(array(array(\"parent_Id\", \">\", 0)));\n\t\t$this->assertEquals(0, sizeof($parentList));\n\n\t\t$someObject = new object();\n\t\t$objectList = $someObject->GetList(array(array(\"objectId\", \">\", 0)));\n\t\t$this->assertEquals(0, sizeof($objectList));\n\n\t\t$someChild = new child();\n\t\t$childList = $someChild->GetList(array(array(\"childId\", \">\", 0)));\n\t\t$this->assertEquals(0, sizeof($childList));\n\n\t\t$someSibling = new sibling();\n\t\t$siblingList = $someSibling->GetList(array(array(\"siblingId\", \">\", 0)));\n\t\t$this->assertEquals(0, sizeof($siblingList));\n\t}", "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "public function deleteChild($idPadre,$idHijo) {\n\t\t$data['idHijo'] = $idHijo;\n\t\t$this->object_model->deleteItem('hijos',$data);\n\t\tredirect($this->controller.\"/updateItem/\".$idPadre);\n\t}", "public function deleteById($parentId);", "function _riat_parent_cascading_delete_batch($descendant) {\n node_delete($descendant->did);\n}", "public function fulldelete() {\n if ($this->id && !$this->elements) {\n $this->elements = self::get_instances(array('setid' => $this->id));\n }\n\n foreach ($this->elements as $elm) {\n $elm->delete();\n }\n\n parent::delete();\n }", "public function delete($key = NULL){\n if (!is_null($key)) return parent::delete($key);\n \n\t\t//delete children\n\t\t$children_groups = Jelly::select('Client_ShareholderGroup')->where('parent', '=', $this->id())->execute();\n\t\tforeach($children_groups as $cg){\n\t\t\t$cg->delete();\n\t\t}\n\t\t$children_persons = Jelly::select('Client_Shareholder')->where('parent', '=', $this->id())->execute();\n\t\tforeach($children_persons as $cp){\n\t\t\t$cp->delete();\n\t\t}\n\t\t\n\t\tJelly::delete('Client_ShareholderGroup')->where('_id', '=', $this->id())->execute();\n }", "public function deleteChildren($ids) {\n\t\tif(!$this->hasPermission(\\OCP\\PERMISSION_DELETE)) {\n\t\t\tthrow new \\Exception(self::$l10n->t('You do not have permissions to delete this contact'), 403);\n\t\t}\n\t\tif(!$this->getBackend()->hasContactMethodFor(\\OCP\\PERMISSION_DELETE)) {\n\t\t\tthrow new \\Exception(self::$l10n->t('The backend for this address book does not support deleting contacts'), 501);\n\t\t}\n\n\t\t$response = array();\n\n\t\t\\OCP\\Util::emitHook('OCA\\Contacts', 'pre_deleteContact',\n\t\t\tarray('id' => $ids)\n\t\t);\n\n\t\tforeach($ids as $id) {\n\t\t\ttry {\n\t\t\t\tif(!$this->deleteChild($id, array('isBatch' => true))) {\n\t\t\t\t\t\\OCP\\Util::writeLog(\n\t\t\t\t\t\t'contacts', __METHOD__.' Error deleting contact: '\n\t\t\t\t\t\t. $this->getBackend()->name . '::'\n\t\t\t\t\t\t. $this->getId() . '::' . $id,\n\t\t\t\t\t\t\\OCP\\Util::ERROR\n\t\t\t\t\t);\n\t\t\t\t\t$response[] = array(\n\t\t\t\t\t\t'id' => (string)$id,\n\t\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t\t'message' => self::$l10n->t('Unknown error')\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$response[] = array(\n\t\t\t\t\t\t'id' => (string)$id,\n\t\t\t\t\t\t'status' => 'success'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch(\\Exception $e) {\n\t\t\t\t$response[] = array(\n\t\t\t\t\t'id' => (string)$id,\n\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t'message' => $e->getMessage()\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $response;\n\t}", "public function remove_child(int $position){\n $this -> children -> delete($position);\n }", "public function onAfterDelete() {\n parent::onAfterDelete();\n\n foreach ($this->Items() as $item) {\n $item->delete();\n }\n }", "public function delete() {\n // Deleting microarticles.\n $microarticles = $this->getMicroarticles();\n if (!empty($microarticles)) {\n foreach ($microarticles as $microarticle) {\n $microarticle->delete();\n }\n }\n\n // Deleting selfservices.\n $selfServices = $this->getSelfservices();\n if (!empty($selfServices)) {\n foreach ($selfServices as $selfService) {\n $selfService->delete();\n }\n }\n\n parent::delete();\n }", "public function deleteMany(Request $request)\n {\n $model = new $this->model;\n $ids = $request->get('model');\n\n $count = 0;\n foreach ($ids as $id) {\n $entity = $model->findOrFail($id);\n if ($this->authorize('delete', $entity)) {\n $entity->delete();\n $count++;\n }\n }\n\n $subroute = 'index';\n if (auth()->user()->defaultNested and \\Illuminate\\Support\\Facades\\Route::has($this->route . '.tree')) {\n $subroute = 'tree';\n }\n\n return redirect()->route($this->route . '.' . $subroute)\n ->with('success', trans_choice('crud.destroy_many.success', $count, ['count' => $count]));\n }", "function CleanUp () {\n global $zOLDAPPLE;\n\n $criteria = array (\"groupInformation_tID\" => $this->tID,\n \"Body\" => DELETED_GROUP_ENTRY);\n $this->groupContent->SelectByMultiple ($criteria);\n\n // Break out if no deleted posts left. \n if ($this->groupContent->CountResult() == 0) return (TRUE);\n\n while ($this->groupContent->FetchArray ()) {\n $CHILDREN = new cGROUPCONTENT ();\n $childcriteria = array (\"parent_tID\" => $this->groupContent->tID,\n \"groupInformation_tID\" => $this->tID,\n \"Context\" => $zOLDAPPLE->Context);\n $CHILDREN->SelectByMultiple ($childcriteria);\n\n // If no children, delete.\n if ($CHILDREN->CountResult () == 0) {\n $this->groupContent->Delete ();\n $this->CleanUp ();\n } // if\n unset ($CHILDREN);\n } // while\n }", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "function inscription_jesa_link_remove_child($form, &$form_state) {\n if ($form_state['num_stagiaires'] > 1) {\n $form_state['num_stagiaires']--;\n }\n\n // Setting $form_state['rebuild'] = TRUE causes the form to be rebuilt again.\n $form_state['rebuild'] = TRUE;\n}", "public function supprimer()\n {\n if(\\Request::ajax())\n {\n $numbers = substr( \\Input::get('boxes'),0,-1);\n $ids = explode(',',$numbers);\n $ids = array_unique($ids);\n foreach($ids as $id)\n {\n $child = Child::findOrFail($id);\n $child->bills()->delete();\n $child->attendances()->delete();\n $child->delete();\n if($child->trashed())\n {\n $c= Child::onlyTrashed()->findOrFail($id);\n $c->bills()->forceDelete();\n $c->attendances()->forceDelete();\n $c->forceDelete();\n\n }\n }\n }\n }", "public function destroy_child(Request $request)\n {\n $childs = Children::find($request->child_id);\n $childs_name = $childs->childre_name;\n $x=0;\n $childs->quran_statu = $x;\n\n Quran::find($request->id)->delete();\n /*after delete the student by id we will redirect the to show and we will path deleting msg ->with('DeleteMsg', 'You Have Deleted the Student Successfully')*/\n session()->flash('Delete','تم حذف معلومات القرآن الخاصة بالطفل '. $childs_name .' بنجاح ');\n $childs->save();\n return redirect(route('quran.show.family'));\n }", "public function remove () {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t $node->parentNode->removeChild($node);\r\n\t}", "public function removeChild(Request $request)\n {\n if (config('simpleMenu.clearNestDescendants')) {\n $this->clearSelfAndNests($request->child_id);\n } else {\n $page = $this->findPage($request->child_id);\n $page->makeRoot();\n $page->touch();\n }\n\n return response()->json(['done'=>true]);\n }", "function delete_entries_loop($child_id, $weblog_id)\n\t{\n\t\tglobal $DB;\n\n\t\tif (isset($this->cache['mourning_parents'][$child_id]))\n\t\t{\n\t\t\t$playa_fields = $this->_get_fields();\n\n\t\t\tforeach($this->cache['mourning_parents'][$child_id] as $parent)\n\t\t\t{\n\t\t\t\t$lines = array_filter(preg_split(\"/[\\r\\n]+/\", $parent['field_data']));\n\t\t\t\t$new_lines = array();\n\t\t\t\tforeach($lines as $line)\n\t\t\t\t{\n\t\t\t\t\tif ( ! $this->_check_for_playa_rel($line, $parent['rel_id']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_lines[] = $line;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$DB->query('UPDATE exp_weblog_data\n\t\t\t\t SET '.$parent['field_name'].' = \"'.implode('\\r', $new_lines).'\"\n\t\t\t\t WHERE entry_id = '.$parent['parent_id']);\n\t\t\t}\n\t\t}\n\t}", "function deleteChildren($node)\n{\n while (isset($node->firstChild)) {\n deleteChildren($node->firstChild);\n $node->removeChild($node->firstChild);\n }\n}", "public function delete_all()\n {\n }", "public function actionRemoveChild()\n\t{\n\t\t// We only allow deletion via POST request\n\t\tif( Yii::app()->request->isPostRequest===true )\n\t\t{\n\t\t\t$itemName = $this->getItemName();\n\t\t\t$childName = $this->getChildName();\n\t\t\t\n\t\t\t// Remove the child and load it\n\t\t\t$this->_authorizer->authManager->removeItemChild($itemName, $childName);\n\t\t\t$child = $this->_authorizer->authManager->getAuthItem($childName);\n\t\t\t$child = $this->_authorizer->attachAuthItemBehavior($child);\n\n\t\t\t// Set a flash message for removing the child\n\t\t\tYii::app()->user->setFlash($this->module->flashSuccessKey,\n\t\t\t\tRights::t('core', 'Child :name removed.', array(':name'=>$child->getNameText()))\n\t\t\t);\n\n\t\t\t// If AJAX request, we should not redirect the browser\n\t\t\tif( isset($_POST['ajax'])===false )\n\t\t\t\t$this->redirect(array('authItem/update', 'name'=>urlencode($itemName)));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new CHttpException(400, Rights::t('core', 'Invalid request. Please do not repeat this request again.'));\n\t\t}\n\t}", "public function delete() {\n\t\t$sql = 'delete from cart_categories where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$sql = 'delete from cart_categories_description where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$cats = $this->getSubCategories();\n\t\tforeach ($cats as $cat) {\n\t\t\t$cat->delete();\n\t\t}\n\t}", "public function deleteAll()\n {\n return Laranote::where('model', get_class($this))\n ->where('model_id', $this->id)\n ->delete();\n }", "public function deleteChildren(Varien_Object $object){\n\t\t$adapter = $this->_getWriteAdapter();\n\t\t$pathField = $adapter->quoteIdentifier('path');\n\t\t$select = $adapter->select()\n\t\t\t->from($this->getMainTable(), array('entity_id'))\n\t\t\t->where($pathField . ' LIKE :c_path');\n\t\t$childrenIds = $adapter->fetchCol($select, array('c_path' => $object->getPath() . '/%'));\n\t\tif (!empty($childrenIds)) {\n\t\t\t$adapter->delete(\n\t\t\t\t$this->getMainTable(),\n\t\t\t\tarray('entity_id IN (?)' => $childrenIds)\n\t\t\t);\n\t\t}\n\t\t/**\n\t\t * Add deleted children ids to object\n\t\t * This data can be used in after delete event\n\t\t */\n\t\t$object->setDeletedChildrenIds($childrenIds);\n\t\treturn $this;\n\t}", "public function delall()\n {\n }", "public function actionDeleteList()\n {\n $ids = Yii::$app->request->post('ids');\n $success = false;\n\n if (!empty($ids)) {\n foreach ($ids as $id) {\n $model = $this->findModel($id);\n $success = $model->delete();\n }\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n return [\n 'success' => $success,\n ];\n }", "public function delete()\n {\n $data = Comment::where(\"reply\", $this->id)->get();\n foreach ($data as $comment) {\n $comment->delete();\n }\n\n /**\n * Delete self\n */\n parent::delete();\n }", "public function destroy()\n\t{\n\t\t$ids = \\Input::get('id');\n\t\tforeach ($ids as $id) {\n\t\t\t$category = Category::find($id);\n\t\t\tif (!$category)\n\t\t\t\tcontinue;\n// foreach ($category->pages as $page) {\n// if ($page->is_home) {\n// \\Session::flash('manager_error_message', \\Lang::get('manager.messages.menu_containing_home_page_cant_be_removed'));\n// return \\Redirect::back();\n// }\n// }\n\t\t\t$category->removeImage('image');\n\t\t\t$category->removeImage('image_desc');\n\t\t\tCategory::destroy($id);\n\t\t}\n\t\t\\Session::flash('manager_success_message', \\Lang::get('manager.messages.entities_deleted'));\n\t\treturn \\Redirect::back();\n\t}", "public function delete()\n {\n $ids = Request::get(\"id\");\n\n $ids = is_array($ids) ? $ids : [$ids];\n\n foreach ($ids as $ID) {\n\n $page = Page::findOrFail($ID);\n\n // Fire deleting action\n\n Action::fire(\"page.deleting\", $page);\n\n $page->tags()->detach();\n $page->delete();\n\n // Fire deleted action\n\n Action::fire(\"page.deleted\", $page);\n }\n\n return Redirect::back()->with(\"message\", trans(\"pages::pages.events.deleted\"));\n }", "public function actionDeleteList()\n {\n $ids = Yii::$app->request->post('ids');\n $success = false;\n if (!empty($ids)) {\n foreach ($ids as $id) {\n $model = $this->findModel($id);\n $success = $model->delete();\n }\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n\n return [\n 'success' => $success,\n ];\n }", "public function remove() {\n if ( is_null( $this->id ) )\n return;\n\n $this->prepare(\n 'DELETE FROM `categories` WHERE `category_id` = :category_id OR `parent_category_id` = :parent_category_id'\n , 'ii'\n , array( ':category_id' => $this->id, ':parent_category_id' => $this->id )\n )->query();\n }", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "private function delSubs($id){\n\t\t$db = Zend_Registry::get('db');\n\t\t$select = $db->select()\n\t\t\t\t\t->from('pages')\n\t\t\t\t\t->where('parent_id = ?',$id);\n\t\t$results = $db->fetchAll($select);\n\t\tif($results){\n\t\t\t$db->delete('pages',array(\n\t\t\t\t'id = ?' => $results[id],\n\t\t\t));\n\t\t\t$db->delete('routes',array(\n\t\t\t\t'type = ?' => 'content',\n\t\t\t\t'seg_id = ?' => $results[id],\n\t\t\t));\n\t\t\t// recurse through possible child items\n\t\t\t$this->delSubs($results[id]);\n\t\t}\n\t}", "public function deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }", "public function removeContentFromParent(){\n\t\ttry {\n\n\t\t\t$field_id = Request::input('pk');\n\n\t\t\t$contentObj = ConnectContent::find($field_id);\n\n\t\t\tif ($contentObj->is_temp) {\n\t\t\t\t$contentObj->removeConnectContent();\n\t\t\t} else {\n\n\t\t\t\t$parent_id = Request::input('parent_id');\n\t\t\t\t$child_content_date_id = Request::input('child_content_date_id');\n\n\t\t\t\tif (!ConnectContentBelongs::removeBelongsInfo($parent_id, $field_id, $child_content_date_id)) {\n\t\t\t\t\tthrow new \\Exception('Unable to remove.');\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success'));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "public function destroyMany(Request $request) {\n //Check Delete Access Permission\n $this->DeleteAccess = Permit::AccessPermission('permissions-delete');\n if (!$this->DeleteAccess)\n return redirect('errors/401');\n\n $all_data = $request->except('_token', 'table-4_length'); \n \n //logActivity\n //fetch title\n $Permission = Permission::\n select('groupname')\n ->whereIn('id', $all_data['ids'])\n ->get();\n\n $name = $Permission->pluck('groupname');\n $groupname = $name->toJson();\n\n LogActivity::addToLog('Permission - ' . $groupname, 'deleted');\n\n $all_data = array_get($all_data, 'ids');\n foreach ($all_data as $id) {\n Permission::destroy($id);\n }\n\n // redirect\n Session::flash('message', config('global.deletedRecords'));\n\n return redirect('admin/permissions');\n }", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function deleteAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->deleteAll();\n }\n }\n }\n }\n $this->delete();\n }", "function deleteChild($type=null,$dq=null){\n\t\treturn $this->api->deleteObj($api->childDQ($dq,$this->id,$types));\n\t}", "public function DeleteListaCurso() {\n\t\t\t$this->objListaCurso->Delete();\n\t\t}", "function deleteArticleTree() {\n\t\tparent::rmtree($this->filesDir);\n\t}", "public function deleteAll()\n {\n \\Core\\File\\System::rrmdir($this->_getPath(), false, true);\n }", "public function multiDeleteAction() {\n\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n Engine_Api::_()->getItem('list_listing', (int) $value)->delete();\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }", "public function children($id);", "public function unset_children($element, &$children_elements)\n {\n }", "public function deleteImages($class = null, $deleteChildren = true)\n {\n $images = $this->images;\n \n if (! empty($class)) {\n $images = $images->where('class', $class);\n }\n \n if (! $images) {\n return false;\n }\n \n $images->map(function ($item, $key) use ($deleteChildren) {\n if ($deleteChildren) {\n $this->images->where('parent_id', $item->id)\n ->map(function ($subitem, $subkey) {\n $subitem->delete();\n });\n }\n $item->delete();\n });\n }", "public function updateChildren(Collection $children)\n {\n foreach ($children as $child) {\n $this->update($child, ['parent_slug' => null]);\n }\n }", "public function _unset() {\r\n\t\t$index = 0;\r\n\t\t$children = $this->_parent()->_children();\r\n\t\tforeach ($children as $child) {\r\n\t\t\tif ($child->identifier() == $this->identifier()) {\r\n\t\t\t\t$this->_parent()->_removeChildAtIndex($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$index++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $index;\r\n\t}", "function rm_child($child_id) {\n $t = @$this->triples[$child_id];\n if($t) {\n unset($this->children[$t->parent_id][$child_id]);\n unset($this->triples[$child_id]);\n }\n }", "function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $res[] = $db->query( \"DELETE FROM eZTodo_Priority WHERE ID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n }", "final public function clearChildren() {\n\t\treturn $this;\n\t}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function delete(){\n foreach ( $this->playeractiveitems as $playeractiveitem ){\n $playeractiveitem->delete();\n }\n parent::delete();\n }", "function delete_all()\n {\n $this->Admin_model->package = 'POSTS_PKG';\n $this->Admin_model->procedure = 'POST_DELETE';\n\n\n /*if ($_SERVER['REQUEST_METHOD'] == 'POST') {*/\n for ($i = 0; $i < count($this->p_delete); $i++) {\n $this->Admin_model->package = 'POSTS_PKG';\n $this->Admin_model->delete($this->p_delete[$i]);\n //Modules::run('admin/Post_Categories/delete', $this->p_delete[$i]);\n }\n\n /* } else {\n redirect('admin/Posts/display_cat');\n }\n redirect('admin/Posts/display_cat');*/\n }", "public function delete(bool $keepFilesystemFiles = false): void\n {\n\t\tforeach($this->getMetaFiles() as $f) {\n\t\t\t$f->delete($keepFilesystemFiles);\n\t\t}\n\n\t\tforeach($this->getMetaFolders() as $f) {\n\t\t\t$f->delete($keepFilesystemFiles);\n\t\t}\n\n\t\t$db = Application::getInstance()->getVxPDO();\n\n\t\t$db->beginTransaction();\n\t\t$db->deleteRecord('folders', $this->id);\n\n\t\t// cascading references should render this not necessary\n\n\t\t$db->deleteRecord('files', ['foldersid' => $this->id]);\n\n\t\t$db->execute('UPDATE folders SET r = r - 2 WHERE r > ?', [$this->r]);\n\t\t$db->execute('UPDATE folders SET l = l - 2 WHERE l > ?', [$this->r]);\n\t\t$db->commit();\n\n unset(self::$instancesById[$this->id], self::$instancesByPath[$this->filesystemFolder->getPath()]);\n\n if(!$keepFilesystemFiles) {\n\t\t\t$this->filesystemFolder->delete();\n\t\t}\n\n\t\t// refresh nesting for every already instantiated (parent and neighboring) folders\n\n self::refreshNestings();\n\t}", "public function deleteChildAccount()\n {\n\n $this->lastResponse = $this->makeRequest('account', 'DELETE');\n\n return $this->lastResponse->bodyJson;\n\n }", "function remove_children(&$node) {\n\twhile ($node->firstChild) {\n\t\twhile ($node->firstChild->firstChild) {\n\t\t\tremove_children($node->firstChild);\n\t\t}\n\t\t$node->removeChild($node->firstChild);\n\t}\n}", "public function removeChild($position = null, $forceDelete = false);", "protected function _before_delete(): void\n {\n //this will try to delete all the content records to which it has access\n //if there are remaining content records the deletion of the Page will fail due to the Foreign Key contraint restrict\n $contents = PageContent::get_by( ['page_id' => $this->page_id] );\n foreach ($contents as $PageContent) {\n $PageContent->delete();\n }\n }", "function deleteObjTree($types=null,$dq=null){\n\t\t// You should limit by specifying list of allowed types.\n\t\t//\n\t\t// For your safety - $types is required by this function. Always list allowed\n\t\t// types to avoid disaster just because someone added a new relation type\n\t\t// with incorrect linknig\n\t\t$obj_pool = $this->loadChild($types,$dq);\n\n\t\tforeach($obj_pool as $obj){\n\t\t\t$obj->deleteObjTree($types,$dq);\n\t\t}\n\t\t$this->destroy();\n\t}", "public function remove()\n \t{\n \t\tforeach( $this->pages as $page ) {\n\n \t\t\t$page->update( ['menu_id' => null] );\n\n \t\t}\n\n \t\treturn $this->delete();\n \t}", "public function destroyMultiplePages()\n {\n\n try {\n $input = $this->request->all();\n\n if(isset($input['ids']))\n {\n\n $ids = array_filter($input['ids']);\n $this->page->bulkDeletions( $ids );\n return $this->cmsResponse('Successfully deleted all pages.');\n }\n return $this->cmsResponse('Failed to delete page(s).',400);\n\n } catch (SystemError $e) {\n return $this->cmsResponse($e->getMessage(),400);\n } catch (\\Exception $e) {\n return $this->cmsResponse($e->getMessage(),400);\n }\n }", "public function actionDelete ()\n\t\t{\n\t\t\tif (Yii::$app->request->isAjax)\n\t\t\t{\n\t\t\t\t$id = Yii::$app->request->post('id');\n\t\t\t\t$menu = Menu::findOne($id);\n\t\t\t\tif ($menu !== null)\n\t\t\t\t{\n\t\t\t\t\tif (!$menu->deleteWithChildren())\n\t\t\t\t\t\techo Json::encode(current($menu->firstErrors));\n\t\t\t\t\telse\n\t\t\t\t\t\techo 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tYii::$app->end();\n\t\t}", "function delete() {\n\t\tglobal $DB_LINK, $db_table_recipes, $db_table_list_recipes, $db_table_related_recipes, $db_table_ingredientmaps, $db_table_reviews,\n\t\t\t$db_table_ratings, $db_table_mealplans, $db_table_favorites;\n\n\t\t$sql = \"DELETE from $db_table_recipes WHERE recipe_id=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_list_recipes WHERE list_rp_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_related_recipes WHERE related_parent=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_ingredientmaps WHERE map_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_reviews WHERE review_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_ratings WHERE rating_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_mealplans WHERE mplan_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\n\t\t$sql = \"DELETE from $db_table_favorites WHERE favorite_recipe=?\";\n\t\t$stmt = $DB_LINK->Prepare($sql);\n\t\t$rc = $DB_LINK->Execute($stmt, array($this->id));\n\t\tDBUtils::checkResult($rc, NULL, NULL, $sql);\n\t}", "public function delete(Model $parent);", "public function deleteNode()\n {\n \n $arra_sub_tree=$this->getSubTree($this->int_my_position);\n \n $this->setPositionToParent();\n \n foreach($arra_sub_tree as $node)\n { \n $index=$this->getIndexById($node['my_id']);\n $this->arra_node_to_delete[]=$node['my_id'];\n unset($this->arra_tree[$index]);\n }\n\n }", "public function test_delete_child_collection(): void\n {\n // Arrange\n $user = UserFactory::createOne()->object();\n $collectionLevel1 = CollectionFactory::createOne(['owner' => $user]);\n ItemFactory::createMany(3, ['collection' => $collectionLevel1, 'owner' => $user]);\n $collectionLevel2 = CollectionFactory::createOne(['parent' => $collectionLevel1, 'owner' => $user]);\n ItemFactory::createMany(3, ['collection' => $collectionLevel2, 'owner' => $user]);\n $collectionLevel3 = CollectionFactory::createOne(['parent' => $collectionLevel2, 'owner' => $user]);\n ItemFactory::createMany(3, ['collection' => $collectionLevel3, 'owner' => $user]);\n $collectionLevel4 = CollectionFactory::createOne(['parent' => $collectionLevel3, 'owner' => $user]);\n ItemFactory::createMany(3, ['collection' => $collectionLevel4, 'owner' => $user]);\n\n // Act\n $collectionLevel3->remove();\n $this->refreshCachedValuesQueue->process();\n\n // Assert\n $this->assertSame(6, $collectionLevel1->getCachedValues()['counters']['items']);\n $this->assertSame(1, $collectionLevel1->getCachedValues()['counters']['children']);\n\n $this->assertSame(3, $collectionLevel2->getCachedValues()['counters']['items']);\n $this->assertSame(0, $collectionLevel2->getCachedValues()['counters']['children']);\n }" ]
[ "0.8265445", "0.69849056", "0.69409126", "0.6756809", "0.65416926", "0.64437217", "0.64293283", "0.63052094", "0.6276008", "0.6245703", "0.62349564", "0.62146646", "0.61176044", "0.61090916", "0.60901797", "0.5929997", "0.59270346", "0.59261876", "0.5921347", "0.590726", "0.5906294", "0.588694", "0.58795273", "0.58643425", "0.582815", "0.5826002", "0.5826002", "0.5826002", "0.5820245", "0.57991123", "0.57745737", "0.57686687", "0.57611114", "0.5760525", "0.57487404", "0.57266694", "0.5714136", "0.5706435", "0.5679993", "0.5661359", "0.564591", "0.5637867", "0.5627991", "0.56138563", "0.56031907", "0.5598653", "0.55725527", "0.5564543", "0.5558586", "0.5558098", "0.55401224", "0.5524608", "0.5520957", "0.5510629", "0.5507716", "0.54832715", "0.54814297", "0.54807854", "0.5478942", "0.5476284", "0.54736125", "0.5467032", "0.54556394", "0.54529834", "0.54502875", "0.5449576", "0.54471326", "0.54434836", "0.5423159", "0.5417243", "0.5414794", "0.54125524", "0.54105425", "0.5385831", "0.5380894", "0.5380391", "0.5374617", "0.5373374", "0.5372967", "0.53726876", "0.5356841", "0.5352343", "0.5350074", "0.5350074", "0.5350074", "0.53464717", "0.53436416", "0.533508", "0.53268164", "0.5321934", "0.53151", "0.53104", "0.53008103", "0.53004336", "0.53001046", "0.52965873", "0.5295169", "0.5290358", "0.5286921", "0.5286416" ]
0.55096513
54
Passes through all unknown calls onto the translator object.
public function __call($method, array $arguments) { $translator = $this->translator; $arguments = array_values($arguments); return $translator->$method(...$arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function translator();", "private static function translator()\n {\n $files = ['Lang', 'Smiley'];\n $folder = static::$root.'Translator'.'/';\n\n self::call($files, $folder);\n\n $files = ['LanguageKeyNotFoundException', 'LanguageNotSupportedException'];\n $folder = static::$root.'Translator/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "private function dummyMethodToIncludeTranslatableString(){\n return;\n /** @var TranslatorInterface $translator */\n $translator = $this->container->get('translator');\n if ($translator !== null) {\n $translator->trans('hasFacebook', array(), 'advertise');\n $translator->trans('hasTwitter', array(), 'advertise');\n $translator->trans('hasInstagram', array(), 'advertise');\n }\n unset($translator);\n }", "public function translated();", "public function translated();", "public function translate();", "protected function initTranslateable()\n {\n if ($this->translateAdapter instanceof \\Zend_Translate_Adapter) {\n // OK\n $this->initGenderTranslations();\n return;\n }\n\n if ($this->translate instanceof \\Zend_Translate) {\n // Just one step\n $this->translateAdapter = $this->translate->getAdapter();\n $this->initGenderTranslations();\n return;\n }\n\n if ($this->translate instanceof \\Zend_Translate_Adapter) {\n // It does happen and if it is all we have\n $this->translateAdapter = $this->translate;\n $this->initGenderTranslations();\n return;\n }\n\n // Make sure there always is an adapter, even if it is fake.\n $this->translateAdapter = new \\MUtil_Translate_Adapter_Potemkin();\n\n $this->initGenderTranslations();\n }", "public function translate($string, array $arguments = array());", "public function preDispatch() {\n\t\t$registry = Shineisp_Registry::getInstance ();\n\t\t$this->translator = $registry->Zend_Translate;\n\t}", "public function hasTranslator();", "abstract public function translate($sentence);", "protected abstract function getTranslations();", "private function onCompile(array &$messages): void\n {\n foreach ($this->onCompile as $callback) {\n $locale = $this->locale;\n $callback($messages, $locale);\n }\n }", "function translate($message, $count = NULL);", "public function translationStart()\n {\n }", "protected function _callSmartyMethods()\n\t{\n foreach ($this->_smartyMethods as $methodName => $call) {\n\t\t\tforeach ($call as $args) {\n\t\t\t\t$this->_setSmartyMethod($methodName, $args);\n\t\t\t}\n }\n\t\tunset($this->_smartyMethods);\n\t}", "public function translator(): Translator;", "private function translation_callback($matches) {\r\n\t\treturn $this->pi_getLL($matches[1], 'no translation found');\r\n\t}", "public function testBuildMarshalMapTranslationsOn(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n $marshaller = $table->marshaller();\n $translate = $table->behaviors()->get('Translate');\n\n $result = $translate->buildMarshalMap($marshaller, [], ['translations' => true]);\n $this->assertArrayHasKey('_translations', $result);\n $this->assertInstanceOf('Closure', $result['_translations']);\n\n $result = $translate->buildMarshalMap($marshaller, [], []);\n $this->assertArrayHasKey('_translations', $result);\n $this->assertInstanceOf('Closure', $result['_translations']);\n }", "public function testPassDoesNothingIfTranslatorIsNotAvailable()\n {\n $this->setExpectedException(null);\n $this->container->compile();\n }", "protected function getTranslateTools() {}", "public static function clearTranslator(): void\n {\n self::$translator = null;\n }", "function attempt_to_hook_domain_mapping_plugins() {\n\t\tif ( ! Constants::is_defined( 'SUNRISE' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$hooked = false;\n\t\t$count = count( self::$test_methods );\n\t\tfor ( $i = 0; $i < $count && ! $hooked; $i++ ) {\n\t\t\t$hooked = call_user_func( array( $this, self::$test_methods[ $i ] ) );\n\t\t}\n\t}", "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 getTranslations()\n {\n }", "public function translate($string)\n {\n return call_user_func_array([$this->translator, 'translate'], func_get_args());\n }", "function p($text) {\r\n\t$args = func_get_args();\r\n\t$text = array_shift($args); // temporary get the text out\r\n\tarray_unshift($args,null); // to use active language\r\n\tarray_unshift($args,$text); // bring back the text\r\n\t$translated = call_user_func_array('t',$args); // call our translator\r\n\techo $translated;\r\n}", "private function translate_process($from,$to) {\n $request = $this->baserequest;\n /// ** Define options **//\n $options = $this->options;\n foreach($this->text As $k=>$text) {\n $options = array_merge($options,array('text#'.$k => $text));\n }\n $options = array_merge($options,array('auth_key' => $this->api));\n if ($from != 'auto') {$options = array_merge($options,array('source_lang' => $from));}\n $options = array_merge($options,array('target_lang' => $to));\n /// ** POST / GET -> define parameters **//\n if (strtolower($this->method) == 'post') {\n $optpost = \"\";\n foreach($options As $k => $e) {\n if (count(explode('#',$k)) > 1) {\n $k = explode('#',$k)[0];\n }\n $optpost = $optpost.$k.\"=\".$e.\"&\";\n }\n $optpost = substr($optpost,0,strlen($optpost)-1);\n $res = $this->curlHandler($request,$optpost);\n } else if (strtolower($this->method == 'get')) {\n foreach($options As $k => $e) {\n if (count(explode('#',$k)) > 1) {\n $k = explode('#',$k)[0];\n }\n $request = $request.$k.'='.$e.'&';\n }\n $request = substr($request,0,strlen($request)-1);\n $res = $this->curlHandler($request);\n } else {\n Throw new Exception(\"Method not supported, select POST or GET\");\n }\n $this->addResponse($to,$res);\n }", "public function testMultipleTranslate()\n {\n // Given\n $this->responseMock->expects($this->any())->method('json')->will($this->returnValue(\n ['data' => ['translations' => [['translatedText' => 'salut']]]]\n ));\n\n // When\n $values = $this->translator->translate(['hi', 'hi'], 'fr', 'en');\n\n // Then\n $this->assertCount(2, $values, 'Should return an array with 2 elements');\n\n foreach ($values as $value) {\n $this->assertEquals($value, 'salut', 'Should return \"salut\"');\n }\n }", "public function __construct() {\n\t\t$this->translates = array_merge($this->translates, $this->swTranslates);\n\t}", "function y_translate($text, $lang = \"en-ru\")\r\n{\r\n global $encoding;\r\n $save_encoding = @$encoding;\r\n $encoding = 'UTF-8';\r\n $url = 'http://translate.yandex.net/api/v1/tr.json/translate?format=html&lang=' . $lang . '&text=' . urlencode($text);\r\n for ($i=0;$i<5;$i++) {\r\n $result = json_decode(get($url), true);\r\n if (g('last_result')==200) break;\r\n }\r\n $encoding=$save_encoding;\r\n if ($result['code'] == 200) {\r\n $r = implode('<br />', $result['text']);\r\n } else $r = $text;\r\n\r\n if (DEV)\r\n xlogc('y_translate', $r, $text, $lang);\r\n\r\n return $r;\r\n}", "static protected function translate($s){\nif(!self::$strings)return $s;\nif(!array_key_exists($s,self::$strings))return $s;\nreturn self::$strings[$s];\n}", "function list_translation_updates()\n {\n }", "public function __call($name, $args) {\n castSpell();\n }", "private function _callToDefault()\n {\n foreach (get_class_methods($this) as $method) {\n try {\n $that = new ReflectionMethod($this, $method);\n } catch (ReflectionException $exception) {\n break;\n }\n if (\n $that->isProtected()\n && !array_key_exists($method, $this->query())\n ) {\n $this->{$method}($this->builder);\n }\n }\n }", "function wp_load_translations_early()\n {\n }", "function translate_bing($data)\n\t {\n\t \t //\n\t \t //print_r($data);\n\t \t $api = 'F0DE0CCB37335B16E7EB0BD3FA2A3C9FD3543DE5';\n\t \t \n\t \t if(empty($data['text']))\n\t\t { \n\t\t return ''; \n\t\t } \n\t\t \n\t\t if($data['orignal_type'] == 'zh')\n\t\t {\n\t\t \t$data['orignal_type'] = 'zh-CHS';\n\t\t }\n\t\t \n\t\t if($data['local_type'] == 'zh')\n\t\t {\n\t\t \t$data['local_type'] = 'zh-CHS';\n\t\t }\n\n\t\t \n\t\t $url = \"http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=\".$api.\"&text=\".urlencode($data['text']) . \"&from=\" . $data['orignal_type'] . \"&to=\" . $data['local_type']; \n\t\t \n\t\t //echo $url;\n\t\t \n\t\t if (function_exists('curl_init')) \n\t\t { \n\t\t $curl = curl_init(); \n\t\t curl_setopt($curl, CURLOPT_URL, $url); \n\t\t curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t\t $res = curl_exec($curl); \n\t\t } \n\t\t else \n\t\t { \n\t\t $res = @file_get_contents($url); \n\t\t }\n\t\t \n\t\t //echo $res;\n\t\t \n\t\t preg_match(\"~<string([^><]*?)>([\\s\\S]*?)<\\/string>~i\", $res, $ostr); \n\t\t //print_r($ostr);\n\t\t if (empty($ostr[2])) \n\t\t { \n\t\t return ''; \n\t\t } \n\t\t else \n\t\t { \n\t\t return htmlspecialchars_decode($ostr[2]); \n\t\t } \n\t }", "private function parseTranslateInvokes($file_path) {\n $tokens = \\token_get_all(\\file_get_contents(APP_DIR . \"/\" . $file_path));\n // Declare iteration variables.\n $translate_invokes = array();\n $line = 0;\n $token = null;\n $token_type = null;\n $ignore_next_string = false;\n $function_started = false;\n $pending_arguments = 0;\n $arguments = array();\n $pending_function = null;\n foreach ($tokens as $token_data) {\n $expected = false;\n if (!is_array($token_data))\n $token = $token_type = $token_data;\n else\n list($token_type, $token, $line) = $token_data;\n switch ($token_type) {\n case \"(\":\n if ($function_started || $pending_arguments == 0)\n break;\n $function_started = true;\n $expected = true;\n break;\n case \",\":\n case \\T_WHITESPACE:\n case \\T_COMMENT:\n case \\T_DOC_COMMENT:\n $expected = true;\n break;\n case \\T_FUNCTION:\n case \\T_CLASS:\n $ignore_next_string = true;\n break;\n case \\T_CONSTANT_ENCAPSED_STRING:\n if (!$function_started)\n break;\n $arguments[] = eval(\"return $token;\");\n $pending_arguments--;\n $reference = \"$file_path:$line\";\n if ($pending_arguments == 0) {\n switch ($pending_function) {\n case \"gettext\":\n $translate_invokes[] = array($arguments[0], \"\", \"\", $reference);\n break;\n case \"ngettext\":\n $translate_invokes[] = array($arguments[0], $arguments[1], \"\", $reference);\n break;\n case \"pgettext\":\n $translate_invokes[] = array($arguments[1], \"\", $arguments[0], $reference);\n break;\n }\n $function_started = false;\n $arguments = array();\n }\n $expected = true;\n break;\n case \\T_STRING:\n if ($ignore_next_string) {\n $ignore_next_string = false;\n break;\n } else if ($pending_arguments > 0)\n break;\n if ($token[0] == \"\\\\\")\n $token = \\substr($token, 1);\n if ($token == \"__\" || $token == \"_\" || $token == \"gettext\") {\n $pending_arguments = 1;\n $pending_function = \"gettext\";\n $expected = true;\n } else if ($token == \"ngettext\" || $token == \"jsngettext\") {\n $pending_arguments = 2;\n $pending_function = \"ngettext\";\n $expected = true;\n } else if ($token == \"pgettext\") {\n $pending_arguments = 2;\n $pending_function = \"pgettext\";\n $expected = true;\n }\n break;\n }\n if (!$expected && $pending_arguments > 0)\n trigger_error(\"Error when when updating translation at $file_path:$line.\\n\"\n . \"Expected literal string expression (T_CONSTANT_ENCAPSED_STRING) in translation invoke. Found: \" . (is_integer($token_type)? \\token_name($token_type): $token), \\E_USER_ERROR);\n }\n return $translate_invokes;\n }", "public function translate($string, $context = 0, $values = null, $lang = null);", "function onCall(ObjectProxyCall $call);", "protected function checkTranslatedShortcut() {}", "public function initializeLanguages() {}", "function wp_get_translation_updates()\n {\n }", "function translate($data)\n\t {\n\t \t return $this->translate_bing($data);\n\t }", "function action_on_translation_set( $translation_set ) {\n\t}", "public function _($string)\n {\n $args = func_get_args();\n $translator = \\Hynage\\I18n\\Translator::getInstance();\n return call_user_func_array(array($translator, 'translate'), $args);\n }", "function perform_action($action_name, ...$args){\n global $_lms_action_arr;\n if(!empty($_lms_action_arr[$action_name])){\n $func_names = $_lms_action_arr[$action_name];\n print_r($func_names);\n foreach($func_names as $func){\n if(!empty($func)){\n //Handles the bug when a hook is not properly dequeued.\n call_user_func_array($func['name'], $args);\n }\n\n }\n }\n\n}", "public function translate($text);", "public function hasTranslator(): bool;", "public function __call($method, $arguments)\n {\n return $this->proxyCurrentLocaleTranslation($method, $arguments);\n }", "function _wp_call_all_hook($args)\n {\n }", "abstract protected function doTransload();", "abstract public function replace($translations);", "public function testBuildMarshalMapTranslationsOff(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n\n $marshaller = $table->marshaller();\n $translate = $table->behaviors()->get('Translate');\n $result = $translate->buildMarshalMap($marshaller, [], ['translations' => false]);\n $this->assertSame([], $result);\n }", "public function do_all_hook(&$args)\n {\n }", "public function processAnnotations()\n {\n foreach ($this->generatorRegistry->annotationManager->get(\"event\", true) as $tScanResult) {\n if ($tScanResult[AnnotationManager::LEVEL] !== \"staticMethods\") {\n continue;\n }\n\n foreach ($tScanResult[AnnotationManager::VALUE] as $tEvent) {\n $this->events->register(\n $tEvent[\"on\"],\n [$tScanResult[AnnotationManager::SOURCE], $tScanResult[AnnotationManager::MEMBER]],\n null,\n isset($tEvent[\"priority\"]) ? $tEvent[\"priority\"] : null\n );\n }\n }\n }", "public function translate(string $text);", "public function testMultipleEconomicTranslate()\n {\n // Given\n $this->responseMock->expects($this->once())->method('json')->will($this->returnValue(\n ['data' => ['translations' => [['translatedText' => 'salut # salut']]]]\n ));\n\n // When\n $values = $this->translator->translate(['hi', 'hi'], 'fr', 'en', true);\n\n // Then\n $this->assertCount(2, $values, 'Should return an array with 2 elements');\n\n foreach ($values as $value) {\n $this->assertEquals($value, 'salut', 'Should return \"salut\"');\n }\n }", "function _hkm_callAllHook( $args ) {\n\tglobal $hkm_filter;\n\n\t$hkm_filter['all']::DO_ALL_HOOK( $args );\n}", "public function initTranscodings()\n\t{\n\t\tif ($this->collTranscodings === null) {\n\t\t\t$this->collTranscodings = array();\n\t\t}\n\t}", "private function internal_translate_words() {\n global $DB;\n $this->translated = false;\n\n // Get list of all words used.\n $allwords = array();\n foreach (array_merge($this->terms, $this->negativeterms) as $term) {\n $allwords = array_merge($allwords, $term->words);\n }\n $allwords = array_unique($allwords);\n if (count($allwords) === 0) {\n return array(false, null);\n }\n\n // OK, great, now let's build a query for all those words.\n list ($wordlistwhere, $wordlistwherearray) =\n $DB->get_in_or_equal($allwords);\n $words = $DB->get_records_select('local_ousearch_words',\n 'word ' . $wordlistwhere, $wordlistwherearray, '', 'word,id');\n\n // Convert words to IDs.\n $newterms = array();\n $lastmissed = '';\n foreach ($this->terms as $term) {\n $missed = false;\n $term->ids = array();\n foreach ($term->words as $word) {\n if (!array_key_exists($word, $words)) {\n $missed = true;\n $lastmissed = $word;\n break;\n } else {\n $term->ids[] = $words[$word]->id;\n }\n }\n // If we didn't have some words in the term...\n if ($missed) {\n // Required term? Not going to find anything then.\n if ($term->required || !self::SUPPORTS_OR) {\n return array(false, $lastmissed);\n }\n // If not required, just dump that term.\n } else {\n $newterms[] = $term;\n }\n }\n // Must have some (positive) terms.\n if (count($newterms) == 0) {\n return array(false, $lastmissed);\n }\n $this->terms = $newterms;\n\n $newterms = array();\n foreach ($this->negativeterms as $term) {\n $missed = false;\n $term->ids = array();\n foreach ($term->words as $word) {\n if (!array_key_exists($word, $words)) {\n $missed = $word;\n break;\n } else {\n $term->ids[] = $words[$word]->id;\n }\n }\n // If we didn't have some words in the term, dump it.\n if (!$missed) {\n $newterms[] = $term;\n }\n }\n $this->negativeterms = $newterms;\n $this->translated = true;\n return array(true, true);\n }", "function is_translatable()\n {\n }", "protected function initTranslate()\n {\n try {\n $this->_xl8 = new Zend_Translate(Zend_Translate::AN_GETTEXT,\n Utils_ResourceLocator::langFile($this->_locale),\n $this->_locale->getLanguage(),\n array('disableNotices' => true));\n Zend_Registry::set('Zend_Translate', $this->_xl8);\n } catch (Exception $e) {\n throw new WrappedException('unable to initialize translate', $e);\n }\n }", "public function testTranslateNoProxy()\n {\n $translator = new \\Magento\\Framework\\Translate\\Adapter();\n $this->assertEquals('test string', $translator->translate('test string'));\n }", "public function testTranslateUsingDetector()\n {\n // Given\n $this->responseMock->expects($this->any())->method('json')->will($this->returnValue(\n ['data' => ['translations' => [['translatedText' => 'comment allez-vous ?']]]]\n ));\n\n // When\n $value = $this->translator->translate('how are you?', 'fr');\n\n // Then\n $this->assertEquals($value, 'comment allez-vous ?', 'Should return \"comment allez-vous ?\"');\n }", "public function practice3()\n {\n $translator = new Parser();\n $translation = $translator->translate('Hello World');\n dump($translation);\n }", "public function traverse(callable $transformation);", "public function translateTo($event, $sequence, Threaded $args = null);", "public function traverse(): void\n {\n // Register data hooks on the table\n $this->registerHandlerDefinitions($this->definition->tableName, $this->definition->tca);\n \n // Register data hooks on the types and fields\n $this->traverseTypes();\n $this->traverseFields();\n \n // Allow externals\n $this->eventBus->dispatch(new CustomDataHookTraverserEvent($this->definition, function () {\n $this->registerHandlerDefinitions(...func_get_args());\n }));\n }", "public function onAfterInitialise()\n\t{\n\t\t$this->call(array('System\\\\Command', 'execute'));\n\n\t\tif ($this->params->get('tranAlias', 1))\n\t\t{\n\t\t\t$this->call(array('Article\\\\Translate', 'translateAlias'), $this);\n\t\t}\n\n\t\tif ($this->params->get('languageOrphan', 0))\n\t\t{\n\t\t\t$this->call(array('System\\\\Language', 'orphan'));\n\t\t}\n\n\t\t@include $this->includeEvent(__FUNCTION__);\n\t}", "public function __call($method, $args) {\n\t\t\tforeach ($this->translators as $translator) {\n\t\t\t\tif ($translator->__hasMethod($method)) {\n\t\t\t\t\treturn call_user_func_array(array($translator, $method), $args);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new Throwable\\UnimplementedMethod\\Exception('Unable to call method. No method \":method\" exists.', array(':method' => $method));\n\t\t}", "public function processHooks() {\n\t\t//get hooks from level \"2\" backtrace\n\t\t$sortedHooks = $this->returnHooks(2);\n\t\t$return = array();\n\t\tif(!empty($sortedHooks)) {\n\t\t\tforeach($sortedHooks as $hook) {\n\t\t\t\t$module = $hook['module'];\n\t\t\t\t$namespace = $hook['namespace'];\n\t\t\t\tif(!class_exists($namespace.$hook['class'])) {\n\t\t\t\t\t//its active so lets get BMO to load it\n\t\t\t\t\t//basically we are hoping the module itself will load the right class\n\t\t\t\t\t//follow FreePBX BMO naming Schema\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$this->FreePBX->$module;\n\t\t\t\t\t\tif(!class_exists($namespace.$hook['class'])) {\n\t\t\t\t\t\t\t//Ok we really couln't find it. Give up\n\t\t\t\t\t\t\tthrow new \\Exception('Cant find '.$namespace.$hook['class']);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\tif($e->getCode() != 404) {\n\t\t\t\t\t\t\tthrow new \\Exception('Error From Module '.$namespace.$hook['class'].\": '\".$e->getMessage().\"'\".$e->getCode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->updateBMOHooks();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$meth = $hook['method'];\n\t\t\t\t//now send the method from that class the data!\n\t\t\t\t\\modgettext::push_textdomain(strtolower($module));\n\t\t\t\ttry {\n\t\t\t\t\t$return[$module] = call_user_func_array(array($this->FreePBX->$module, $meth), func_get_args());\n\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\t//module does not exist, try to resolve right now\n\t\t\t\t\tif($e->getCode() != 404) {\n\t\t\t\t\t\tthrow $e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->updateBMOHooks();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\\modgettext::pop_textdomain();\n\t\t\t}\n\t\t}\n\t\t//return the data from that class\n\t\treturn $return;\n\t}", "function format_call_directions($key)\n{\n foreach (get_call_directions() as $type) {\n if ($type['key'] == $key) {\n return _l($type['lang_key']);\n }\n }\n\n return $type;\n}", "function wp_get_available_translations()\n {\n }", "protected function _initTranslate() {\n\t\t$translate = new Zend_Translate('array',\n\t\t\tAPPLICATION_PATH . '/langs',\n\t\t\tnull,\n\t\t\tarray('scan'=>Zend_Translate::LOCALE_FILENAME)\n\t\t\t);\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$registry->set('Zend_Translate',$translate);\n\t\t// This is assigned by the initLocale on the fly based on browser language\n\t\t//$translate->setlocale('en_US');\n\t}", "public function getAllTranslationByLanguage();", "public function incLocalLang() {}", "function yourls_translate( $text, $domain = 'default' ) {\n\t$translations = yourls_get_translations_for_domain( $domain );\n\treturn yourls_apply_filter( 'translate', $translations->translate( $text ), $text, $domain );\n}", "public function isTranslated();", "private function populateTranslations()\n {\n //translations\n $aRelated = $this->owner->getRelatedRecords();\n if (isset($aRelated[$this->relation]) && $aRelated[$this->relation] != null) {\n if (is_array($aRelated[$this->relation])) {\n foreach ($aRelated[$this->relation] as $model) {\n $this->_models[$model->getAttribute($this->languageField)] = $model;\n }\n } else {\n $model = $aRelated[$this->relation];\n $this->_models[$model->getAttribute($this->languageField)] = $model;\n }\n }\n }", "public function __construct() {\n\t\t\t$this->trans_strings();\n\t\t}", "public function loadTranslations()\n {\n $oTranslation = new Translation($this->sLang, $this->sBundleName);\n $this->aView[\"lang\"] = $this->sLang;\n $this->aView[\"tr\"] = $oTranslation->getTranslations();\n }", "protected static function setLanguageKeys() {}", "private function mockTranslations(): void\n {\n $languages = [/*'en_EN',*/\n 'fr_FR', 'de_DE', ];\n $i18nItems = I18nItem::where('status', I18nItem::STATUS_DRAFT)->get();\n\n foreach ($languages as $language) {\n $faker = \\Faker\\Factory::create($language);\n\n foreach ($i18nItems as $i18nItem) {\n $charCount = round(strlen($i18nItem->value) * 1.5);\n $mockValue = $faker->realText($charCount > 10 ? $charCount : 10);\n $short = strlen($mockValue) < 256;\n\n I18nTranslation::create([\n 'i18n_item_id' => $i18nItem->id,\n 'language' => substr($language, 0, 2),\n 'short_value' => $short ? $mockValue : null,\n 'long_value' => ! $short ? $mockValue : null,\n ]);\n }\n }\n }", "private function translations()\n {\n $this['translator'] = $this->share($this->extend('translator', function ($translator) {\n $translator->addLoader('yaml', new TranslationFileLoader());\n\n $translator->addResource('yaml', 'config/locales/pt-br.yml', 'pt-br');\n $translator->addResource('yaml', 'config/locales/en-us.yml', 'en-us');\n $translator->addResource('yaml', 'config/locales/es-es.yml', 'es-es');\n\n return $translator;\n }));\n }", "function translate( $object, $fields = array() )\n {\n // make sure $fields is an array\n $fields = (array) $fields;\n\n // assume all database columns if $fields is not provided.\n if(empty($fields))\n {\n $fields = $object->fields;\n }\n\n // loop through the fields\n foreach($fields as $f)\n {\n // first, deal with the loaded fields\n if ( isset($object->{$f}) )\n {\n $line = lang($object->{$f});\n if ( $line )\n {\n $object->{$f};\n }\n }\n\n // then, loop through the all array\n foreach($object->all as $key => $all_object)\n {\n if ( isset($all_object->{$f}) )\n {\n $line = lang($all_object->{$f});\n if ( $line )\n {\n $object->all[$key]->{$f} = $line;\n }\n }\n }\n }\n\n // return the Datamapper object\n return $object;\n }", "public function translate($message, $count = NULL)\n {\n return parent::translate($message);\n }", "protected function extraCall($matches, $table){\n //void\n }", "public function translate()\n {\n $query = $this->query;\n if($this->verbose) Yii::debug(\" *** Query is '$query', using language '$this->language'... ***\", __METHOD__);\n if( ! $query ) return \"\";\n $tokenizer = new Tokenizer($query);\n $tokens = $tokenizer->tokenize();\n $operators = $this->getOperators();\n $hasOperator = false;\n $parsedTokens = [];\n $dict = $this->getDictionary();\n if($this->verbose) Yii::debug($dict, __METHOD__);\n do {\n $token = isset($tokens[0]) ? $tokens[0] : \"\";\n if($this->verbose) Yii::debug(\"Looking at '$token'...\", __METHOD__);\n // do not translate quoted expressions\n if ( in_array( $token[0], [\"'\", '\"']) ) {\n array_shift($tokens);\n } else {\n // compare multi-word token\n $offset = 1;\n for($i=0; $i<count($tokens); $i++){\n $compare = implode( \" \", array_slice( $tokens, 0, $i+1 ));\n $compare = mb_strtolower( $compare, \"UTF-8\");\n if ($this->verbose) Yii::debug(\"Comparing '$compare'...\", __METHOD__);\n if ($pos = strpos($compare, \"/\") or $pos = strpos($compare, \"*\")){\n $compare_key = substr( $compare, 0, $pos);\n } else {\n $compare_key = $compare;\n }\n if( isset( $dict[$compare_key] ) ) {\n $token = $dict[$compare_key];\n if( $compare_key == $compare){\n $offset = $i+1;\n }\n if($this->verbose) Yii::debug(\"Found '$token'.\", __METHOD__);\n }\n }\n $tokens = array_slice($tokens, $offset);\n if($this->verbose) Yii::debug(\"Using '$token', rest: \" . implode(\"|\",$tokens));\n }\n if (in_array($token, $operators)) {\n if($this->verbose) Yii::debug(\"Found operator '$token'.\", __METHOD__);\n $hasOperator = true;\n }\n $parsedTokens[] = $token;\n } while (count($tokens));\n if($this->verbose) Yii::debug(\"Parsed tokens: \" . implode(\"|\", $parsedTokens));\n\n // Re-assemble translated query string\n if ($hasOperator) {\n $cqlQuery = implode(\" \", $parsedTokens);\n $this->containsOperators = true;\n } else {\n // Queries that don't contain any operators or booleans are put into quotes\n $cqlQuery = '\"' . implode(\" \", $parsedTokens) . '\"';\n $this->containsOperators = false;\n }\n if($this->verbose) Yii::debug(\"CQL query: '$cqlQuery'\", __METHOD__);\n $this->parsedTokens = $parsedTokens;\n return $cqlQuery;\n }", "function castSpell() {}", "public function __construct() {\n $this->translator = I18n::getInstance()->getTranslator();\n\t}", "public function traverse(callable $callable)\n {\n }", "public static function foreachTrans(array $translations, \\Closure $callback): void\n {\n foreach ($translations as $locale => $trans) {\n foreach ($trans as $key => $value) {\n call_user_func($callback, $locale, $key, $value);\n }\n }\n }", "public function getTwords() {\n $this->tlist = getTranslatables($this->langtag);\n }", "public function call()\n {\n $this->addTranslations($this->getTranslator(), $this->getTranslationsRootFolder());\n\n $middleware = $this;\n $this->app->container->singleton(\n self::SERVICE_VALIDATOR,\n function () use ($middleware) {\n return $middleware->createValidator();\n }\n );\n\n $this->next->call();\n }", "function translate($string, $extra = \"\", $language = '')\n{\n $translation = loadTranslation(!$language ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : $language);\n if ($translation && count($translation)) {\n $translated = '';\n if (array_key_exists($string, $translation)) {\n $translated = $translation[$string];\n $translated .= strlen($extra) ? \"<br/>\" . $extra : \"\";\n } else {\n return $translated = $language != \"en\" ? translate($string, $extra, 'en') : '';\n }\n return $translated;\n } else {\n return '';\n }\n}", "static private function ___translate___()\n {\n _('RECORD\\Farthest %1$s from Sagittarius A*');\n }", "function loadTranslations($results,$name){\n $this->Session = new CakeSession(); \n $i18nPostfix = $this->Session->read(\"Config.language\");\n// $this->log(\"loadTranslations Called by \" . $name,LOG_DEBUG); \n if ($i18nPostfix === \"\") return $results;\n foreach($results as $key => $val){\n if(!empty ($val[$name])){\n foreach ($val[$name] as $innerKey => $innerVal){\n if(substr($innerKey,-1*strlen($i18nPostfix))==$i18nPostfix){\n $default_eng = substr($innerKey,0,-1*strlen($i18nPostfix) - 1);\n if(!isset($results[$key][$name][$innerKey])&& isset($results[$key][$name][$default_eng]))\n $results[$key][$name][$default_eng] = \"<b>(Translation not found)</b> \" . $results[$key][$name][$default_eng];\n else \n $results[$key][$name][$default_eng] = $results[$key][$name][$innerKey];\n }\n }\n }\n }\n return $results;\n }", "function mLANGMATCHES(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$LANGMATCHES;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:236:3: ( 'langmatches' ) \n // Tokenizer11.g:237:3: 'langmatches' \n {\n $this->matchString(\"langmatches\"); \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 testTranslationUI() {\n $this->doTestBasicTranslation();\n $this->doTestTranslationOverview();\n $this->doTestOutdatedStatus();\n $this->doTestPublishedStatus();\n $this->doTestAuthoringInfo();\n $this->doTestTranslationEdit();\n $this->doTestTranslationChanged();\n $this->doTestChangedTimeAfterSaveWithoutChanges();\n $this->doTestTranslationDeletion();\n }" ]
[ "0.67321956", "0.63414496", "0.6035033", "0.58905435", "0.58905435", "0.58658653", "0.5569538", "0.5551975", "0.5447768", "0.53850377", "0.53777415", "0.53148925", "0.52503395", "0.5223702", "0.5218721", "0.51916164", "0.51847345", "0.5177293", "0.5167865", "0.5056502", "0.5022547", "0.49728385", "0.49480194", "0.4898431", "0.48938742", "0.48901254", "0.48658428", "0.4860948", "0.48529872", "0.48328784", "0.4823897", "0.48151267", "0.48016828", "0.476009", "0.47599846", "0.47573474", "0.4752185", "0.47482115", "0.4732399", "0.47292957", "0.47248378", "0.47227246", "0.47216785", "0.47213957", "0.471707", "0.4705541", "0.47001886", "0.46876714", "0.46646872", "0.46645203", "0.46607196", "0.4660481", "0.46526393", "0.4641139", "0.46377164", "0.46335903", "0.46257204", "0.46251616", "0.46233693", "0.46216223", "0.46205226", "0.46194455", "0.46180597", "0.46178037", "0.4616681", "0.46036583", "0.45966607", "0.4594386", "0.45680532", "0.4528485", "0.4525488", "0.4514438", "0.45127454", "0.45121923", "0.45120925", "0.44847804", "0.4484761", "0.4477971", "0.4476131", "0.44683176", "0.44602752", "0.4455192", "0.44488847", "0.4443596", "0.44414493", "0.44320655", "0.44298255", "0.44262528", "0.442613", "0.44187704", "0.44184247", "0.4414351", "0.44070825", "0.4396724", "0.4391917", "0.43899018", "0.43841425", "0.43796784", "0.43795475", "0.43777308" ]
0.53125685
12
Function to run and test the program and print result to user
function queAna() { //creating new queue object $que = new Queue(); //getting prime no till 1000 $arr = getprime(1000); //checking prime numbers which are anagrams for ($i = 0; $i < count($arr); $i++) { for ($j = 0; $j < count($arr); $j++) { if ($i != $j) { //checking if anagram or not if (Utility::isAnagram($arr[$i], $arr[$j])) { $que->enqueue($arr[$i]); break; } } } } echo "Anagrams in Queue Are :\n\n"; echo $que . "\n\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run () {\r\n print \"\\n\";\r\n \r\n # Console spacing.\r\n foreach ( $this->tests as $test ) {\r\n if ( strlen( $test->name() ) > $this->longest_test_name_length )\r\n $this->longest_test_name_length = strlen( $test->name() );\r\n }\r\n \r\n foreach ( $this->tests as $test ) {\r\n $test->run();\r\n $this->print_test( $test );\r\n }\r\n \r\n $this->print_summary_stats();\r\n }", "public static function main()\n\t{\n\t\trequire_once \"PHPUnit/TextUI/TestRunner.php\";\n\n\t\t$suite = new PHPUnit_Framework_TestSuite(\"EssentialsTest\");\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "public function testMain()\n {\n echo \"\\n >----------- Test Main : ---------> \\n\";\n// $this->getRandomNumber();\n// $this->getLoggedUserMail();\n// $this->saveVerificationCode();\n// $this->verification();\n// $this->checkEmailVerification();\n// $this->checkSendCode();\n }", "public static function main() {\n\t\tTestRunner::run( self::suite() );\n\t}", "public function consoleTest() {\n // Test output\n echo \"this is a console test\".PHP_EOL;\n \n // Test colored output\n echo $this->colors->getColoredString(\"this is a colored console test\".PHP_EOL, \"red\");\n \n // Test input and return\n $input = $this->get_string(\"this is an input test: \", \"light_blue\");\n echo \"i got $input\";\n \n // Test console pause\n $this->console_pause();\n \n // Test menu\n $this->menu(\"This is a menu!\", [\"spinach\", \"barley\", \"henry viii\"], [\"A green leafy thing\", \"Some grain\", \"A really old kingadoo\"]);\n \n // Test error\n $this->error(\"time to quit!\");\n }", "final function whatIsGood() {\n echo \"Running is good <br>\";\n }", "public static function main()\n {\n include_once \"PHPUnit/TextUI/TestRunner.php\";\n\n $suite = new PHPUnit_Framework_TestSuite('Math_Numerical_RootFinding General Test');\n PHPUnit_TextUI_TestRunner::run($suite);\n }", "function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite(__CLASS__);\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "public function execute() {\n\t\t$data = $this->getResultData();\n\t\t$this->printText($data[0]);\n\t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite(__CLASS__);\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "function el_run($el_app,$el_args,$el_help,$el_bw,$el_path,$cdir) {\n\t$ARGS=urlencode(\"$el_args\");\n \techo \"You are looking at: <a href=\\\"el_run.php?el_path=$el_path&el_app=$el_app&el_bw=$el_bw&el_args=$ARGS&el_get=true\\\">$el_app</a> \";\n\techo \" <PRE>\\n\";\n\tif ($el_bw == true) {\n\t\techo \"<xmp>\";\n\t\t// set ENV variables before running expect-lite \n\t\tputenv(\"TERM=tty\");\n\t} else {\n\t\tputenv(\"TERM=web\");\n\t}\n\tputenv(\"PATH=/usr/bin:/bin\");\n\t#putenv(\"PS1=\\'# \\'\");\n\tputenv(\"COLUMNS=256\");\n\tif ($el_help == false) {\n\t\t$pipe = popen (\"$cdir/$el_app $el_args *NOINTERACT\", \"r\");\n\t} else {\n\t\t$pipe = popen (\"$cdir/$el_app $el_args -h \", \"r\");\n\t}\n\n\t//$pipe = popen (\"export TERM=web; $path/expect-lite $path/$el_app $el_args *NOINTERACT\", \"r\");\n\twhile(!feof($pipe)) {\n\t\t$line = fread($pipe, 1024);\n\t\techo $line;\n\t\t// show partial output\n\t\tflush();\t\n\t}\n\tpclose($pipe);\n\tif ($el_bw == true) {\n\t\techo \"</xmp>\";\n\t}\n\techo \"</PRE>\";\n\n}", "public function testExample()\n {\n $this->artisan('game:start')\n ->expectsOutput('you won')\n ->assertExitCode(0);\n }", "final function what_is_good() {\n\t\t\techo \"Running is Good </br>\";\n\t\t}", "protected static function runCommandLine()\n {\n $inputfile = self::createResourceUriForTest('inputfile.txt');\n $reportfile = self::createTempFileUri();\n\n self::changeWorkingDirectory(dirname($inputfile));\n\n Command::main(\n array(\n __FILE__,\n 'text',\n 'unusedcode',\n '--reportfile',\n $reportfile,\n '--inputfile',\n $inputfile,\n )\n );\n\n return file_get_contents($reportfile);\n }", "public function showTestResults() {\n echo \"Tests: {$this->tests}\\n\";\n echo \"Pass: {$this->pass}\\n\";\n echo \"Fail: {$this->fail}\\n\";\n }", "public static function main()\n {\n $suite = new TestSuite(\"Zend_ProgressBar_Adapter_ConsoleTest\");\n $result = (new resources_Runner())->run($suite);\n }", "public function runTestTask()\n\t{\n\t\t$this->runTask(1);\n\t}", "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}", "public static function test(){\n\t\t//It takes in no arguments and doesn't return anything.\n\t\t//It prints out a bunch of permutations.\n\t\t$testArray = explode(' ', Adams::getTestString());\n\t\t$testArray = Adams::raiseAll($testArray);\n\t\t$permutations = Adams::getPermutations($testArray);\t\n\t\t//print_r($permutations);\n\t\tforeach($permutations as $permutation){\n\t\t\t$outputString .= implode(' ',$permutation).\"\\n\";\t\n\t\t}\n\t\tprint $outputString;\n\t}", "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 static function main() {\r\n require_once \"PHPUnit/TextUI/TestRunner.php\";\r\n\r\n $suite = new PHPUnit_Framework_TestSuite(\"SpreadsheetReader_TextTest\");\r\n $result = PHPUnit_TextUI_TestRunner::run($suite);\r\n }", "public function test()\n {\n $process = Process::fromShellCommandline('node print-to-pdf.js');\n $process->setTimeout(30);\n $process->setOptions(['create_new_console' => true]);\n $process->setWorkingDirectory('C:/xampp/htdocs/fms');\n try {\n $process->mustRun();\n echo $process->getOutput();\n } catch (ProcessFailedException $exception) {\n echo $exception->getMessage();\n }\n }", "function main()\r\n {\r\n $this->setOutput();\r\n }", "public function main()\n\t{\n\t}", "public function testCase1()\n {\n $fa = $this->getFa();\n // Test error\n $ret = $fa->run('110', 'S0');\n $this->assertEquals($ret['status'], 'success');\n }", "public static function main()\n {\n PHPUnit_TextUI_TestRunner::run(self::suite());\n }", "public static function main()\n {\n PHPUnit_TextUI_TestRunner::run(self::suite());\n }", "public static function main()\n {\n PHPUnit_TextUI_TestRunner::run(self::suite());\n }", "public static function main()\n {\n $suite = new TestSuite(__CLASS__);\n $result = (new resources_Runner())->run($suite);\n }", "public function exec()\n {\n $report = $this->getReport();\n $this->msg = CheckMessage::report($report);\n }", "public function main()\n {\n $this->processUpdates();\n return $this->generateOutput();\n }", "public function cli_main() {\t\t\r\n\t\t$command = new Tx_PHPUnitCli_TextUI_Command();\r\n\t\t\r\n\t\t$arguments = $this->cli_getArgIndex();\r\n\t\t$rawArguments = $_SERVER['argv'];\r\n\t\t\r\n\t\tif ($arguments[$this->customArgumentKey]) {\r\n\t\t\t$extensionsWithTestSuites = $this->getExtensionsWithTestSuites();\r\n\t\t\t$testSuite = new PHPUnit_Framework_TestSuite();\r\n\t\t\t\r\n\t\t\tif (count($arguments[$this->customArgumentKey])==1) {\r\n\t\t\t\t\t// parameter as comma separated list of extension keys\r\n\t\t\t\t$extensionKeysToProcess = t3lib_div::trimExplode(',', $arguments[$this->customArgumentKey][0]);\r\n\t\t\t} else {\r\n\t\t\t\t\t// parameter\r\n\t\t\t\t$extensionKeysToProcess = $arguments[$this->customArgumentKey];\r\n\t\t\t}\r\n\t\t\t\t// Load the files containing test cases from extensions:\r\n\t\t\tforeach ($extensionKeysToProcess as $extensionKey) {\r\n\t\t\t\tif (!t3lib_extMgm::isLoaded($extensionKey)) {\r\n\t\t\t\t\t$this->cli_echo(\"Extension $extensionKey not loaded\\n\");\r\n\t\t\t\t\texit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);\r\n\t\t\t\t}\r\n\t\t\t\t$paths = $extensionsWithTestSuites[$extensionKey];\r\n\t\t\t\tself::loadRequiredTestClasses($paths);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Add all classes to the test suite which end with \"testcase\"\r\n\t\t\tforeach (get_declared_classes() as $class) {\r\n\t\t\t\t$classReflection = new ReflectionClass($class);\r\n\t\t\t\tif ($classReflection->isSubclassOf('tx_phpunit_testcase') && (strtolower(substr($class, -8, 8)) == 'testcase' || substr($class, -4, 4) == 'Test') && $class != 'tx_phpunit_testcase' && $class != 'tx_phpunit_database_testcase' && $class != 'tx_t3unit_testcase') {\r\n\t\t\t\t\t$testSuite->addTestSuite($class);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$command->setTest($testSuite);\r\n\t\t\t\r\n\t\t\t$rawArguments = $this->filterCustomCLIArguments($rawArguments);\r\n\t\t}\r\n\r\n\t\t$command->run($rawArguments, true);\r\n\t\t\r\n\t\t$testRunner = new PHPUnit_TextUI_TestRunner();\r\n\r\n\t\t$result = $testRunner->doRun($testSuite, $arguments = array());\r\n\t\t\r\n\t\tif ($exit) {\r\n\t\t\tif (isset($result) && $result->wasSuccessful()) {\r\n\t\t\t\texit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);\r\n\t\t\t}\r\n\t\t\r\n\t\t\telse if (!isset($result) || $result->errorCount() > 0) {\r\n\t\t\t\texit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);\r\n\t\t\t}\r\n\t\t\r\n\t\t\telse {\r\n\t\t\t\texit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public static function main()\n {\n\n PHPUnit_TextUI_TestRunner::run(self::suite());\n }", "public function main()\n {\n // Validate input\n $this->cli_validateArgs();\n\n // Get task (function)\n $strTask = (string) $this->cli_args['_DEFAULT'][1];\n\n switch ($strTask) {\n case 'import':\n return $this->import();\n\n default:\n $this->cli_help();\n break;\n }\n\n return self::CLI_OK;\n }", "public static function main()\n {\n $suite = new PHPUnit_Framework_TestSuite('Tine 2.0 ActiveSync Backend SyncState Tests');\n PHPUnit_TextUI_TestRunner::run($suite);\n }", "public function testing(){\n\t\t$this->load->library(\"unit_test\");\n\n\t\t$this->unit->run($this->isValid(\"\"), \"null\", \"Test Validasi Null\");\n\t\t$this->unit->run($this->isValid(\"*&&^^\"), \"symbolerror\", \"Test Validasi Symbol\");\n\t\t$this->unit->run($this->isValidHari(\"Selasa\"), true, \"Test Validasi Hari\");\n\t\t$this->unit->run($this->isValidJam(\"0\"), false, \"Test Validasi Jam\");\n\n\t\techo $this->unit->report();\n\t}", "function main(tiny_api_Cli $cli)\n{\n $cli->header('Unit Tests');\n\n $unit_test_file = $cli->get_arg('unit-test-file');\n if (!empty($unit_test_file))\n {\n if (!is_file($unit_test_file))\n {\n $cli->error(\"Could not find file \\\"$unit_test_file\\\"!\");\n exit(1);\n }\n\n $utm = tiny_api_Unit_Test_Manager::make($cli)\n ->disable_tap()\n ->disable_stop_on_failure()\n ->execute(array($unit_test_file))\n ->print_summary();\n }\n else\n {\n exec(\"/usr/bin/find \"\n . getcwd()\n . \" -name \\\"*.php\\\" | /bin/grep \\\"/tests/\\\"\",\n $files, $retval);\n\n $utm = tiny_api_Unit_Test_Manager::make($cli)\n ->execute($files)\n ->print_summary();\n }\n}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "public static function main()\n {\n $suite = new PHPUnit_Framework_TestSuite(\"Zend_Server_Method_CallbackTest\");\n $result = PHPUnit_TextUI_TestRunner::run($suite);\n }", "public static function main()\n {\n $suite = new PHPUnit_Framework_TestSuite('Tinebase_Log_Filter_FilterTest');\n $result = PHPUnit_TextUI_TestRunner::run($suite);\n }", "public function run()\n {\n $a = \"test\";\n $b = \"that is test\";\n assert($b==\"this is $a\");\n }", "function show_usage(): void\n{\n echo <<<HELP\nSynopsis:\n php run-tests.php [options] [files] [directories]\n\nOptions:\n -j<workers> Run up to <workers> simultaneous testing processes in parallel for\n quicker testing on systems with multiple logical processors.\n Note that this is experimental feature.\n\n -l <file> Read the testfiles to be executed from <file>. After the test\n has finished all failed tests are written to the same <file>.\n If the list is empty and no further test is specified then\n all tests are executed (same as: -r <file> -w <file>).\n\n -r <file> Read the testfiles to be executed from <file>.\n\n -w <file> Write a list of all failed tests to <file>.\n\n -a <file> Same as -w but append rather then truncating <file>.\n\n -W <file> Write a list of all tests and their result status to <file>.\n\n -c <file> Look for php.ini in directory <file> or use <file> as ini.\n\n -n Pass -n option to the php binary (Do not use a php.ini).\n\n -d foo=bar Pass -d option to the php binary (Define INI entry foo\n with value 'bar').\n\n -g Comma separated list of groups to show during test run\n (possible values: PASS, FAIL, XFAIL, XLEAK, SKIP, BORK, WARN, LEAK, REDIRECT).\n\n -m Test for memory leaks with Valgrind (equivalent to -M memcheck).\n\n -M <tool> Test for errors with Valgrind tool.\n\n -p <php> Specify PHP executable to run.\n\n -P Use PHP_BINARY as PHP executable to run (default).\n\n -q Quiet, no user interaction (same as environment NO_INTERACTION).\n\n -s <file> Write output to <file>.\n\n -x Sets 'SKIP_SLOW_TESTS' environmental variable.\n\n --offline Sets 'SKIP_ONLINE_TESTS' environmental variable.\n\n --verbose\n -v Verbose mode.\n\n --help\n -h This Help.\n\n --temp-source <sdir> --temp-target <tdir> [--temp-urlbase <url>]\n Write temporary files to <tdir> by replacing <sdir> from the\n filenames to generate with <tdir>. In general you want to make\n <sdir> the path to your source files and <tdir> some patch in\n your web page hierarchy with <url> pointing to <tdir>.\n\n --keep-[all|php|skip|clean]\n Do not delete 'all' files, 'php' test file, 'skip' or 'clean'\n file.\n\n --set-timeout [n]\n Set timeout for individual tests, where [n] is the number of\n seconds. The default value is 60 seconds, or 300 seconds when\n testing for memory leaks.\n\n --context [n]\n Sets the number of lines of surrounding context to print for diffs.\n The default value is 3.\n\n --show-[all|php|skip|clean|exp|diff|out|mem]\n Show 'all' files, 'php' test file, 'skip' or 'clean' file. You\n can also use this to show the output 'out', the expected result\n 'exp', the difference between them 'diff' or the valgrind log\n 'mem'. The result types get written independent of the log format,\n however 'diff' only exists when a test fails.\n\n --show-slow [n]\n Show all tests that took longer than [n] milliseconds to run.\n\n --no-clean Do not execute clean section if any.\n\n --color\n --no-color Do/Don't colorize the result type in the test result.\n\n --repeat [n]\n Run the tests multiple times in the same process and check the\n output of the last execution (CLI SAPI only).\n\n --bless Bless failed tests using scripts/dev/bless_tests.php.\n\nHELP;\n}", "function run()\n\t{\n\t\t$arguments = array();\n\n\t\tif ($this->_options['help']) {\n\t\t\t$this->_doHelp();\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->_options['testdox']) {\n\t\t\t$arguments['printer'] = new PHPUnit_Util_TestDox_ResultPrinter_Text;\n\t\t}\n\n\t\tif ($this->_options['group']) {\n\t\t\t$arguments['groups'] = explode( ',', $this->_options['group'] );\n\t\t}\n\n\t\tif ($this->_options['exclude-group']) {\n\t\t\t$arguments['excludeGroups'] = explode( ',', $this->_options['exclude-group'] );\n\t\t}\n\n\t\t/*\n\t\t * Find all the matching files\n\t\t */\n\t\tif ($this->_startDir) {\n\t\t\t$dir = $this->_startDir;\n\t\t} else {\n\t\t\t$dir = '';\n\t\t}\n\t\tif ($this->_options['debug']) {\n\t\t\techo 'Discovering files in ' . $this->_startDir . self::$eol;\n\t\t}\n\t\t$testFiles = array();\n\t\t$this->_dirWalk($testFiles, '');\n\t\tif ($this->_options['debug']) {\n\t\t\techo 'Running ' . count($testFiles) . ' test files:' . self::$eol;\n\t\t\tforeach ($testFiles as $fid) {\n\t\t\t\techo $fid . self::$eol;\n\t\t\t}\n\t\t}\n\t\t$suite = new PHPUnit_Framework_TestSuite();\n\t\t$suite->addTestFiles($testFiles);\n\t\t// This will change when we have more than CLI support\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite, $arguments);\n\t}", "function run() {\n echo $this->name . \" runs like crazy. Him fast<br>\";\n }", "public function run()\n {\n try {\n echo $this->_fgColor('bold_green', \"\\nStarting routine.\");\n if ($this->_lock) {\n $this->_lock();\n }\n $this->_time();\n if (!$this->{$this->_cmdOptions->command_name}()) {\n echo $this->_fgColor('bold_red', \"\\nAborted.\");\n }\n $this->_report['Method'] = $this->_cmdOptions->command_name;\n $this->_report['Script Time'] = $this->_time(true);\n if ($this->_lock) {\n $this->_unlock();\n }\n\n // Write report\n if ($this->_output) {\n\n // &$output, so new values are being added by exec()\n foreach ($this->_output as $v) {\n if ($v) {\n if (preg_match('/(error|fatal)/i', $v)) {\n $this->_log->addError($v);\n } else if (preg_match('/(warning|consejo)/i', $v)) {\n $this->_log->addWarning($v);\n } else {\n $this->_log->addInfo($v);\n }\n }\n }\n echo $this->_fgColor('purple', \"\\nCheck {$this->_baseDir}/log/report-\" . date('Y-m-d')\n . '.log for details.');\n }\n\n // Display tasks log to stdout\n $this->_showReport();\n\n echo $this->_fgColor('bold_green', \"\\n\\nAll done.\\n\");\n } catch (Exception $e) {\n echo $this->_fgColor('bold_red', \"\\nUn uknown error occurred. Details:\\n\");\n echo \"{$e}\";\n echo $this->_fgColor('bold_red', \"\\nAborted.\\n\");\n }\n }", "public function runTests() {\n $results = \"\";\n for ($i = 0; $i < sizeof($this->tests); $i++) {\n $results .= \"Test \" . ($i + 1) . \": \" . $this->tests[$i]->runTest() . \"<br>\";\n }\n return $results;\n }", "public function testCommandWithNoPath(): void\n {\n $process = $this->phpbench('run');\n $this->assertExitCode(1, $process);\n $this->assertStringContainsString('You must either specify', $process->getErrorOutput());\n }", "function testAll() {\n tiny_test();\n uploadResume_test();\n sendResume_test();\n //incomingSMS_valid_test();\n //incomingSMS_invalid_test();\n //sms_test();\n print(\"\\n\");\n }", "private function runTests(){\n $process = new Process(['./vendor/bin/phpunit --filter '.$this->params['model_name'].'Test']);\n $process->start();\n foreach($process as $type => $data){\n if($process::OUT !== $type){\n $this->error($data);\n continue;\n }\n $this->info($data);\n }\n }", "public static function run() {\n\t\t$dispatcher = new HHVMTestSuiteDispatcher();\n\t\t$dispatcher->dispatch();\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function run()\n\t{\n\t\t$this->cli->clearScreen();\n\n\t\t$this->welcome();\n\n\t\twhile(true)\n\t\t{\n\t\t\tif($this->readline)\n\t\t\t{\n\t\t\t\t$__input = readline('<< ');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfwrite(STDOUT, '<< ');\n\n\t\t\t\t$__input = fgets(STDIN);\n\t\t\t}\n\n\t\t\t$__input = rtrim(trim($__input), ';');\n\n\t\t\tif(empty($__input))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(in_array($__input, array('exit', 'quit')))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($this->readline)\n\t\t\t{\n\t\t\t\treadline_add_history($__input);\n\t\t\t}\n\n\t\t\tif($this->isImmediate($__input))\n\t\t\t{\n\t\t\t\t$__input = 'return (' . $__input . ')';\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$__return = eval('unset($__input); ' . $__input . ';');\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\t$this->cli->stderr('>> ' . $e->getMessage());\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(ob_get_length() == 0)\n\t\t\t{\n\t\t\t\tif(is_bool($__return))\n\t\t\t\t{\n\t\t\t\t\t$this->output(($__return ? 'true' : 'false'));\n\t\t\t\t}\n\t\t\t\telseif(is_string($__return))\n\t\t\t\t{\n\t\t\t\t\t$this->output('\\'' . addcslashes($__return, \"\\0..\\37\\177..\\377\") . '\\'');\n\t\t\t\t}\n\t\t\t\telseif(!is_null($__return))\n\t\t\t\t{\n\t\t\t\t\t$this->output(var_export($__return, true));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset($__return);\n\n\t\t\t$__output = ob_get_contents();\n\n\t\t\tob_end_clean();\n\n\t\t\tif((strlen($__output) > 0))\n\t\t\t{\n\t\t\t\t$this->output($__output);\n\t\t\t}\n\n\t\t\tunset($__output);\n\t\t}\n\n\t\t$this->cli->stdout(PHP_EOL . 'Goodbye!');\n\t}", "public abstract function Main();", "public function testExec()\n {\n exec('java -jar ' . escapeshellarg($this->jar) . ' 2>&1', $stdErrLines, $exitCode);\n $stdErr = implode(PHP_EOL, $stdErrLines);\n\n $this->assertEquals(1, $exitCode, 'exit code');\n $this->assertRegExp('/^Usage: java pdfbox-app-x.y.z.jar <command> <args..>$/mi', $stdErr, 'PdfBox output');\n }", "public static function main()\n\t{\n\t\trequire_once \"PHPUnit/TextUI/TestRunner.php\";\n\n\t\t$suite = new PHPUnit_Framework_TestSuite(\"RelationsTest\");\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "public static function run()\n\t{\n\t\tstatic::help();\n\t}", "public static function main() {\n require_once \"PHPUnit/TextUI/TestRunner.php\";\n\n $suite = new PHPUnit_Framework_TestSuite(\"USVN_FilesAccesRightsTest\");\n $result = PHPUnit_TextUI_TestRunner::run($suite);\n }", "public function main()\r\n {\r\n \r\n }", "public function actionTest()\n {\n try {\n dump(TestClient::getInstance()->predict(39.9223757639, 116.4221191406));\n } catch (\\Exception $e) {\n dump($e->getMessage());\n }\n }", "public static function main()\n {\n $suite = new TestSuite(\"Zend_Dom_QueryTest\");\n $result = (new resources_Runner())->run($suite);\n }", "public function run(): int\n {\n $className = $this->console->writeLine('Stubbles ConsoleAppCreator')\n ->writeLine(' (c) 2012-2016 Stubbles Development Group')\n ->writeEmptyLine()\n ->prompt('Please enter the full qualified class name for the console app: ')\n ->withFilter(ClassNameFilter::instance());\n if (null === $className) {\n $this->console->writeLine('The entered class name is not a valid class name');\n return -10;\n }\n\n $this->classFile->create($className);\n $this->scriptFile->create($className);\n $this->testFile->create($className);\n return 0;\n }", "private function do_judge() {\n\t\t$status = $this->prepare_and_compile();\n\t\tif ($status != 0) return $status;\n\t\t$status = $this->prepare_testset();\n\t\tif ($status != 0) return $status;\n\t\t$status = $this->run_testcases();\n\t\treturn $status;\n\t}", "public function run(): void {\n $commandLineOptions = $this->mCommandLineOptions->readCommandLineOptions();\n $optionsAreValid = $this->mCommandLineOptions->validateOptions($commandLineOptions);\n if($optionsAreValid) {\n $filePath = $this->mCommandLineOptions->getFilename();\n $this->mEBNFReader->parseFile($filePath);\n $foodItemsFound = $this->mVendors->findFoodItems($commandLineOptions);\n $this->outputFoodItemsFound($foodItemsFound);\n } else {\n Logger::out('Options input were invalid.');\n Logger::outputHelpText();\n }\n }", "public abstract function exec();", "public function run()\n {\n $this->console->setAutoExit(false);\n\n return $this->console->run(new ArgvInput());\n }", "public static function main()\n {\n require_once \"PHPUnit/TextUI/TestRunner.php\";\n\n $suite = new PHPUnit_Framework_TestSuite(\"Zend_View_Helper_HtmlFlashTest\");\n PHPUnit_TextUI_TestRunner::run($suite);\n }", "public function main();", "public function run() {\n\t\t$this->checkForHelp();\n\n\t\ttry {\n\t\t\t$this->getAndRunTasks();\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\t$this->printException($e);\n\t\t}\n\t}", "public function testConsole()\n {\n static::bootKernel();\n\n $output = new BufferedOutput();\n $application = new Application(static::$kernel);\n $application->setAutoExit(false);\n $exitCode = $application->run(new StringInput(''), $output);\n\n $outputText = $output->fetch();\n\n $this->assertEquals(0, $exitCode, $outputText);\n\n // do not fix the number of commands to be flexible when new commands get added\n // the point of this test is to see that commands are loaded and show up in the console\n $this->assertTrue(substr_count($outputText, ' rokka:') > 20, substr($outputText, 0, 2000).\"...\\n\\n\");\n }", "public static function main() {\n require_once 'PHPUnit/TextUI/TestRunner.php';\n\n $suite = new PHPUnit_Framework_TestSuite('MyClassTest');\n $result = PHPUnit_TextUI_TestRunner::run($suite);\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 }", "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}", "function actual($name,$ip,$user,$pwd){\n\t $command = escapeshellcmd('sudo -u root nohup /usr/bin/python /var/www/html/hids/python/programme.py '.$name.' '.$ip.' '.$user.' '.$pwd.' &');\n\t passthru($command);\n\t //$output = exec($command);\n\t $output = true;\n if($output!=null){\n //echo $output;\n }else{\n echo \"erreur sur l'actualisation des erreurs.\";\n }\n }", "public function testHelpOutput() {\n\t\t$ssPak = new SSPak(null);\n\n\t\t// Internal call\n\t\tob_start();\n\t\t$ssPak->help(array());\n\t\t$helpText = ob_get_contents();\n\t\tob_end_clean();\n\n\t\t// Call to binary\n\t\t$this->assertEquals($helpText, `build/sspak.phar help &> /dev/stdout`);\n\t}", "public function run(): int\n {\n echo 'Webunit v' . self::WEBUNIT_VERSION . PHP_EOL;\n\n $parseContext = new ParseContext();\n if (!$this->parseCommandLineParameters($this->commandLineParameters, $parseContext, $testfilePath, $error)) {\n self::fail($error);\n echo 'Usage: webunit [options] testfile' . PHP_EOL;\n\n return self::RESULT_PARAMETER_ERROR;\n }\n\n $content = $this->tryReadContent($testfilePath);\n if ($content === null) {\n return self::RESULT_READ_TEST_FILE_ERROR;\n }\n\n $parser = new Parser();\n $parseResult = $parser->parse($testfilePath, $content, $parseContext);\n if (!$parseResult->isSuccess()) {\n foreach ($parseResult->getParseErrors() as $parseError) {\n echo $parseError . PHP_EOL;\n }\n\n self::fail('Parsing failed.');\n\n return self::RESULT_PARSE_TEST_FILE_ERROR;\n }\n\n $testSuite = $parseResult->getTestSuite();\n if (count($testSuite->getTestCases()) === 0) {\n self::warn('No tests found.');\n\n return self::RESULT_NO_TESTS_FOUND;\n }\n\n $currentProgressBarLength = 0;\n $showProgressBarFunction = function (AssertResultInterface $assertResult) use (&$currentProgressBarLength): void {\n if ($currentProgressBarLength === self::PROGRESS_BAR_MAX_LENGTH_PER_LINE) {\n echo PHP_EOL;\n $currentProgressBarLength = 0;\n }\n\n echo $assertResult->isSuccess() ? '.' : \"\\033[41m\\033[1;37mF\\033[0m\";\n $currentProgressBarLength++;\n };\n\n $testResults = $testSuite->run($this->httpClient, $showProgressBarFunction);\n echo PHP_EOL;\n\n $this->printReport($testResults);\n\n return $testResults->isSuccess() ? self::RESULT_OK : self::RESULT_TESTS_FAILED;\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 }", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function showResults()\n {\n $tracker = Tracker::getInstance();\n\n $tracker->outputStats();\n if (count($tracker->getFailures())) {\n $tracker->output(\"\\nFAILURES\\n\", null, null, true);\n $tracker->outputFailures();\n }\n\n if (count($tracker->getErrors())) {\n $tracker->output(\"\\nERRORS\\n\");\n $tracker->outputErrors();\n }\n\n $tracker->output(\"\\n\");\n\n if (count($tracker->getFailures())) {\n return;\n }\n\n if ($this->coverageDirectory()) {\n $tracker->output('Generating coverage report as html...' . \"\\n\");\n $this->_generateCoverageHtml();\n return $tracker->output('Done' . \"\\n\");\n }\n\n if ($this->showCoverage()) {\n $this->_generateCoverageCommandLine();\n return;\n }\n }" ]
[ "0.6622198", "0.64429367", "0.64374435", "0.64324236", "0.63996875", "0.6388307", "0.6387756", "0.63232356", "0.62800866", "0.6198522", "0.6187246", "0.6143965", "0.6138922", "0.6130047", "0.61214525", "0.609882", "0.6098816", "0.6098087", "0.60899806", "0.608206", "0.6032243", "0.59996176", "0.59878725", "0.59840786", "0.5978906", "0.5977116", "0.5977116", "0.5977116", "0.5969518", "0.59527576", "0.59435946", "0.5938447", "0.5936754", "0.5931452", "0.5913385", "0.5913041", "0.59009814", "0.5879873", "0.5879873", "0.5879873", "0.5879873", "0.5879873", "0.5879873", "0.58765596", "0.58405757", "0.5833094", "0.5825692", "0.58235866", "0.58223265", "0.58180714", "0.5813335", "0.58082306", "0.5805682", "0.58053863", "0.579843", "0.57939917", "0.5792844", "0.57893115", "0.5786532", "0.5770498", "0.5757505", "0.5754093", "0.57539093", "0.5753732", "0.5750654", "0.5744422", "0.5743072", "0.57389295", "0.57352823", "0.57349753", "0.57308424", "0.5727606", "0.5718641", "0.5715626", "0.57096547", "0.5706968", "0.56917095", "0.5689659", "0.5678618", "0.5675832", "0.5670918", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.5663359", "0.56622165" ]
0.0
-1
Function to get the prime no in given range
function getprime($range) { //array to store prime no $prime = []; //variacle to set index $count = 0; for ($i = 2; $i < $range; $i++) { if (Utility::isprime($i)) { $prime[$count++] = $i; } } return $prime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Prime($n)\n{\n for($i=2; $i<$n; $i++)\n {\n if($n %$i ==0)\n\t {\n\t\t return 0;\n\t\t }\n }\n return 1;\n }", "function nprimo($n)\n {\n $primo=true;\n \n $i=2;\n while (($i< $n) & ($primo)){\n \n if($n%$i==0) {\n $primo=false;\n }\n $i++;\n }\n return $primo;\n }", "function primeCheck($number){ \n if ($number == 1) \n return 0; \n for ($i = 2; $i <= $number/2; $i++){ \n if ($number % $i == 0) \n return 0; \n } \n return 1; \n}", "function checkprime($x){\n \n $sqrt = sqrt($x);\n $counter = 2;\n \n while ($counter <= $sqrt){\n if ($x % $counter == 0){\n break;\n }\n else{\n $counter++;\n }\n }\n if ($x % $counter != 0){\n return $x;\n }\n}", "function primo($num) {\n if ($num == 2 || $num == 3 || $num == 5 || $num == 7) {\n return True;\n } else {\n if ($num % 2 != 0) {\n for ($i = 3; $i <= sqrt($num); $i += 2) {\n if ($num % $i == 0) {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n }", "function isPrime($n) { \n for($x=2; $x < ($n-1); $x++) { \n //echo \"Mod :\".($n%$x);\n if($n%$x == 0) { return \"$n is Prime Number..</br>\"; } \n } \n return \"$n is not a Prime Number..</br>\"; \n}", "function _primeNumber($num)\n{\n if ($num <= 1) return false;\n if ($num % 2 === 0 && $num > 2) return false;\n $n = floor(sqrt($num));\n for ($i = 3; $i <= $n; $i++) {\n if ($num % $i === 0) {\n return false;\n }\n }\n echo \"{$num} is prime number\";\n}", "function pick_prime() {\r\n\t\t$primes = array(13,17,23,29,43,57,71);\r\n\t\t$i = rand(0,6);\r\n\t\t$j = $primes[$i];\r\n\t\treturn($j);\r\n\t}", "function check_if_prime($num){\n if($num == 1){\n return FALSE;\n }\n elseif($num == 2){\n return TRUE;\n }\n elseif($num == 3){\n return TRUE;\n }\n elseif($num % 2 == 0){\n return FALSE;\n }\n $counter = 0;\n for($i = 2; $i < $num; $i++){\n if ($num % $i == 0){\n return FALSE;\n }\n }\n return TRUE;\n }", "function primeCheck($number){\n\t\t\tif ($number == 1)\n\t\t\treturn 0;\n\n\t\t\tfor ($i = 2; $i <= $number/2; $i++){\n\t\t\t\tif ($number % $i == 0)\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn 1;\n\t\t}", "function getPrimes($n) {\n return array_keys(\n array_filter(sieveOfEratosthenes($n), function ($p) {\n return (! $p);\n })\n );\n}", "function checkPrime() {\n for ($i = 2; $i < 100; $i++) {\n $primeTrue = true;\n for ($j = 2; $j <= sqrt($i); $j++) {\n if ($i % $j === 0) {\n $primeTrue = false;\n }\n }\n if ($primeTrue) {\n echo $i.' ';\n }\n }\n}", "function range_met($n)\n{\n if ($n >= 1 && $n <= 100) {\n return TRUE;\n }\n return FALSE;\n}", "function sieveOfEratosthenesGenerator($maxNumber)\n{\n $serie = array_fill(0, $maxNumber, true);\n for ($i = 0; $i <= sqrt($maxNumber); $i++) {\n if ($i >= 2 && $serie[$i]) {\n for ($j = pow($i, 2); $j <= $maxNumber; $j += $i) {\n $serie[$j] = false;\n }\n } else {\n $serie[$i] = false;\n }\n }\n return array_keys(array_filter($serie));\n}", "function isPrime($n){\n if($n % 2 == 0 || $n == 1){\n return false;\n }\n for($i = 3; $i <= ceil($n/$i); $i += 2){\n if($n % $i == 0){\n return false;\n }\n }\n return true;\n}", "function prime_function($input){\n if(!(is_int($input))){\n throw new Exception('Invalid input! Must be a positive integer');\n }\n elseif($input < 0){\n throw new Exception('Invalid input! Must be a positive integer')\n }\n $primeNums = array();\n for($i = 1; $i <= $input; $i++){\n if(check_if_prime($i) == TRUE){\n array_push($primeNums, $i); //if number is prime, push to array\n }\n }\n\n echo implode(\", \", $primeNums); // Removes the last \",\" from the array, better for printing\n echo(\"\\n\"); // line break\n }", "function getPrime(array $numbers) : array {\n\n foreach ($numbers as $number) {\n // Prime est de base vrai\n $prime = true;\n for($i=2; $i < $number; $i++){\n // Si à un moment $number peut etre divisé par $i, alors ce n'est pas un nombre premier\n if($number % $i == 0){\n // On passe $prime à false et on arrete la boucle for\n $prime = false;\n break;\n }\n }\n\n if($prime){\n $primes[] = $number;\n }\n\n }\n return $primes;\n}", "public function getPrimeNumber()\n {\n if (isset($_GET['year']) && $this->validate($_GET['year'])) {\n echo json_encode(new PrimeNumber($_GET['year']));\n } else {\n echo json_encode([\n 'message' => 'Input year between 1000 and 9999'\n ]);\n };\n }", "public static function prime_num($num)\n {\n for($i =2; $i<=($num/2); $i++)\n {\n if($num % $i ==0)\n {\n return true;\n } \n }\n return false;\n\n }", "public function getPrimeNumbers($limit)\n {\n // start with the pointer at 2, the first prime\n $pointer = 2;\n\n // store all integers from 2 to the limit\n // save them in the keys so we can use the value for marked\n $integers = array_flip(range($pointer, $limit));\n\n // go through all integers between here and the limit\n foreach ($integers as $integer => $notPrime) {\n // mark all multiples of the pointer between here and the limit\n for ($i = $pointer; $pointer * $i <= $limit; $i++) {\n $integers[$pointer * $i] = 'notPrime';\n }\n\n // go to the next unmarked value greater than p\n foreach ($integers as $key => $value) {\n if ($key > $pointer && $value != 'notPrime') {\n $pointer = $key;\n break;\n }\n }\n }\n\n // if p is at the limit, return the unmarked numbers in an array\n return array_keys(\n array_filter(\n $integers,\n function ($value) {\n return $value !== 'notPrime';\n }\n )\n );\n }", "function isPrime ($n) {\n if ($n % 2 == 0) return false; //Check if is divisible by 2\n for ($i = 3; $i <= $n/2; $i += 2) { //Check only odd numbers\n if ($n % $i == 0) return false;\n }\n return true;\n}", "public function getPrimeNumbers()\n {\n $this->action = isset($_GET['action']) ? $_GET['action'] : '';\n $this->limit = isset($_GET['limit']) ? $_GET['limit'] : 1000;\n $primeNumber = 2;\n $primeNumbers = array();\n $primeNumbers[] = $primeNumber;\n if ($this->limit == 1) {\n return $primeNumbers;\n }\n $primeNumber += 1;\n $primeNumbers[] = $primeNumber;\n // Generate array of prime numbers until we reach the limitation (defined in variale 'limit')\n while (count($primeNumbers) < $this->limit) {\n $primeNumber += 2;\n $flag = true;\n $sqrtPrimeNumber = sqrt($primeNumber);\n foreach ($primeNumbers as $p) {\n if ($p > $sqrtPrimeNumber) {\n break;\n }\n if ($primeNumber % $p == 0) {\n $flag = false;\n break;\n }\n }\n if ($flag) {\n $primeNumbers[] = $primeNumber;\n }\n }\n return $primeNumbers;\n }", "public function prime()\n {\n return $this->primeSalaire() + $this->primeAnciennete(); // on retourne le montant de la prime annuelle\n }", "function isPrime($number) {\n for ($i=2;$i<$number;$i++) {\n if (!($number % $i)) {\n return false;\n }\n }\n return true;\n}", "public function getLovelyNumbers($start, $end){\n $repeated = 0; $remove_me = 0;\n if($end<$start){ return 'Action can not be completed : End number should be greater'; }\n for ($i = $start ; $i <= $end; $i++) \n { \n $repeated++;\n $crnt_number = $i; \n $history = array(); \n while($crnt_number) \n { \n if(isset($history[$crnt_number%10])){\n $ct = $crnt_number%10;\n if($ct/10==0) { \n $history[$crnt_number%10] = ($history[$crnt_number%10])+1;\n }\n if($history[$crnt_number%10]==3){ $remove_me++; break; }\n }\n else{\n $history[$crnt_number%10] = 1;\n }\n $crnt_number = (int)$crnt_number / 10; \n }\n }\n $selected_no = $repeated - $remove_me;\n return $selected_no; \n }", "static function prime1000()\n {\n $prime = array();\n $s = 0;\n for ($i = 0; $i < 1000; $i++) {\n if (Utility::isPrime($i)) {\n $prime[$s++] = $i;\n }\n }\n return $prime;\n }", "static function isPrime($n) {\n throw new Error(\"Not Implemented\");\n }", "function isPrimeNumber($n) {\n if ($n < 2) {\n return false;\n }\n // check so nguyen to khi n >= 2\n $squareRoot = sqrt ( $n );\n for($i = 2; $i <= $squareRoot; $i ++) {\n if ($n % $i == 0) {\n return false;\n }\n }\n return true;\n }", "function calEventNum(int $num){\n\n $result = 0 ;\n\n for ($i=1 ,$ii = $num ; $i <= $ii ; $i++){\n if ($i%2 == 0){\n $result++;\n }\n }\n return $result;\n}", "function larFactor($number){\n // prime numbers\". So, 2*2*3 = 12; {2,3} are prime numbers.\n // A prime number is a number that can be divided only by one or itself.\n // \n // We're looking for the larges prime factor of a number. In our example, the answer is:3 \n // \n // Our algorithm? \n // \n // When should it stop? : When the product of the numbers is greater or equal to the passed\n // number.\n // \n // 2*2*2*2 = 16 {2} is the largest prime number.\n // 3*5 = 15, {5} is the largest prime number. \n // \n $count = 2; //Smallest primer number\n while($count*$count <= $number){\n \tif($number%$count==0){\n \t\t$number=$number/$count;\n \t}else{\n \t\t$count++;\n \t}\n }\n return $number;\n\n}", "function GetPrimes($maximum, &$primes)\n{\n // Clear the input array in case there is existing data\n $primes = array();\n\n // There are no primes less than 2\n if ($maximum < 2) {\n return;\n }\n\n // Construct and execute the Sieve\n $sqrtMaximum = (int)(sqrt((double)$maximum));\n $primeTracker = array_fill(0, $maximum, true);\n\n for ($i = 2; $i < $sqrtMaximum; $i++) {\n if ($primeTracker[$i] == false) {\n continue;\n }\n\n for ($j = $i + $i; $j < $maximum; $j += $i) {\n $primeTracker[$j] = false;\n }\n }\n\n // Generate the list of primes to return\n for ($k = 2; $k < $maximum; $k++) {\n if ($primeTracker[$k] == true) {\n array_push($primes, $k);\n }\n }\n}", "final public function get_primes($n)\n {\n if ($n == 0) {\n return 0;\n }\n $result = array();\n $i = 2;\n do {\n if ($this->is_prime($i)) {\n $result[] = $i;\n $n--;\n }\n $i++;\n } while ($n > 0);\n return $result;\n }", "function sed_gera_numero( $min, $max, $exclude_numbers = array() ) {\n\n\tsort( $exclude_numbers );\n\n if ( $max - count( $exclude_numbers ) < $min ) {\n return false;\n }\n\n // $pos is the position that the random number will take\n // of all allowed positions\n $pos = mt_rand( 0, $max - $min - count( $exclude_numbers ) );\n\n // $num being the random number\n $num = $min;\n\n // while $pos > 0, step to the next position\n // and decrease if the next position is available\n for ( $i = 0; $i < count( $exclude_numbers ); $i += 1 ) {\n\n // if $num is on an excluded position, skip it\n if ( $num == $exclude_numbers[ $i ] ) {\n $num += 1;\n continue;\n }\n\n $dif = $exclude_numbers[ $i ] - $num;\n\n // if the position is after the next excluded number,\n // go to the next excluded number\n if ( $pos >= $dif ) {\n $num += $dif;\n\n // -1 because we're now at an excluded position\n $pos -= $dif - 1;\n } else {\n // otherwise, return the free position\n return $num + $pos;\n }\n }\n\n // return the number plus the open positions we still had to go\n return $num + $pos;\n}", "function page_range($pps,$tot_page,$sel_page){\r\n\t$min=null;\r\n\t$max=null;\r\n\r\n\tif($tot_page<=($pps*2)+1){\r\n\t\t$min=1;\r\n\t\t$max=$tot_page;\r\n\t}\r\n\telseif(($pps+$sel_page)>$tot_page){\r\n\t\t$max=$tot_page;\r\n\t\t$min=$sel_page-((($pps+$sel_page)-$tot_page)+$pps);\r\n\t}\r\n\telseif($sel_page-$pps<1){\r\n\t\t$min=1;\r\n\t\t$max=($pps-($sel_page-1))+$sel_page+$pps;\r\n\t}\r\n\telse{\r\n\t\t$min=$sel_page-$pps;\r\n\t\t$max=$sel_page+$pps;\r\n\t}\r\n\r\n\treturn array($min,$max);\r\n}", "function oddRange($min, $max)\n{\n $range = [];\n while ($min <= $max) {\n if ($min % 2 == 1) {\n $range[] = $min;\n }\n $min += 1;\n }\n return $range;\n}", "function solution($input)\n {\n $result = 1;\n\n $divisors_desc = array();\n $divisors_asc = array();\n $divisor_limit = $input;\n\n for($i = 2; $i < $divisor_limit; $i++){\n if($input % $i == 0){\n $divisor_limit = $input/$i;\n $divisors_desc[] = $divisor_limit;\n $divisors_asc[] = $i;\n }\n }\n //complexity O(n)\n \n $divisors = array_merge($divisors_desc,array_reverse($divisors_asc));\n print_r($divisors);\n\n //if no divisors exist, the number itself is prime\n if(count($divisors)==0){\n $result = $input;\n }\n\n //finding prime number in divisors list\n //starting from highest\n for($d = 0; $d < count($divisors); $d++)\n {\n $isPrime = true;\n $divisor_limit = $divisors[$d];\n\n //if any divisor is found, number is not prime\n for($x = 2; $x<$divisor_limit;$x++)\n {\n if($divisors[$d] % $x == 0){\n $isPrime = false;\n print_r($divisors[$d]. \"is not prime\\n divisor \". $x. \"\\n\");\n break;\n }\n }\n\n if($isPrime){\n $result = $divisors[$d];\n break;\n }\n }\n\n $solution = array();\n $solution['complexity'] = \"O(n2)\";\n $solution['result'] = $result;\n\n return $solution;\n }", "function numberRange($start, $end)\n{\n $number_range = range($start, $end);\n\n return $number_range;\n}", "function prime($x)\n{\n\tif ($x % 2 != 0) {\n\t\techo 'It is not a prime number';\n\t} else {\n\t\techo 'It is a prime number';\n\t}\n}", "function prime_factors($n) {\n\tglobal $primes_array;\n\t$reduced_primes_array = array();\n\n\tforeach ($primes_array as $p) {\n\t\tif ($p <= $n/2) {\n\t\t\tarray_push($reduced_primes_array, $p);\n\t\t}\n\t}\t\n\t//print \"Reduced primes <= $n:\\n\";\n\t//print_r($reduced_primes_array);\t// OK\n\t\n\t$pfactors = array();\n\n\tforeach ($reduced_primes_array as $p) {\n\t\tif ($p == 0) continue;\n\t\twhile ($n % $p == 0) {\t\t// prime factors of this value remain\n\t\t\tarray_push($pfactors, $p);\n\t\t\t$n = $n / $p;\t\t// this way won't catch multiple 2's etc\n\t\t\t// loop should end when this factor is exhausted\n\t\t}\n\t}\n\t\n\t// Case where n itself is prime:\n\tif (empty($pfactors)) {\n\t\tarray_push($pfactors, $n);\n\t}\n\n\treturn $pfactors;\t// OK\n}", "function isPrime($num){\n\t// Source: http://icdif.com/computing/2011/09/15/check-number-prime-number/\n\n\t// by defenition, 1 is not prime\n\tif($num == 1)\n\t\treturn false;\n\n\t// 2 is the only even number that is prime\n\tif($num == 2)\n\t\treturn true;\n\n\t/* \n\t * if a number is divisible by 2, it's not prime, so there is no need \n\t * to check other even numbers\n\t */\n\tif ($num % 2 == 0)\n\t\treturn false;\n\n\t/*\n\t * this will check if the number is divisible by an odd number,\n\t * (that's why i is incremented by 2 each cycle, so that the sequence\n\t * 3,5,7,9,11... is achieved)\n\t */\n\tfor ($i = 3; $i < ceil(sqrt($num)); $i += 2)\n\t\tif ($num % $i == 0)\n\t\t\treturn false;\n\t\n\treturn true;\n}", "public static function isPrime($number){\n \n $count = 0;\n for($j=1;$j<=$number;$j++){\n if($number%$j==0){\n $count++;\n }\n }\n if($count==2){\n return true;\n }else{\n return false;\n }\n \n }", "function tester_function(){\n echo(\"Output for parameter = 10: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(10);\n echo(\"<br>\");\n\n echo(\"Output for parameter = 0: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(0);\n echo(\"<br>\");\n\n echo(\"Output for parameter = 100: \");\n echo(\"<br>\");\n echo(\"\\n\"); // Used for when running on terminal\n prime_function(100);\n echo(\"<br>\");\n\n /*\n Checking the outputs for nums 1 - 99\n */\n /*for($i = 0; $i < 100; $i++){\n echo($i);\n echo(\": \");\n prime_function($i);\n\n }*/\n //prime_function(\"12\"); // Checking to see if it works when number is written as a string\n }", "function sieveOfEratosthenes($n) {\n $sieve = array_fill(2, $n - 1, false);\n\n for ($p = 2; $p * $p <= $n; $p ++) {\n if (! $sieve[ $p ]) {\n for ($i = $p * $p; $i <= $n; $i += $p)\n $sieve[ $i ] = $p;\n }\n }\n\n return $sieve;\n}", "function RSA($p, $q, $e)\r\n {\r\n\t\tglobal $count;\r\n\t\tglobal $tried;\r\n\r\n\t\tglobal $nmin;\r\n\t\tglobal $nmax;\r\n\t\tglobal $dmin;\r\n\t\tglobal $dmax;\r\n\t\tglobal $emin;\r\n\t\tglobal $emax;\r\n\r\n\t\t$tried++;\r\n\r\n // Need this to make the primes array within the RSA function scope.\r\n global $primes;\r\n\r\n $n=-1; $d=-1; //$e=-1;\r\n\r\n $n = $p * $q;\r\n $phi = ($p-1) * ($q-1);\r\n/*\r\n // Pick e. Best if it's a prime since then only need to check if\r\n // it divides phi. It must be 1 < e < phi\r\n do\r\n {\r\n// $e = $primes[rand(30, 40)];\r\n// $e = $primes[rand(200, 500)];\r\n $e = $primes[rand(172, 563)];\t// 172 <= [e] <= 563 keeps 1024 < e < 4096 (12 bits)\r\n if ($e % $phi == 0 || $e >= $phi)\r\n echo \"HERE!!!\";\r\n } while ($e % $phi == 0 || $e >= $phi);\r\n*/\r\n // Find d such the de % phi = 1\r\n for ($d=1; $d<$phi; $d++)\r\n {\r\n if (($d * $e) % $phi == 1)\r\n break;\r\n }\r\n\r\n\t\tif ($d == $phi)\r\n\t\t\treturn FALSE;\r\n\r\n\t\tif (\r\n\t\t\t16384 <= $n && $n < 65536 && \r\n\t\t\t 1024 <= $d && $d < 4096)\r\n\t\t{\r\n\t\t\tif ($n < $nmin)\r\n\t\t\t\t$nmin = $n;\r\n\t\t\tif ($n > $nmax)\r\n\t\t\t\t$nmax = $n;\r\n\t\t\tif ($d < $dmin)\r\n\t\t\t\t$dmin = $d;\r\n\t\t\tif ($d > $dmax)\r\n\t\t\t\t$dmax = $d;\r\n\t\t\tif ($e < $emin)\r\n\t\t\t\t$emin = $e;\r\n\t\t\tif ($e > $emax)\r\n\t\t\t\t$emax = $e;\r\n\r\n\t\t\techo \"<tr>\";\r\n\t\t\techo \"<td align='right'>\" . ++$count . \"</td>\";\r\n\t\t\techo \"<td align='right'>\" . $p . \"</td>\";\r\n\t\t\techo \"<td align='right'>\" . $q . \"</td>\";\r\n\t\t\techo \"<td align='right'>\" . $phi . \"</td>\";\r\n\t\t\techo \"<td align='right'>\" . $n . \"</td>\";\r\n\t\t\techo \"<td align='right'>\" . $d . \"</td>\";\r\n\t\t\techo \"<td align='right'>\" . $e . \"</td>\";\r\n\t\t\techo \"</tr>\";\r\n\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\r\n return FALSE;\r\n }", "function isPrime($num)\n{\n if ($num == 1) {\n return false;\n }\n\n // 2 is prime (the only even number that is prime)\n if ($num == 2) {\n return true;\n }\n\n /**\n * If the number is divisible by two, then it's not prime and it's no longer\n * needed to check other even numbers\n */\n if ($num % 2 == 0) {\n return false;\n }\n\n /**\n * Checks the odd numbers. If any of them is a factor, then it returns false.\n * The sqrt can be an approximation, hence just for the sake of\n * security, one rounds it to the next highest integer value.\n */\n $ceil = ceil(sqrt($num));\n for ($i = 3; $i <= $ceil; $i = $i + 2) {\n if ($num % $i == 0) {\n return false;\n }\n }\n\n return true;\n}", "public static function primeFactor($n)\n {\n echo \"prime factors are : \\n\";\n\n // prime num start from 2\n for ($num = 2; $num <= $n; $num++) {\n $flag = true;\n for ($j = 2; $j <= $num / 2; $j++) {\n\n // it it is divided by zero it's not a prime\n if ($num % $j == 0) {\n $flag = false;\n break;\n }\n }\n if ($flag == true) {\n\n // prime numbers divided by inputs\n while ($n % $num == 0) {\n echo $num . \" \\n\";\n $n = $n / $num;\n }\n\n }\n }\n }", "public static function getDefaultDivisor(): int;", "function get_numpage($nb_actualites, $nbapp){\r\n //definition d'une valeur par defaut\r\n $numpage = 0;\r\n if(isset($_GET['numpage'])){//si une valeur est specifiee\r\n //adaptation de la valeur\r\n $numpage = (int) $_GET['numpage'];\r\n if($nb_actualites <= $numpage * $nbapp){\r\n $numpage = 0;\r\n }\r\n }\r\n return $numpage;\r\n}", "function num_divisors($n) {\n\tif($n % 2 == 0) $n /= 2;\n\t$divisors = 1;\n\t$count = 0;\n\twhile($n % 2 == 0) {\n\t\t$count += 1;\n\t\t$n /= 2;\n\t}\n\n\t$divisors = $divisors * ($count + 1);\n\t$p = 3;\n\twhile($n != 1) {\n\t\t$count = 0;\n\t\twhile($n % $p == 0) {\n\t\t\t$count += 1;\n\t\t\t$n /= $p;\n\t\t}\n\t\t$divisors = $divisors * ($count + 1);\n\t\t$p += 2;\n\t}\n\treturn $divisors;\n\n}", "function isPrime($number)\r\n{\r\n if ( $number == 1 ) {\r\n return false;\r\n }\r\n // 2 is the only even prime number\r\n if ( $number == 2 ) {\r\n return true;\r\n }\r\n // square root algorithm speeds up testing of bigger prime numbers\r\n $x = sqrt($number);\r\n $x = floor($x);\r\n for ( $i = 2 ; $i <= $x ; ++$i ) {\r\n if ( $number % $i == 0 ) {\r\n break;\r\n }\r\n }\r\n \r\n if( $x == $i-1 ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function isPrime($num) \n{ \n //1 is not prime. See: http://en.wikipedia.org/wiki/Prime_number#Primality_of_one\n if($num == 1)\n return false;\n\n //2 is prime (the only even number that is prime)\n if($num == 2)\n return true;\n\n /**\n * if the number is divisible by two, then it's not prime and it's no longer\n * needed to check other even numbers\n */\n if($num % 2 == 0) {\n return false;\n }\n\n /**\n * Checks the odd numbers. If any of them is a factor, then it returns false.\n * The sqrt can be an aproximation, hence just for the sake of\n * security, one rounds it to the next highest integer value.\n */\n for($i = 3; $i <= ceil(sqrt($num)); $i = $i + 2) {\n if($num % $i == 0)\n return false;\n }\n\n return true;\n}", "function getSum($n){\n \n $range =500;\n for($i=0;$i<$n;$i++){\n echo $range--.\" \";\n }\n}", "function findVal($num, $multiple1, $multiple2, $valTrue) {\n\tif ( ((int)$num % $multiple1 == 0) && ((int)$num % $multiple2 == 0) && is_numeric($num) )\n\t{\n\t\treturn $valTrue;\n\t} \n\treturn $num;\n}", "function testInN($num,$n)\n\t{\n\t\tif(!is_numeric($num)) return false;\n\t\tif(!is_numeric($n)) return false;\n\t\tif($num<0) return false;\n\t\tif($n<0) return false;\n\t\t\n\t\tif($num<=$n) return true;\n\t\treturn false;\n\t}", "private function CheckNumber($n){\n\t\tif($n<=0){\n\t\t\treturn false;\n\t\t}else if($n==1 || $n==2){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t$checkFlag = true;\n\t\t\tfor($i=2;$i<=sqrt($n);$i++){\n\t\t\t\tif($n%$i==0){\n\t\t\t\t\t$checkFlag =false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $checkFlag;\n\t\t}\n\n\t}", "function numero($s)\n{\n\t$j=0;\n\t$valor=false;\n\tfor($j=1; $j<10;$j++){\n\t\tif($s==$j){\n\t\t\t$valor=true;\n\t\t}\n\t}\n\treturn $valor;\n}", "public function generatate(int $number = 0)\n {\n $remaining = $number;\n $primes = [];\n\n for ($candidate = 2; $remaining > 1; $candidate++) {\n for (;$remaining % $candidate == 0; $remaining /= $candidate) {\n $primes[] = $candidate;\n }\n }\n\n return $primes;\n }", "public function getPageNumbers();", "function func3($n) {\n for ($k = 0; $n; $n = (int) ($n / 10)) {\n $k = $n * 10;\n if ($k > $n)\n $n = $k;\n }\n return $n;\n}", "function getNumberOfDivisors($n) {\n $factors = 0;\n $i = 1;\n\n while ($i * $i < $n) {\n if ($n % $i === 0) {\n $factors += 2;\n }\n\n $i++;\n }\n\n if ($i * $i === $n) {\n $factors++;\n }\n\n return $factors;\n}", "function paginaValida($numeroPagina){\n global $totalImagenes;\n //si el numero de pagina es mayor que cero y menor que el total de imagenes($totalImagenes) entre(/)\n // la cantidad de imagenes por pagina(MAXIMO)\n if (MAXIMO<=0){die (\"el mmo de p&aacute;gina debe ser mayor que cero\"); exit(); }\n return (($numeroPagina>0) && ($numeroPagina<=ceil(($totalImagenes/MAXIMO)))); \n }", "function isPrimeNumberDescription($number, $isPrime) {\n if($isPrime) {\n echo $number . ' on algarv<br>';\n } else {\n echo $number. 'ei ole algarv<br>';\n }\n}", "function Gen(){\n\t$res=rand(0, 680);\n\tif( $res<50 ){ $n=6; }\n\tif( ($res>=50)&&($res<250) ){ $n=5; }\n\tif( ($res>=250)&&($res<400) ){ $n=4; }\n\tif( ($res>=400)&&($res<500) ){ $n=3; }\n\tif( ($res>=500)&&($res<600) ){ $n=2; }\n\tif($res>=600){ $n=1; }\n\treturn $n;\n}", "function euler_solution_003($product)\n{\n $answer = 1;\n $point = 3;\n $divisor = $product;\n\n while ( 0 == ( $divisor % 2 ) ) {\n $answer = 2;\n $divisor = ( $divisor / 2 );\n }\n\n while ($divisor != 1) {\n while (0 == ($divisor % $point)) {\n $answer = $point;\n $divisor = ($divisor / $point);\n }\n $point += 2;\n }\n return $answer;\n}", "static function factors($n)\n { \n //array to store the prime factors of number \n $arr = array();\n //starting of prime factors\n $i = 2;\n $index = 0;\n //while loop until we get 1 \n while($n != 1)\n {\n //$b is boolean value to check the number is prime or not\n $b = true;\n //for loop to get prime number one by one\n for($j = 2; $j < $i/2; $j++)\n {\n if($i % $j == 0)\n {\n $b = false;\n break;\n }\n }\n //if number is prime then is will check how many time that prime number \n //is deided by n \n if($b)\n {\n while($n % $i == 0)\n {\n $arr[$index++] = $i;\n $n = $n / $i;\n }\n }\n //i++ to get next number which we want to check prime ot not \n $i++;\n }\n \n //forEach to print all prime factors \n foreach($arr as $print)\n {\n echo $print.\"\\n\";\n \n }\n }", "function timUSCLN(int $a, int $b) : int\n\t{\n\t\tif($a == 0 && $b == 0){\n\t\t\treturn 0;\n\t\t} elseif ($a == 0 && $b != 0) {\n\t\t\treturn abs($b);\n\t\t} elseif ($b == 0 && $a !=0 ) {\n\t\t\treturn abs($a);\n\t\t}\n\t\t\n\t\t$usclnn = 1;\n\t\tif($a > $b){\n\t\t\t$max = $a;\n\t\t} else {\n\t\t\t$max = $b;\n\t\t}\n\t\tfor ($i=1;$i<=$max;$i++){\n\t\t\tif($a % $i == 0 && $b % $i == 0){\n\t\t\t\t$usclnn = $i;\n\t\t\t}\n\t\t}\n\t\treturn $usclnn;\n\t}", "function check($ran_num) {\n if ($ran_num < 2) {\n return false;\n }\n // check so nguyen to khi n >= 2\n $squareRoot = sqrt ( $ran_num );\n for($i = 2; $i <= $squareRoot; $i ++) {\n if ($ran_num % $i == 0) {\n return false;\n }\n }\n return true;\n }", "static function powerOfTwo($n)\n { \n if ($n >= 0 && $n < 31) {\n $pow = 2**$n;\n $all = 0; $count = 1;\n while($all != $pow)\n {\n $all = 2** $count;\n echo $all.\"\\n\";\n $count++;\n }\n } else {\n echo \"enter value between 0 to 31\".\"\\n\";\n Utility::powerOfTwo();\n }\n \n }", "function exibeAtualMin(){\n return $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n }", "public function generateRandomInt($min = 0, $max = 9999)\n {\n if (function_exists('random_int')) {\n return random_int($min, $max);\n }\n if ( ! is_int($min)) {\n throw new InvalidParamException('First parameter ($min) must be an integer');\n }\n if ( ! is_int($max)) {\n throw new InvalidParamException('Second parameter ($max) must be an integer');\n }\n if ($min > $max) {\n throw new InvalidParamException('First parameter ($min) must be no greater than second parameter ($max)');\n }\n if ($min === $max) {\n return $min;\n }\n // $range is a PHP float if the expression exceeds PHP_INT_MAX.\n $range = $max - $min + 1;\n if (is_float($range)) {\n $mask = null;\n } else {\n // Make a bit mask of (the next highest power of 2 >= $range) minus one.\n $mask = 1;\n $shift = $range;\n while ($shift > 1) {\n $shift >>= 1;\n $mask = ($mask << 1) | 1;\n }\n }\n $tries = 0;\n do {\n $bytes = Yii::$app->security->generateRandomKey(PHP_INT_SIZE);\n // Convert byte string to a signed int by shifting each byte in.\n $value = 0;\n /** @noinspection ForeachInvariantsInspection */\n for ($pos = 0; $pos < PHP_INT_SIZE; $pos++) {\n $value = ($value << 8) | ord($bytes[$pos]);\n }\n if ($mask === null) {\n // Use all bits in $bytes and check $value against $min and $max instead of $range.\n if ($value >= $min && $value <= $max) {\n return $value;\n }\n } else {\n // Use only enough bits from $bytes to cover the $range.\n $value &= $mask;\n if ($value < $range) {\n return $value + $min;\n }\n }\n $tries++;\n } while ($tries < self::RANDOM_INT_LOOP_LIMIT);\n // Worst case: this is as likely as self::RANDOM_INT_LOOP_LIMIT heads in as many coin tosses.\n throw new Exception('Unable to generate random int after ' . self::RANDOM_INT_LOOP_LIMIT . ' tries');\n }", "function verteilung2($n) {\n return (powInt($n, 7/4));\n}", "public static function ranking($n, $min_val, $max_val, $min_base = 0, $max_base = 10) {\n\t\tif ($max_val - $min_val > 0) {\n\t\t\treturn (int)floor( ($n - $min_val) / ($max_val - $min_val) * ($max_base - $min_base) );\n\t\t}\n\t\treturn 0;\n\t}", "function psuedo_random_number($min, $max) {\n $bytes = openssl_random_pseudo_bytes(4);\n $int = unpack('l', $bytes);\n return $min + abs($int[1] % ($max-$min+1));\n}", "function get_random_numbers($num, $max){\n\t$array = array();\n\twhile($num--){\n\t\tdo {\n\t\t\t$c = rand(1, $max);\n\t\t} while (in_array($c, $array));\n\t\t$array[] = $c;\n\t}\n\treturn $array;\n}", "function minimumNumber($n, $password) {\n $res = 0;\n $check = 0;\n\t$free = 0;\n\n if ($n < 6) {\n $free = 6 - $n;\n }\n\t\n\t$uppercase = preg_match('@[A-Z]@', $password);\n\tif (!$uppercase) {\n\t\t$check++;\n\t}\n\t$lowercase = preg_match('@[a-z]@', $password);\n\tif (!$lowercase) {\n\t\t$check++;\n\t}\n\t$number = preg_match('@[0-9]@', $password);\n\tif (!$number) {\n\t\t$check++;\n\t}\n\t$speciaux = preg_match('#^(?=.*\\W)#', $password);\n\tif (!$speciaux) {\n\t\t$check++;\n\t}\n\t\n\t$res = $free + $check;\n\tif ($n < 6) {\n\t\t$res = ($free <= $check) ? $check : $free;\n\t}\n \n return $res;\n}", "function sumProperDivisors( $number ) {\n\n $factors = array();\n\n $max = floor( sqrt( $number ) );\n\n for( $factor = 1; $factor <= $max; $factor++ ) {\n\n if( $number % $factor == 0 ) {\n\n array_push( $factors, $factor );\n\n // Don't add the square root twice.\n if( $factor != $number / $factor ) {\n\n // A proper factor must be less than the number.\n if( $factor != 1 ) {\n\n array_push( $factors, $number / $factor );\n\n }\n\n }\n\n }\n\n }\n\n return array_sum( $factors );\n\n}", "function TestNumber($N) {\t\r\n\t\tglobal $DecentNumber, $Max5s, $Max3s, $SolutionFound;\r\n\t\tswitch ($N) {\r\n\t\t// Too small to start\r\n\t\t\tCase ($N <= 2):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 3 - early success exit\r\n\r\n\t\t\tCase ($N == 3):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = 1;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"555\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 4 - Fail\r\n\t\r\n\t\t\tCase ($N == 4):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for Special Success MOD 3 = 0, If this is true, then we found a special case of all 5's.\r\n\t\t\r\n\t\t\tCase (($N % 3) == 0):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = $N / 3;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = AssembleString($Max5s, $Max3s);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\tGeneralCase ($N);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "function getFactorial(int $num){\n $num = abs($num);\n $fact = 1;\n for ($i=1 ,$ii = $num ; $i <= $ii ; $i++){\n $fact *= $i;\n }\n\n return $fact;\n}", "function USCLN($a, $b)\n {\n // neu phan so am thi doi dau cua tu so\n if($a<0) $a=(-1)*$a;\n $sonho = ($a < $b) ? $a : $b;\n for($i = $sonho; $i > 0; $i--) {\n if (($a%$i==0) && ($b%$i==0)) {\n break;\n }\n }\n\n return $i;\n }", "function mod($n, $m) {\n return (($n % $m) + $m) % $m;\n}", "public function rnum( $min, $max ) {\r\n\t\t$num = 0;\r\n\t\twhile ( $num < $min || $num > $max || null == $num ) {\r\n\t\t\t$num = mt_rand( $min, $max );\r\n\t\t}\r\n\t\treturn $num;\r\n\t}", "function getN($maxn) {\n $n = $_GET[\"n\"];\n if ($n == '') {\n \t$n = $maxn;\n }\n\n switch ($n) {\n \tcase 3:\n \tcase 6:\n \tcase 9:\n \tcase 19:\n return $n;\n \tbreak;\n\n \tdefault:\n \theader(\"Location: \".$_SERVER['PHP_SELF'] );\n }\n\n}", "function calculate_pow($min, $max) {\n for($count = $min; $count <= $max; $count++) {\n echo \"Val : $count , $count<sup>2</sup> : \" . pow($count, 2) . \"<br>\";\n }\n}", "function random_number_between_but_not($min=null, $max=null, $butNot=null) {\n if ( $min > $max ) {\n return 'Error: min is greater than max.'; //@TODO \"Nebula\" 0: If min is greater than max, swap the variables.\n }\n if ( gettype($butNot) == 'array' ) {\n foreach( $butNot as $key => $skip ){\n if( $skip > $max || $skip < $min ){\n unset($butNot[$key]);\n }\n }\n if ( count($butNot) == $max-$min+1 ) {\n return 'Error: no number exists between ' . $min .' and ' . $max .'. Check exclusion parameter.';\n }\n while ( in_array(($randnum = rand($min, $max)), $butNot));\n } else {\n while (($randnum = rand($min, $max)) == $butNot );\n }\n return $randnum;\n}", "function getWinProb($n){\n return 1 / (1 + pow(10,((-1*$n)/400)));\n}", "static function getMultiples(int ...$numbers) : int\n {\n $numbers = array_values($numbers);\n asort($numbers);\n\n $last = $numbers[count($numbers) - 1];\n $multiples = 0;\n\n for ($i = 5; $i <= $last; $i += 5) {\n if (in_array($i, $numbers)) {\n $multiples++;\n }\n }\n\n return $multiples;\n }", "function rangeIter(int $min, int $max): int\n {\n $array = range($min, $max);\n $total = 0;\n\n while ($array)\n {\n $total += array_pop($array);\n }\n\n return $total;\n }", "function obtenerIntervalos($a,$b,$n,$fun){\n\t$auxArr = array();\n\t$s = ($b - $a) / $n ;\n\t$i = 0;\n\n\tdo {\n\t\t$x = fnEval($a,$fun);\n\t\t$xn = fnEval($a+$s , $fun);\n\t\tif(($x*$xn) < 0){\n\t\t\t$auxArr[$i]['Limite inferior'] = $a ;\n\t\t\t$auxArr[$i]['Limite superior'] = $a + $s ;\n\t\t\t$auxArr[$i]['Raices'] = 0 ;\n\t\t\t$a = $a + $s;\n\t\t\t$i = $i + 1;\n\t\t}else{ // aqui no puede haber una asignacion al array\n\t\t\t$a = $a + $s;\n\t\t\t$i = $i + 1;\n\n\t\t}\n\t} while ($a<=$b);\n\treturn $auxArr;\n}", "function factorial($numero) {\r\n if ($numero >= 2) { // Creamos una condicion, un punto donde la funcion no vuelva a llamarse\r\n return ($numero * factorial($numero - 1)); // llamamos a la funcion ya creada pero modificandole\r\n // el parátro para que la condicion anteriormente escrita se cumple en algun momento\r\n } else {\r\n return true; // devolvemos el número obtenido al llegar a $numero[0]\r\n }\r\n}", "function getFactors(int $number):array {\n for ($i = 2; $i < $number; $i++) {\n // Si le modulo de $number divisé par $i est 0, il s'agit d'un facteurs de ce nombre\n if($number % $i == 0){\n $factors[] = $i;\n }\n }\n var_dump($factors);\n return $factors;\n}", "public function getOpPrimeNumero()\n {\n\n return $this->op_prime_numero;\n }", "public static function rangeToMaxVisible(int $range): int\n\t{\n\t\tif ($range < 0) {\n\t\t\tthrow new \\ResponsivePagination\\Exceptions\\InvalidArgumentException(\n\t\t\t\t'Parameter $range must be greater or equals to 0'\n\t\t\t);\n\t\t}\n\n\t\t// First and last button + first and last dots + middle button + 2x range around middle button\n\t\treturn $range * 2 + 5;\n\t}", "public function prime($key, $value)\n {\n }", "function exibeAtualMax(){\n $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n return $nmax= ($this->numpage + $nmin)-1;\n }", "public function getPrimaryNumber($number) : void\n {\n echo \"Jusqu'à \" . $number . \" les nombres premiers sont : \";\n for ($i = 3; $i < $number; $i++)\n {\n if($this->isPrime($i))\n {\n echo $i . ' ; ';\n }\n }\n }", "function candies($n, $m) {\n $result = 0; \n $result = intval($m/$n); \n $result = $n * $result; \n return $result;\n}", "function neparan($b)\n{\n if($b%2==0)\n {\n return false;\n }\n else\n {\n return true;\n }\n}", "function getPagination($count, $page_per_no){\r\n\t\t$paginationCount = floor($count / $page_per_no);\r\n\t\t$paginationModCount = $count % $page_per_no;\r\n\t\tif(!empty($paginationModCount)){\r\n\t\t\t$paginationCount++;\r\n\t\t}\r\n\t\treturn $paginationCount;\r\n\t}", "function factorial($in)\n {\n $out = 1;\n // Only if $in is >= 2\n for ($i = 2; $i <= $in; $i++) {\n $out *= $i;\n }\n return $out;\n }", "function primeFactorization($n) {\n $factors = [];\n\n while ($n % 2 === 0) {\n addPrime($factors, 2);\n $n /= 2;\n }\n\n for ($i = 3; $i * $i <= $n; $i += 2) {\n while ($n % $i === 0) {\n addPrime($factors, $i);\n $n /= $i;\n }\n }\n\n if ($n > 2)\n addPrime($factors, $n);\n\n return $factors;\n}" ]
[ "0.69071966", "0.67448616", "0.67437106", "0.67326856", "0.66097903", "0.65374184", "0.65290624", "0.64302117", "0.63991004", "0.6395262", "0.63912475", "0.6283297", "0.6210576", "0.61942106", "0.61900896", "0.61777586", "0.6157207", "0.61298525", "0.60897315", "0.6080911", "0.60695547", "0.6011736", "0.598715", "0.59484684", "0.5931647", "0.5903157", "0.58772916", "0.5811852", "0.57868797", "0.5776186", "0.576401", "0.5730742", "0.5730152", "0.57294714", "0.5715146", "0.5696564", "0.5693937", "0.5675187", "0.56698066", "0.56660056", "0.5622585", "0.56038624", "0.5580839", "0.5518059", "0.55159676", "0.5514075", "0.5501436", "0.54953796", "0.5446329", "0.54440176", "0.5419894", "0.5419085", "0.54009706", "0.5392593", "0.5384764", "0.5350372", "0.53396976", "0.5295713", "0.5257617", "0.52476674", "0.52320224", "0.5214272", "0.5212979", "0.5207085", "0.51798904", "0.5172134", "0.5171197", "0.51452994", "0.5085788", "0.50849134", "0.50591207", "0.5052736", "0.5051535", "0.5041718", "0.50383323", "0.5035953", "0.5031663", "0.50315905", "0.5030998", "0.5026967", "0.5026097", "0.50120974", "0.5009918", "0.50050396", "0.50014925", "0.49984935", "0.49976277", "0.49876586", "0.4986957", "0.49813634", "0.49795234", "0.4965729", "0.49459723", "0.49306738", "0.49261528", "0.49206698", "0.4902552", "0.48997438", "0.48964342", "0.48878485" ]
0.8158945
0
Denies setting an id of an immutable record. Throws an exception.
public function setId($id): void { throw new RecordException('Cannot change an id of an immutable record.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_id($id)\n\t{\n\t\t//set the id of the actual object. Nobody should do this.\n\t\treturn NOT_ALLOWED;\n\t}", "function setId($id) {\r\n\t\t// Set id and wipe data\r\n\t\t$this->_id = $id;\r\n\t}", "function setId($value){\n\t\t//echo \"setting ID to \".$value;\n\t\t$this->_id=$value;\n\t\t//echo \"ID set to \".$this->_id;\n\t\treturn $this;\n\t}", "public function setId($value) {\n\t\tif (!is_numeric($value))\n\t\t\tthrow new Exception('ID must be numeric');\n\t\tif ($value < 0)\n\t\t\tthrow new Exception('ID must be positive');\n\t\t$this->id = $value;\n\t\treturn $this;\n\t}", "public function setInternalId($id)\n {\n if ($this->_id !== null && $this->_id !== $id) {\n throw new ClientException('Should not update the id of an existing document');\n }\n\n\n if (!preg_match('/^[a-zA-Z0-9_-]{1,256}\\/' . self::KEY_REGEX_PART . '$/', $id)) {\n throw new ClientException('Invalid format for document id');\n }\n\n $this->_id = (string) $id;\n }", "static public function setId($id){\n \tif (self::$_id != $id){\n \t\tself::$_id = $id;\n \t\tself::regenerate();\n \t}\n }", "function setId($id) {\n // Set id and wipe data\n $this->_id = $id;\n //die($id);\n $this->_data = null;\n }", "public function setId($value) {\n if (empty($value))\n throw new InvalidArgumentException('An Id must have a value');\n $this->id = $value;\n return $this;\n }", "public function setId($value) {\n if (empty($value))\n throw new InvalidArgumentException('An Id must have a value');\n $this->id = $value;\n return $this;\n }", "public function testSetIdSubException()\n {\n $object = $this->getMock('Varien_Object', array('getIdFieldName'));\n $object->expects($this->once())\n ->method('getIdFieldName')\n ->will($this->throwException(new BadMethodCallException('some exception')));\n $result = $object->setId('value');\n }", "public function setId($id) {\n return false;\n }", "function set($id) {\n if (!empty($id)) {\n $this->_id = $id;\n return TRUE;\n }\n return FALSE;\n }", "function setId($id)\n\t{\n\t\t// Set id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t//$this->_data\t= null;\n\t}", "public function set(string $id, mixed $value): void;", "function setId($id) {\r\n // Set id and wipe data\r\n $this->_id = $id;\r\n $this->_data = null;\r\n }", "public function setId($id, $new = false)\n {\n\n Log::debug('set id entity: '.$this->getTable().' id: '.$id, $id);\n\n if (! is_numeric($id)) {\n throw new LibDb_Exception(I18n::s('Got invalid error ID {@id@}', 'wbf.message', array (\n 'id' => $id\n )));\n }\n\n $this->synchronized = false;\n\n $this->id = $id;\n $this->isNew = $new;\n\n }", "public function set($new_id);", "function setId($id)\n\t{\n\t\t// Set id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t$this->_data\t= null;\n\t}", "public function setId($x) { $this->id = $x; }", "public function set(string $id, $value);", "function setId($value) {\n $this->_id = intval($value);\n }", "public function setID($id);", "protected function setInternalIdentifier($id)\n {\n $this->_id = $id;\n }", "public function setId($value)\n {\n if (empty($value))\n {\n throw new InvalidArgumentException('An ID must have a value');\n }\n $this->id = $value;\n return $this;\n }", "public function setId($id)\n {\n $id = (int) $id;\n \n if ($id > 0)\n {\n $this->_id = $id;\n }\n }", "public function setIdentifier($record){\n\t\t$record->writeAttribute($this->_identityColumn, $this->generateUUID());\n\t}", "public function setId($id) {\n $id = (int) $id;\n if (isset($this->fields[\"id\"])) {\n throw new \\BadMethodCallException(__(\"The ID has been set already.\"));\n }\n\n if (!is_int($id) || $id < 1) {\n throw new \\InvalidArgumentException(__(\"The ID is invalid.\"));\n }$this->fields[\"id\"] = $id;\n\n return $this;\n }", "public function setId($id) ;", "public function setId($value) {\r\n\t\t$this->_id = $value;\r\n\t\treturn $this;\r\n\t}", "public function setId(string $id): void;", "public function setId()\n {\n throw new \\RuntimeException('It is not possible to set job id, you must create a new job');\n }", "public function setId($id)\n\t{\n\t\tif (isset($this->id)) {\n\t\t\tthrow new \\RuntimeException('ID is already set, you cannot change it once it is set!');\n\t\t}\n\t\t$this->id = $id;\n\t}", "public function setId($value){\n\t\tif($this->validateId($value)){\n\t\t\t$this->id = $value;\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function set($id, $value);", "public function set($id, $value);", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "function SetId($value) { $this->id=$value; }", "public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setId($id){\n $this->_id = $id;\n }", "public function setId($id): void;", "public function getIdAttribute() \n\t{\n\t\tthrow new \\Exception('Unsupported');\n\t}", "public function setId($value){\n if($this->validateId($value)){\n $this->id=$value;\n return true;\n }else{\n return false;\n }\n }", "public function setIdentity($value);", "public function setId($_id);", "function setId($id) {\r\n\t\t// Set item id and wipe data\r\n\t\t$this->_id\t = $id;\r\n\t\t$this->_item\t\t= null;\r\n\t}", "public function setId($id) { $this->id = $id; }", "public function set_id($_id){\n $this->_id = $_id;\n\n return $this;\n }", "public function SetId ($id);", "public function setId(int $id)\n {\n }", "public function setOriginalId($id);", "public function setId($id) {\n $this->_id = (int) $id;\n return $this;\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function testSetAndGetID()\r\n {\r\n $testObj = $this->_createMockModel();\r\n $baseObj = $this->_createMockModel();\r\n\r\n // Set the ID\r\n $testObj->setID(99);\r\n\r\n // Assert that a change occurred in the test object\r\n $this->assertNotEquals($testObj, $baseObj);\r\n\r\n // Assert that ID field was updated\r\n $this->assertEquals(99, $testObj->getID());\r\n\r\n // Assert that no other return values were affected\r\n $this->_assertModelsSameExcept($testObj, $baseObj, 'ID');\r\n }", "public function canSetId();", "public function setId(string $id);", "function setId($id) {\n\t\treturn $this->setData('id', $id);\n\t}", "public function setId($id) {\n\t\t$this->id = (integer)$id;\n\t}", "function setId($id)\r\n {\r\n $this->_id = $id;\r\n $this->_data = null;\r\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId($id)\n\t{\n\t\t// Set record id and wipe data, if setting a different ID\n\t\tif ($this->_id != $id)\n\t\t{\n\t\t\t$this->_id = $id;\n\t\t\t$this->_data = null;\n\t\t\t$this->_total = null;\n\n\t\t\t$this->_data_pending = null;\n\t\t\t$this->_total_pending = null;\n\t\t}\n\t}", "function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id);", "public function setId($id){\t\r\n\t\t$this->_id = (int) $id;\r\n\t\treturn $this;\r\n\t}", "public function setID($id)\n\t{\n\t\tif ( ! is_numeric($id) )\n\t\t{\n\t\t\tthrow new DOFaultyIDException($id);\n\t\t}\n\t\t\n\t\t$this->id = $id;\n\t}", "abstract public function set($id, $data, $lifetime = 3600, $overwrite = false);", "public function setId($id)\n {\n// // Si c'en était déjà un, rien ne changera.\n// // Sinon, la conversion donnera le nombre 0 (à quelques exceptions près, mais rien d'important ici).\n// $id = (int)$id;\n//\n// // On vérifie ensuite si ce nombre est bien strictement positif.\n// if ($id > 0) {\n// // Si c'est le cas, c'est tout bon, on assigne la valeur à l'attribut correspondant.\n// $this->_id = $id;\n// }\n }", "private function setId($id)\n {\n $this->id = $id;\n }", "public function testSetNonexistentCurrentID()\n {\n $complement = $this->complement;\n\n $this->assertFalse(\n $complement::setCurrentID('Unknown')\n );\n }", "public function setId(string $id)\n\t{\n\t\t$this->id=$id; \n\t\t$this->keyModified['id'] = 1; \n\n\t}", "private function _setId($id)\n {\n $this->_id = $id;\n\n return $this;\n }", "function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\r\n $this->_id = $id;\r\n }", "function setId($id)\n\t{\n\t\t// Set state ID and wipe data\n\t\t$this->_id\t\t\t= $id;\n\t\t$this->_state\t\t= null;\n\t\t$this->_suburbs\t\t= null;\n\t}", "public function set_id( $id ) {\n\t\t$this->id = absint( $id );\n\t}", "public function setId($_id)\n {\n $this->_id = $_id;\n\n return $this;\n }", "public function setId($_id)\n {\n $this->_id = $_id;\n\n return $this;\n }", "public function setId($_id)\n {\n $this->_id = $_id;\n\n return $this;\n }", "public function setId($id)\n {\n $this->id = $id;\n\n \n }", "public function resetId()\n {\n\n $this->id = null;\n\n }", "public function testSetId()\n {\n $this->alignment->setId(25);\n $this->assertEquals(25, $this->alignment->getId());\n }", "public function setId($id)\n\t{\n\t\tif (!$this->validator->isValidId($id))\n\t\t{\n\t\t\t$message = $this->validator->getLastErrorMessage();\n\t\t\tthrow new Exception\\UnexpectedValueException($message);\n\t\t}\n\n\t\t$this->id = $id;\n\t\treturn $this;\n\t}", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "public function setId(int $id)\n {\n $this->id = $id;\n }", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "public function &setId($id) {\n\t\t$this->notifyChanged(self::FIELD_ID,$this->id,$id);\n\t\t$this->id=$id;\n\t\treturn $this;\n\t}", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "public function setId($value)\n {\n if ($this->validateId($value)){\n $this->id = $value;\n return true;\n } else {\n return false;\n }\n }" ]
[ "0.69752294", "0.6176088", "0.611316", "0.61036444", "0.60163367", "0.60119945", "0.5965352", "0.5958886", "0.5958886", "0.59584004", "0.5954457", "0.5951824", "0.59479004", "0.591563", "0.59006", "0.5877104", "0.58539987", "0.58493304", "0.58438617", "0.5839176", "0.58342767", "0.5830245", "0.58185697", "0.5814733", "0.58097917", "0.58022875", "0.5792071", "0.5790816", "0.5782827", "0.5776494", "0.5762148", "0.5761388", "0.5757783", "0.5747714", "0.5747714", "0.5741683", "0.573074", "0.57289195", "0.57214177", "0.5715646", "0.5695987", "0.5693405", "0.5674909", "0.56565946", "0.56378627", "0.56180567", "0.5615054", "0.5612993", "0.5612602", "0.56101763", "0.56003433", "0.5597433", "0.5592982", "0.5592889", "0.55888337", "0.55812556", "0.5577818", "0.55697346", "0.5566302", "0.5564141", "0.5562306", "0.5560323", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.5557549", "0.55491203", "0.55489355", "0.5548767", "0.5544002", "0.55384547", "0.55381507", "0.55359596", "0.55350846", "0.5530245", "0.55281264", "0.55173826", "0.55127835", "0.5512744", "0.5512744", "0.5512744", "0.5510296", "0.55101824", "0.5503611", "0.5500228", "0.5499963", "0.5498767", "0.54977965", "0.54972583", "0.5495251", "0.5492303" ]
0.78829277
0
Performs general cleaning functions on data
private function sanitize_random($input) { $one = trim($input); $two = stripslashes($one); $return = htmlspecialchars($two); return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "public function clean($data)\n {\n foreach($this->getFields() as $name => $field) {\n $field->clean($data[$name]);\n }\n }", "public static function additionalCleaning() {\n \n }", "abstract function clean ();", "abstract public function sanitize();", "abstract public function clean();", "protected function _clean()\r\n\t{\r\n\t\t$this->taintValue = null;\r\n\t\t$this->normalizedValue = null;\r\n\t\r\n\t\t$this->parameterInfo = null;\r\n\t\t$this->bFetched = false;\r\n\t\t\r\n\t\t$this->validationInfo = null;\r\n\t\t$this->isValid = false;\r\n\t}", "function _cleanup_input_data($data = array()) {\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Cleanup data array\n\t\t$_tmp = array();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\t$k = trim($k);\n\t\t\tif (!strlen($k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$_tmp[$k] = $v;\n\t\t}\n\t\t$data = $_tmp;\n\t\tunset($_tmp);\n\t\t// Remove non-existed fields from query\n\t\t$avail_fields = $this->_get_avail_fields();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\tif (!isset($avail_fields[$k])) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\t// Last check\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $data;\n\t}", "private function _clean($data){\n $data = preg_replace(\"/\\r|\\n/\",\"\",$data);\n $data = preg_replace(\"/\\s+/\",\" \",$data);\n return $data;\n }", "public abstract function clean();", "public function clean()\n\t{\n\t\tforeach ($this->dirtyFields AS $field)\n\t\t\t$this->cleanField($field);\n\t}", "protected function sanitize() {}", "public function sanitize()\n {\n parent::sanitize();\n\n foreach ($this->_cleanData as $key => $value) {\n $this->_cleanData[$key] = strip_tags($value);\n }\n }", "public function clean();", "public function clean();", "public function clean();", "public function clean();", "public function clean();", "function cleanData()\r\n {\r\n //Create and enmpty object \r\n $this->data = new stdClass();\r\n //Using a foreach loop to iterate through the object\r\n foreach ($this->preCleanData as $key => $value) {\r\n if (strlen($value) == 0) {\r\n return $this->data = null;\r\n }\r\n $this->data->$key = strip_tags($value);\r\n }\r\n return $this->data;\r\n }", "public function sanitize() {\n\n\t\t// load the tool that we want to use in the xss filtering process\n\t\t$this->loadTool();\n\n\t\tif (is_array($_GET) AND count($_GET) > 0) {\n\n\t\t\t$_GET = $this->clean_input_data($_GET);\n\t\t}\n\t\tif (is_array($_POST) AND count($_POST) > 0) {\n\n\t\t\t$_POST = $this->clean_input_data($_POST);\n\t\t}\n\t\tif (is_array($_COOKIE) AND count($_COOKIE) > 0) {\n\n\t\t\t$_COOKIE = $this->clean_input_data($_COOKIE);\n\t\t}\n\t\tif (is_array($_FILES) AND count($_FILES) > 0) {\n\n\t\t\t//$_FILES = $this->clean_input_data($_FILES, true);\n\t\t}\n\n\t}", "public function sanitize()\n {\n $purifier = $this->_purifier;\n $this->_sanitized_data = array_map(\n function ($field) use ($purifier) {\n return $purifier->purify($field);\n },\n $this->_data\n );\n }", "public function sanitize_data($data_array) {\n // The sequence of these events is important!\n $data_array = $this->remove_empty_rows($data_array); // run first to get rid of trailing CSV row from Excel save-as\n $data_array = $this->pad_to_rectangle($data_array);\n $data_array = $this->trim_all_elements($data_array);\n $data_array = $this->remove_empty_rows($data_array);\n $data_array = $this->remove_empty_cols($data_array);\n $data_array = $this->slugify_headers($data_array, 0);\n // $data_array = $this->slugify_levels($data_array, 0, array('/#/'=>'num'));\n $data_array = $this->infer_levels($data_array);\n $data_array = $this->remove_subtotals($data_array);\n $data_array = $this->remove_duplicates($data_array);\n $data_array = $this->convert_timepoints_to_numbers($data_array);\n\n return $data_array;\n }", "public function clean() {}", "public function scrub($data);", "public static function xss_clean(array $data)\n\t{\n\t\tforeach($data as $k => $v)\n\t\t{\n\t\t\t$data[$k] = filter_var($v, FILTER_SANITIZE_STRING);\t\t\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "private function _sanitize_data($data){\n\t\t// Remove fields which potentially can damage the tree structure\n\t\tif(is_array($data))\n\t\t{\n\t\t\tunset($data['lft']);\n\t\t\tunset($data['rgt']);\n\t\t}\n\t\telseif(is_object($data))\n\t\t{\n\t\t\tunset($data->lft);\n\t\t\tunset($data->rgt);\n\t\t}\n\n\t\tif(isset($data['type']))\n\t\t{\n\t\t\t$data['type'] = implode('|', $data['type']);\n\t\t}\n\n\t\t// ensure entry_id is set correctly for sql strict_mode\n\t\tif(isset($data['entry_id']) && $data['entry_id'] != '')\n\t\t{\n\t\t\t$data['entry_id'] = (int) $data['entry_id'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['entry_id'] = NULL;\n\t\t}\n\n\t\tunset($data['tree_id']);\n\t\tunset($data['is_root']);\n\t\tunset($data['parent_lft']);\n\t\treturn $data;\n\t}", "public function clean()\n {\n // Set to default values\n $this->sSql = '';\n $this->aValues = [];\n }", "function cleanData($data){\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function clean($before);", "function clean($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "public function clean()\n\t{\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}", "public function clean() {\n $this->data = \"\";\n $this->currentRow = 1;\n $this->curPosition = 0;\n }", "function sanitizeFields()\n\t{\n\t\tif(isset($this->sanitize) && isset($this->data[$this->name]))\n\t\t{\n\t\t\tforeach($this->data[$this->name] as $field => $value)\n\t\t\t{\n\t\t\t\tif(isset($this->sanitize[$field]))\n\t\t\t\t{\n\t\t\t\t\tif(!is_array($this->sanitize[$field]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $this->sanitize[$field]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($this->sanitize[$field] as $action)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $action);\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\t\n\t}", "public function clean() {\n\t\t\n\t}", "public function clean($data,$type='string'){\n return $this->purify($data,$type);\n }", "function clean($data){\n\t\t$this->data = $data;\n\t\t$data = trim($data);\n\t\t$data = stripcslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "public function sanitize() {\n }", "public static function clean()\n\t{\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}", "protected function preprocessData() {}", "function tidy_clean_repair(tidy $object) {}", "private function cleanData($data) {\n $returnData = array();\n foreach ($data as $entry) {\n $returnData[] = trim($entry);\n }\n return $returnData;\n }", "function clean_input($data) {\n $data = trim($data); // strips whitespace from beginning/end\n $data = stripslashes($data); // remove backslashes\n $data = htmlspecialchars($data); // replace special characters with HTML entities\n return $data;\n}", "function cleanData($data) {\n $data = stripslashes($data);\n $data = trim($data);\n return $data;\n}", "function cleanInput($data){ //sanitize data \n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\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}", "public function clean($data)\n {\n if (is_array($data)) {\n foreach ($data as $key => $value) {\n unset($data[$key]);\n\n $data[$this->clean($key)] = $this->clean($value);\n }\n } else {\n // Second param : ENT_COMPAT - convert double-quotes and leave single-quotes alone,\n // Third param : 'UTF-8' - set encoding.\n $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');\n }\n\n return $data;\n }", "public function sanitize($data){\n\t\treturn $new_data = $this->mysql_prep($data);\n\t\t}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "public function dianPingDataCleaner($rawDataArray)\n {\n $cleanDataArray = [];\n foreach ($rawDataArray as $rawData)\n {\n //create array that will hold the individual data\n //need to devise correct array for the data to live in\n\n $rawData['comment'] = trim($rawData[$i]);\n $rawData['authorId'] => substr($rawData['author_id'][$i], 8);\n\n //fixing dianPing's broken dates\n $dateConvert = $rawData['date'][$i];\n if(strlen($dateConvert) == 32){\n $shortDate = utf8_decode(substr($dateConvert, 0, 8));\n $trimDate = trim($shortDate);\n if(strpos($trimDate, '?') == true){\n $shorterDate = substr($trimDate, 0, 5);\n $cleanDataArray[$date] => trim('2016-'.$shorterDate);\n }else{\n $cleanDataArray[$date] => '20'.$trimDate;\n }\n }elseif(strlen($dateConvert) == 5){\n $cleanDataArray[$date] => trim('2016-'.$dateConvert);\n }else{\n $cleanDataArray[$date] => trim('20'.$dateConvert);\n }\n\n //getting the number value of the User's rating\n if(substr($criticValue['original_grade'][$i], -2) == 'er'){\n $criticValue[$original_grade] = '0';\n }else{\n $criticValue[$original_grade] = substr($criticValue['original_grade'][$i], -2);\n }\n if($criticValue[$original_grade] == '50' || $criticValue[$original_grade] == '40'){\n $cleanDataArray[$liked] => true;\n }else {\n $cleanDataArray[$liked] => false;\n }\n $cleanDataArray[$venue] => substr($fields['venue'][0], 6);\n\n $cleanDataArray[$source_id] => 'DianPing'; //since this data can only be used on dian ping hardcoding it\n $cleanDataArray[$language] => 'ZH'; //find solution to detect language by text\n\n }\n }", "private function cleanInputs($data){\n\t\t$clean_input = array();\n\t\tif(is_array($data)){\n\t\t\tforeach($data as $k => $v){\n\t\t\t\t$clean_input[$k] = $this->cleanInputs($v);\n\t\t\t}\n\t\t}else{\n\t\t\tif(get_magic_quotes_gpc()){ \n\t\t\t// Returns 0 if magic_quotes_gpc is off, \n\t\t\t// 1 otherwise. Always returns FALSE as of PHP 5.4\n\t\t\t\t$data = trim(stripslashes($data));\n\t\t\t}\n\t\t\t$data = strip_tags($data);\n\t\t\t$clean_input = trim($data);\n\t\t}\n\t\treturn $clean_input;\n\t}", "public function clean()\n {\n\n $this->tokens = [];\n $this->rawMatches = [];\n\n }", "function themify_sanitize_data( $data ) {\n\tif ( is_array( $data ) && !empty( $data )) {\n\t\tforeach( $data as $name => $value ){\n\t\t\tif ( in_array( $name, array( 'setting-custom_css', 'setting-header_html', 'setting-footer_html', 'setting-footer_text_left', 'setting-footer_text_right', 'setting-homepage_welcome', 'setting-store_info_address' ),true )\n\t\t\t\t|| ( false !== stripos( $name, 'setting-hooks' ) )\n\t\t\t) {\n\t\t\t\t$data[$name] = str_replace( \"\\'\", \"'\", $value );\n\t\t\t} else {\n\t\t\t\t$data[$name] = stripslashes( $value );\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}\n\treturn array();\n}", "public function clean()\n {\n $this->file = '';\n $this->vars = array();\n $this->headers = array();\n $this->metas = array();\n $this->jses = array();\n $this->javascript = array();\n $this->attachments = array();\n $this->csses = array();\n }", "protected function _clean()\n {\n if ($this->_defaultOptions['clean'] === FALSE) {\n return;\n }\n\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'remove unused markers',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $this->_cleanMarkers('loop');\n $this->_cleanMarkers('optional');\n\n $this->DISPLAY = preg_replace(\n $this->_contentMarkers,\n '',\n $this->DISPLAY\n );\n }", "public function markClean();", "function clean(array $conditions): void;", "public function clean()\n {\n\n $this->model = null;\n $this->value = null;\n $this->attribute = null;\n $this->data = [];\n\n $this->fkTable = null;\n\n $this->fkQuery = null;\n $this->fkAndQuery = null;\n $this->fkOrQuery = null;\n\n }", "private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }", "function sanitizeData($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\n\t\treturn $data;\n\t}", "public function clean() {\n\t\tglobal $warnings;\n\n\t\t// it's not at CBW\n\t\tif ($this->location != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as being at HQ\";\n\t\t\t$this->location = 1;\n\t\t}\n\t\t// it had beer in it\n\t\tif ($this->beer != 0) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as empty\";\n\t\t\t$this->beer = 0;\n\t\t}\n\t\t// it's not dirty\n\t\tif ($this->status != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as dirty\";\n\t\t}\n\n\t\t$this->status = 2;\n\t\t$this->update();\n\t}", "function cleanInput($data)\n\t{\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function ppCleanData($postarray) {\n array_walk($postarray,'ppCleanField');\n return $postarray;\n}", "function clean_input($data){\r\n\t\t\t\t\t$data = trim($data);\r\n\t\t\t\t\t$data = stripslashes($data);\r\n\t\t\t\t\t$data = htmlspecialchars($data);\r\n\t\t\t\t\treturn $data;\r\n\t\t\t\t}", "function cleanInput($data)\n{\n    $data = trim($data);\n\n // gunakan stripslashes untuk elakkan  double escape if magic_quotes_gpc is enabledif(get_magic_quotes_gpc()){\n $data = stripslashes($data);}", "function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function cleanInput($data) {\r\n\t\t\t$data = trim($data);\r\n\t\t\t$data = stripslashes($data);\r\n\t\t\t$data = htmlspecialchars($data);\r\n\t\t\treturn $data;\r\n\t\t}", "function cleanseInput(&$data)\r\n{\r\n if (is_array($data))\r\n {\r\n foreach ($data as &$subItem)\r\n {\r\n $subItem = cleanseInput($subItem);\r\n }\r\n }\r\n \r\n else\r\n { \r\n $data = trim($data, \"';#\");\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n }\r\n \r\n return $data;\r\n}", "function commonValidation($data) {\n unset($this->validate['title']);\n unset($this->validate['category_id']);\n unset($this->validate['short_description']);\n\n if ($data['Offer']['basename'] != '') {\n unset($this->validate['file']['valid_upload']);\n }\n }", "function sanitize($data)\n {\n $data=trim($data);\n $data=mysql_real_escape_string($data);\n return $data;\n }", "function cleanInput($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function filter_mydata($data)\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public function processData() {\n\t\t$GLOBALS['TCA'] = \\BusyNoggin\\BnBackend\\BackendLibrary::removeExcludeFields($GLOBALS['TCA']);\n\t}", "function filter_any_data($data){\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 clean_data($string) {\r\n\tif (get_magic_quotes_gpc()) {\r\n\t\t$string = stripslashes($string);\r\n\t}\r\n\t$headers = array(\r\n \t\"/to\\:/i\",\r\n \t\"/from\\:/i\",\r\n \t\"/bcc\\:/i\",\r\n \t\"/cc\\:/i\",\r\n \t\"/Content\\-Transfer\\-Encoding\\:/i\",\r\n \t\"/Content\\-Type\\:/i\",\r\n \t\"/Mime\\-Version\\:/i\" \r\n \t); \r\n \t$string = preg_replace($headers, '', $string);\r\n \r\n\treturn strip_tags($string);\r\n}", "function clean_input( $dirty_data ){\n\t//use the DB connection already established\n\tglobal $db;\n\t//clean the data and 'return' it so we can continue working with it\n\treturn mysqli_real_escape_string($db, strip_tags( $dirty_data ));\n}", "function clean_input($input){\n\n\t$clean;\t//clean version of variable\n\n\tif (is_string($input)){\n\t\t$clean = mysql_real_escape_string(stripslashes(ltrim(rtrim($input))));\n\t}\n\telse if (is_numeric($input)){\n\t\t$clean = mysql_real_escape_string(stripslashes(ltrim(rtrim($input))));\n\t}\n\telse if (is_bool($input)){\n\t\t$clean = ($input) ? true : false;\n\t}\n\telse if (is_array($input)){\n\t\tforeach ($input as $k=>$i){\n\t\t\t$clean[$k] = clean_input($i);\n\t\t}\n\t}\n\t\n\treturn $clean;\n\t\n}", "function clean_input($data) \n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitizeData_hard($var)\n\t{\n\t\t$var = trim($var); // gets rid of white space\n\t\t$var = stripslashes($var); // no slashes protecting stuff\n\t\t$var = htmlentities($var); // no html :-(\n\t\t$var = strip_tags($var); // no tags\n\t\treturn $var; //returns clean data\n\t}", "public function clean() {\n unset($data['id_nome']);\n }", "public static function mongo_sanitize(&$data) {\n foreach ($data as $key => $item) {\n is_array($item) && !empty($item) && $data[$key] = self::mongo_sanitize($item);\n if (is_array($data) && preg_match('/^\\$/', $key)) {\n unset($data[$key]);\n }\n }\n return $data;\n }", "function sanitizeArray( &$data, $whatToKeep )\n{\n $data = array_intersect_key( $data, $whatToKeep ); \n \n foreach ($data as $key => $value) {\n\n $data[$key] = sanitizeOne( $data[$key] , $whatToKeep[$key] );\n\n }\n}", "public function clean($data){\n if(!empty($data)){\n $data = trim(strip_tags(stripcslashes($data)));\n return $data;\n }\n }", "function Clean()\n\t{\n\t\t$this->_arrRows\t\t\t\t= Array();\n\t\t$this->_arrHeader\t\t\t= Array();\n\t\t$this->_arrWidths\t\t\t= Array();\n\t\t$this->_arrAlignments\t\t= Array();\n\t\t$this->_arrLinkedTables\t\t= Array();\n\t\t$this->_bolRowHighlighting\t= FALSE;\n\t\t$this->_bolDetails\t\t\t= FALSE;\n\t\t$this->_bolToolTips\t\t\t= FALSE;\n\t\t$this->_bolLinked\t\t\t= FALSE;\n\t\t$this->_intCurrentRow\t\t= NULL;\n\t}", "protected function _trimAllFields(array &$data)\n {\n array_map('trim', $data);\n }", "public function sanitize(&$data)\n\t{\n\t\treturn $data;\n\t}", "function tidy_repair_string($data, $config = null, $encoding = null) {}", "function sanitize($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function sanitize($data){\n$data=trim($data);\n$data=htmlspecialchars($data);\n$data=mysql_real_escape_string($data);\nreturn $data;\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}", "public function normalizeData()\n {\n if (is_numeric($this->Streetname2)) {\n $this->HouseNumber = $this->Streetname2;\n $this->Streetname2 = \"\";\n }\n\n// Sometimes people will input - To mean Idfk why are you asking me to input this?\n if ($this->Phone && strlen($this->Phone) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid Phone [$this->Phone] ignoring\"));\n $this->Phone = '';\n }\n\n if ($this->State && strlen($this->State) < 2) {\n $this->addMessage($this->getFormatedMessage(\"Invalid State [$this->State] ignoring\"));\n $this->State = '';\n }\n\n if ($this->CompanyName && strlen($this->CompanyName) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid CompanyName[$this->CompanyName] ignoring \"));\n $this->CompanyName = '';\n }\n\n $this->Description = $this->escapeTextData($this->Description);\n if ($this->Description && strlen($this->Description) > 255) {\n $this->Description = substr($this->Description, 0, 255);\n\n //Make sure we are not sending a broken special char\n $descChars = str_split($this->Description); \n for ($i = 254; $i > 251; --$i) {\n if ($descChars[$i] == '&') {\n $this->Description = substr($this->Description, 0, $i);\n }\n }\n }\n\n if($this->Description && strlen($this->Description) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid description $this->Description ignoring \"));\n $this->Description = ''; \n }\n }", "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 sanitize($data) {\n $sanitized = array();\n foreach ( $data as $key => $val ) {\n if ( !is_array($val) ) {\n if ( isset($this->_sanitizers[$key]) ) {\n $sanitized[$key] = Data::sanitize($val, $this->_sanitizers[$key]);\n }\n } else {\n foreach ( $val as $id => $obj ) {\n $sanitized[$key][$id] = $obj->sanitize();\n }\n }\n }\n return $sanitized;\n }", "protected function clean(Array $data)\n {\n foreach ($data as $key => $value) {\n // If the input data has a value that isn't in the whiteList, remove it from the array\n if (!array_key_exists($key, $this->whiteList)) {\n unset($data[$key]);\n }\n }\n return $data;\n }", "private static function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "public function sanitizeFreeText()\n {\n $this->label = AdapterUtil::reencode($this->label);\n $this->street = AdapterUtil::reencode($this->street);\n $this->locality = AdapterUtil::reencode($this->locality);\n $this->region = AdapterUtil::reencode($this->region);\n $this->country = AdapterUtil::reencode($this->country);\n }", "function cleanData(&$str)\n {\n // handling karakter tab\n $str = preg_replace(\"/\\t/\", \"\\\\t\", $str);\n\n // handling karakter enter\n $str = preg_replace(\"/\\r?\\n/\", \"\\\\n\", $str);\n\n // convert 't' and 'f' menjadi nilai boolean\n if($str == 't') $str = 'TRUE';\n if($str == 'f') $str = 'FALSE';\n\n // handle karakter doubel quotes\n if(strstr($str, '\"')) $str = '\"' . str_replace('\"', '\"\"', $str) . '\"';\n }" ]
[ "0.74333286", "0.7266174", "0.72291124", "0.7168278", "0.7124011", "0.705292", "0.6949787", "0.6888589", "0.6854102", "0.6851812", "0.68398815", "0.6827839", "0.6826571", "0.68038094", "0.68038094", "0.68038094", "0.68038094", "0.68038094", "0.676772", "0.6760442", "0.6735087", "0.67213464", "0.6697235", "0.6648343", "0.6585851", "0.6553674", "0.65472835", "0.6534904", "0.6530484", "0.65188247", "0.6517836", "0.6517468", "0.65126765", "0.65111923", "0.6497912", "0.64515823", "0.64465064", "0.64439815", "0.6443426", "0.64384586", "0.64384586", "0.64384586", "0.63884866", "0.63853943", "0.6380507", "0.6377886", "0.6377279", "0.6375093", "0.636246", "0.63451403", "0.6341473", "0.6307665", "0.6307665", "0.6287132", "0.62839127", "0.62809837", "0.62542534", "0.62297785", "0.6207579", "0.619522", "0.61909556", "0.617508", "0.6156529", "0.61547995", "0.61503357", "0.61488336", "0.6147047", "0.6139672", "0.61278665", "0.6125188", "0.6124368", "0.6120645", "0.611955", "0.61164105", "0.6115471", "0.6094809", "0.6083256", "0.6075385", "0.6069196", "0.60607666", "0.6053807", "0.60534793", "0.60505307", "0.6046189", "0.60459787", "0.6043145", "0.60333943", "0.60023564", "0.5998427", "0.5990958", "0.59878117", "0.5986624", "0.59857893", "0.59835124", "0.59834564", "0.59772253", "0.5968736", "0.59627414", "0.59621346", "0.5960908", "0.5958255" ]
0.0
-1
Validates a phone number
private function sanitize_phone($phone) { if (empty($phone)) { return false; } if (preg_match('/^[+]?([0-9]?)[(|s|-|.]?([0-9]{3})[)|s|-|.]*([0-9]{3})[s|-|.]*([0-9]{4})$/', $phone)) { return trim($phone); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate_phone_number($phone)\n\t\t{\n\t\t\t// Allow +, - and . in phone number\n\t\t\t$filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n\t\t\t// Remove \"-\" from number\n\t\t\t$phone_to_check = str_replace(\"-\", \"\", $filtered_phone_number);\n\t\t\t// Check the lenght of number\n\t\t\t// This can be customized if you want phone number from a specific country\n\t\t\tif (strlen($phone_to_check) < 9 || strlen($phone_to_check) > 14) {\n\t\t\treturn false;\n\t\t\t} else {\n\t\t\treturn true;\n\t\t\t}\n\t\t}", "private static function validate_number(&$phone)\n\t{\n\t\tif (substr($phone, 0, 1) == '+') {\n\t\t\t$phone = substr($phone, 1);\n\t\t}\n\n\n\t\tif (is_numeric($phone)) {\n\n\t\t\t// test if there's a 1 prepended.\n\t\t\tif (strlen($phone) === 11 && $phone[0] == 1) {\n\t\t\t\t//pop 1 off. \n\t\t\t\t$phone = substr($phone, 1);\n\t\t\t\treturn true;\n\n\t\t\t} elseif (strlen($phone) === 10) {\n\t\t\t\t// it's a 10 digit number... I guess that works.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// is invalid if no return by here. \n\t\treturn false;\n\t}", "function phone_validation($num)\n{\n return preg_match(\"/^[0-9]+$/\", $num);\n}", "function validate_phone($phone)\n{\n $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n // Check the lenght of number\n // This can be customized if you want phone number from a specific country\n if (strlen($filtered_phone_number) != 12) {\n return false;\n } else {\n return true;\n }\n}", "function valid_phone($phone_number)\n\t{\n\t\tif(!is_numeric($phone_number)) {\n\t\t\t$this->form_validation->set_message('phone_number', 'Invalid Phone Number');\n\t\t}\n\t}", "function isValidPhoneNumber(string $phoneNumber): bool{\n return !!preg_match('#\\(\\d{3}\\) \\d{3}-\\d{4}#', $phoneNumber);\n}", "function validPhone($phone)\r\n {\r\n return strlen((string)$phone) == 10 && is_numeric($phone);\r\n }", "public static function validatePhoneNumber($input)\r\n\t{\r\n\t\treturn preg_match('/\\d{3}-\\d{3}-\\d{4}/', $input) && (strlen($input) == 12);\r\n\t}", "public static function validate_telephone($number){\r\n if(!preg_match('/^0([1-9]{2,3})[-. ]([0-9]{5,7})$/', $number)) return FALSE;\r\n return TRUE;\r\n }", "function validPhone($phone)\r\n {\r\n\r\n return !empty($phone) && ctype_digit($phone);\r\n\r\n }", "function isValidPhone($phone) {\n return preg_match(\"/^((0|([\\+][4][4-8]))((7\\d{8}?)|([^7]\\d{6,8})))$/\", $phone);\n}", "public function testPhone()\n {\n $this->assertTrue(RuValidation::phone('+7 (342) 1234567'));\n $this->assertTrue(RuValidation::phone('+7 (41144) 1234'));\n }", "function validate_phone($phone) {\n if (isset($phone) && !preg_match(\"/^[0-9]{10}$/\", $phone) && !empty($phone)) {\n $this->form_validation->set_message('validate_phone', 'This {field} is not valid');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function validPhone($phone)\n {\n //phone number should not be empty and can contain only numbers\n return !empty($phone) && filter_var($phone,FILTER_SANITIZE_NUMBER_INT);\n }", "function checkPhoneNumber($telefono): bool {\n return is_string($telefono) and preg_match(\"/^([+][0-9]{1,3})?[0-9]{4,13}$/\", $telefono);\n}", "function validate_phone_number($phone)\n{\n // $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n // Remove \"-\" and \"+\" from number\n $bad = array(\" \", \"-\", \"+\");\n $phone_to_check = str_replace($bad, \"\", $phone);\n\n // echo $phone_to_check.\"<br>\";\n // Check the lenght of number\n // This can be customized if you want phone number from a specific country\n // $regex = '/^[0-9]+$/';\n if (!filter_var($phone_to_check, FILTER_VALIDATE_INT)) {\n // echo('stringfdssssssssss');\n // die;\n return array('valid' => false, \"msg\" => \"must contain digits 0-9 only.\");\n } elseif (strlen($phone_to_check) < 10 || strlen($phone_to_check) > 14) {\n return array('valid' => false, \"msg\" => \"must be between 10 and 14 digits.\");\n } else {\n return array('valid' => true, \"msg\" => \"\");\n }\n}", "function buzzer_sms_number_validate($element, &$form_state, $form) {\n if ($number = twilio_validate_number($element['#value'], TRUE)) {\n $form_state['values']['buzzer_sms_number'] = $number;\n }\n else {\n form_error($element, t('You must enter a valid 10 digit phone number'));\n }\n}", "function validate($phoneNumber)\n {\n // Let's fix issue of V2: we remove spaces for validation.\n $phoneNumber = str_replace(' ', '', $phoneNumber);\n\n return strlen($phoneNumber) == 10 && is_numeric($phoneNumber);\n }", "private function checkPhone($data) {\n\t\t$data = trim(str_replace(\" \", \"\", $data)); // Remove spaces: \"+1 (212) 555 1337\" ->\"+1(212)5551337\"\n\t\tif(substr($data,0,1)==\"+\") {$data = substr($data,1);} // Remove plus: \"1(212)5551337\"\n\t\t$data = str_replace(\"(\",\"\",$data);\t\t// Remove start parenthesis: \"1212)5551337\"\n\t\t$data = str_replace(\")\",\"\",$data);\t\t// Remove end parenthesis: \"12125551337\"\n\t\tif(is_numeric($data)) {return true;}\t// If it is numeric now, it is a valid phone number\n\t\treturn false;\n\t}", "public static function phone($number)\n {\n $pattern = '/^[0-9\\-\\(\\)\\/\\+\\s]*$/';\n if ((mb_strlen($number) > 254) || !preg_match($pattern, $number)) {\n return false;\n }\n return true;\n }", "function validate_phone($input) {\n // Possible formats: (408) 375-2798, 408-375-2798, 408 375 2798, 4083752798, 408.375.2798\n\n if(preg_match(\"/^[(]?[0-9]{3}[)]?[.\\s-]?[0-9]{3}[.\\s-]?[0-9]{4}$/\",$input)){\n return true;\n }\n \n return false;\n}", "public function validate_fields() {\n\n\t\t\t\t$phone = $this->sanatizePhone( $_POST['havanao_phone_number'] );\n\n\t\t\t\tif ( strlen( trim( preg_replace( '/^(\\+?250)\\d{9}/', '', $phone ) ) ) ) {\n\t\t\t\t\twc_add_notice( __( 'Invalid phone number provided. Please provide a valid Rwanda mobile phone number', 'havanao' ), 'error' );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "static function validPhone($phone)\r\n {\r\n if (preg_match('/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/', $phone)) {\r\n return $phone;\r\n } else {\r\n return !empty($age);\r\n }\r\n }", "function isValidPhoneNumber($phone_number) {\n \t\t\n\t$phone_number_status = false; \n\t\n\t$phone_number = trim($phone_number);\n\t\n\tif (strlen($phone_number) == 12) \n\t{\n\t\t$pattern = \"/^2547(\\d{8})$/\";\n\t\tif (preg_match($pattern, $phone_number)) {\n\t\t\t$phone_number_status = true;\n\t\t}\n\t}\n\t\n\tif (strlen($phone_number) == 13) \n\t{\n\t\t$pattern = \"/^\\+2547(\\d{8})$/\";\n\t\tif (preg_match($pattern, $phone_number)) {\n\t\t\t$phone_number_status = true;\n\t\t}\n\t}\n\t\n\tif (strlen($phone_number) == 10) \n\t{\n\t\t$pattern = \"/^07(\\d{8})$/\";\n\t\tif (preg_match($pattern, $phone_number)) {\n\t\t\t$phone_number_status = true;\n\t\t}\n\t}\n\n\tif (strlen($phone_number) == 9) \n\t{\n\t\t$pattern = \"/^7(\\d{8})$/\";\n\t\tif (preg_match($pattern, $phone_number)) {\n\t\t\t$phone_number_status = true;\n\t\t}\n\t}\n\n return $phone_number_status;\n\t\n}", "function validate_phone($field_input, array &$field): bool\n{\n $default = \"/\\+3706(\\d{7})$/\";\n\n if (!empty($field_input)) {\n if (!preg_match_all($default, $field_input)) {\n $field['error'] = 'Number must be like +3706XXXXXXX';\n }\n }\n\n return true;\n\n}", "function isLegalPhoneNum($test)\n{\n\tif(preg_match(\"/^\\([0-9]{3}\\) [0-9]{4}-[0-9]{4}$/\", $test))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function validate_phone_format($phone) {\n if (preg_match('/^[+]?([\\d]{0,3})?[\\(\\.\\-\\s]?([\\d]{3})[\\)\\.\\-\\s]*([\\d]{3})[\\.\\-\\s]?([\\d]{4})$/',$phone, $number)) {\n \t$number = $number[2] . '-' . $number[3] . '-' . $number[4];\n\t\treturn $number;\n } else return FALSE;\n}", "public function testPhone()\n {\n $this->assertFalse(BrValidation::phone('teststring'));\n $this->assertFalse(BrValidation::phone('1-(33)-(333)-(4444)'));\n $this->assertFalse(BrValidation::phone('1-(33)-3333-4444'));\n $this->assertFalse(BrValidation::phone('1-(33)-33-4444'));\n $this->assertFalse(BrValidation::phone('1-(33)-3-44444'));\n $this->assertFalse(BrValidation::phone('1-(33)-3-444'));\n $this->assertFalse(BrValidation::phone('1-(33)-3-44'));\n $this->assertFalse(BrValidation::phone('2345678'));\n\n // with the wrong extra digit\n $this->assertFalse(BrValidation::phone('55 (48) 12345 6789'));\n $this->assertFalse(BrValidation::phone('+55 (48) 22345 6789'));\n $this->assertFalse(BrValidation::phone('+55 (048) 32345 6789'));\n $this->assertFalse(BrValidation::phone('+55 (48) 42345-6789'));\n $this->assertFalse(BrValidation::phone('+55 (48) 52345.6789'));\n $this->assertFalse(BrValidation::phone('(48) 12345 6789'));\n\n $this->assertTrue(BrValidation::phone('55 (48) 2345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 2345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (048) 2345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 2345-6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 2345.6789'));\n $this->assertTrue(BrValidation::phone('(48) 2345 6789'));\n $this->assertTrue(BrValidation::phone('2345-6789'));\n $this->assertTrue(BrValidation::phone('2345.6789'));\n $this->assertTrue(BrValidation::phone('23456789'));\n\n // // with the extra digit\n $this->assertTrue(BrValidation::phone('55 (48) 92345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 92345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (048) 92345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 92345-6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 92345.6789'));\n $this->assertTrue(BrValidation::phone('(48) 92345 6789'));\n $this->assertTrue(BrValidation::phone('92345-6789'));\n $this->assertTrue(BrValidation::phone('92345.6789'));\n $this->assertTrue(BrValidation::phone('923456789'));\n }", "public function isValidPhone($phone) {\n $valid = \"<^((\\\\+|00)[1-9]\\\\d{0,3}|0 ?[1-9]|\\\\(00? ?[1-9][\\\\d ]*\\\\))[\\\\d\\\\-/ ]*$>\";\n if (strlen(trim($phone)) >= 6 && preg_match($valid, trim($phone))) {\n return true;\n }\n return false;\n }", "public function valid_phone($str)\n\t{\n\t\treturn ( ! ereg(\"^[0-9]{3}-[0-9]{3}-[0-9]{4}$\", $str)) ? FALSE : TRUE;\n\t}", "public function validateContactNumber()\n {\n if(! ctype_digit($this->Landline))\n $this->addError('Landline', 'Invalid landline.');\n }", "function validate_mobile_number($mobile){\n if(preg_match('/^((\\+){0,1}91(\\s){0,1}(\\-){0,1}(\\s){0,1})?([0-9]{10})$/', $mobile,$matches)){\n return true;\n }\n return false;\n}", "public function is_phonenumber($contact_no){\t\t\n\t\tif (!empty($contact_no) && !ctype_digit($contact_no)){\n\t\t\treturn true;\n\t\t}\n }", "public function is_phonenumber($contact_no){\t\t\n\t\tif (!empty($contact_no) && !ctype_digit($contact_no)){\n\t\t\treturn true;\n\t\t}\n }", "public static function e123_phone_regex() {\r\n\t\treturn '^\\+[1-9][0-9 ]+$';\r\n\t}", "public static function phone($err) { \n\t\treturn new VRule(function($val) {\n\t\t\treturn preg_match('/(\\d{10,})/', preg_replace('/\\D/', '', $val)) > 0;\n\t\t}, $err);\n\t}", "function validateMobileNumber($field)\n{\n if (preg_match(\"/^(\\s*|(009665|9665|\\+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7}))$/\", $field)) {\n return $field;\n } else {\n return false;\n }\n}", "public function isValidPhone($phone) {\n $valid = \"/^[\\d\\s\\/\\(\\)-+]/\";\n if (strlen(trim($phone)) >= 6 && preg_match($valid, trim($phone))) {\n return true;\n }\n return false;\n }", "function mycheck_phone( $string ) {\n if ( preg_match( '/^[+]?([\\d]{0,3})?[\\(\\.\\-\\s]?([\\d]{3})[\\)\\.\\-\\s]*([\\d]{3})[\\.\\-\\s]?([\\d]{4})$/', $string ) ) {\n return TRUE;\n } else {\n return FALSE;\n }\n}", "public static function validatePhoneNumber($input, $is_required)\n {\n $input = trim($input);\n\n if ($is_required == FALSE && strlen($input) == 0) {\n return TRUE;\n }\n\n if ($is_required == TRUE && strlen($input) < 5) {\n return FALSE;\n }\n $prepared_input = preg_replace(\"^\\\\s^\", \"\", $input);\n\n if (preg_match(\"[\\\\D]\", $prepared_input) == TRUE || strlen($prepared_input) < 6 || strlen($prepared_input) > 16) {\n return FALSE;\n } else {\n return TRUE;\n }\n }", "public function validate(string $number): bool;", "public function test_phone_returns_true_when_not_optional_input_phone_10_area_bracket() {\n\t\t$optional = false;\n\t\t$result = self::$validator->validate('(555)555-5555', $optional);\n\t\t$this->assertTrue( $result );\n\t}", "public function test_phone_returns_false_when_optional_input_not_phone() {\n\t\t$optional = true;\n\t\t$result = self::$validator->validate('not a phone num', $optional);\n\t\t$this->assertFalse( $result );\n\t}", "function checkPhoneNumberPattern($value): string\r\n{\r\n if (is_numeric($value) && strlen($value) === 10) {\r\n return 'this is a correct phone number';\r\n } else {\r\n return 'this is NOT a correct phone number';\r\n }\r\n}", "function is_valid_mobile($mobile)\n{\n if (is_null($mobile) || strlen($mobile) != 11)\n {\n return false;\n }\n $pattern = \"/^1(3|4|5|7|8)\\d{9}$/\";\n return preg_match($pattern, $mobile) == 1;\n}", "public function test_phone_returns_false_when_not_optional_input_not_phone() {\n\t\t$optional = false;\n\t\t$result = self::$validator->validate('not a phone num', $optional);\n\t\t$this->assertFalse( $result );\n\t}", "private function validatePhone($phone)\n {\n $phone = preg_replace('/[^\\d]/', '', $phone);\n return $phone;\n }", "function phoneNum($value) {\n\t$reg = \"/^\\([1-9]\\d{2}\\)\\s?\\d{3}\\-\\d{4}$/\";\n\treturn preg_match($reg,$value);\n}", "public static function isPhoneNumber($input) {\n return preg_match(\"/^[0-9\\+ ]{9,20}$/\", $input);\n }", "public function test_phone_returns_true_when_optional_input_phone_10_area_bracket() {\n\t\t$optional = true;\n\t\t$result = self::$validator->validate('(555)555-5555', $optional);\n\t\t$this->assertTrue( $result );\n\t}", "static function is_phone($phone) {\n $stripped=preg_replace(\"(\\(|\\)|\\-|\\.|\\+|[ ]+)\",\"\",$phone);\n return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>16)))?false:true;\n }", "public function validPhone($phone)\n {\n if (strlen($phone) > 0 && strlen($phone) < 8) {\n return false;\n }\n\n return true;\n }", "protected function validatePhone($attribute, $value, $parameters)\n {\n // and braces.\n return preg_match(\"/^([0-9\\s\\-\\+\\(\\)]*)$/\", $value);\n }", "protected function validatePhone(string $identifier, mixed $value): bool\n {\n $invalid = ['+', '-', '_', '.', '(', ')'];\n $filtered = filter_var($value, FILTER_SANITIZE_NUMBER_INT);\n\n foreach($invalid as $character){\n $filtered = str_replace($character, '', $filtered);\n }\n\n return strlen($filtered) > 7 && strlen($filtered) < 14;\n }", "function validate_phone_num($nr)\n{\n $tel = preg_replace('/\\D+/', '', $nr);\n if (substr($tel, 0, 1) !== '0') {\n $int = substr_replace($tel, \"0\", 0, 0);\n }\n $tel = substr_replace($tel, \" 0 \", 0, 1);\n $tel = wordwrap($tel, 3, ' ', true);\n if (strlen($tel) != 13) {\n $status['sta'] = \"has-warning\";\n $status['err'] = 1;\n $_SESSION['message'] = \"Atentie! Numarul de telefon trebuie sa aiba exact 10 cifre\";\n $_SESSION['status'] = \"warning\";\n $_SESSION['icon'] = \"glyphicon-phone-alt\";\n } else {\n $status['sta'] = \"has-success\";\n $status['err'] = null;\n }\n $status['tel'] = $tel;\n return $status;\n}", "function fn_validate_cc_number($number, $show_error = false)\n{\n if (empty($number)) {\n return false;\n }\n\n $number = str_replace(array('-',' '), '', $number);\n\n if (preg_match('/^([?0-9]{13,19}|[?*\\d]+)$/', $number)) {\n return true;\n } elseif ($show_error) {\n fn_set_notification('E', __('error'), __('text_not_valid_cc_number', array(\n '[cc_number]' => $number\n )));\n }\n\n return false;\n}", "function oncall_member_edit_form_validate($form, &$form_state) {\n $phone_validator = array( \n 'us' => '/^(1([-\\. ]?\\d{3})[-\\. ]?)?(\\d{3})([-\\. ]?\\d{4})$/',\n 'uk' => '/^(44\\s?7\\d{3}|\\(?07\\d{3}\\)?)\\s?\\d{3}\\s?\\d{3}$/',\n 'uae' => '/^(97[\\s]{0,1}[\\-]{0,1}[\\s]{0,1}1|0)50[\\s]{0,1}[\\-]{0,1}[\\s]{0,1}[1-9]{1}[0-9]{6}$/',\n 'nz' => '/^\\([0]\\d{2}\\))(\\d{6,7}$/',\n );\n\n $validate = variable_get('oncall_validate_phone', 'none');\n if (isset($phone_validator[$validate])) {\n if (!preg_match($phone_validator[$validate], $form_state['values']['oncall_phone'])) {\n form_set_error('oncall_phone', t('That does not look like a valid telephone number'));\n } \n }\n}", "function contains_phone_number($string)\r\n{\r\n // Check for phone number\r\n if(ereg(\"[[:digit:]]{3,10}[\\. /\\)\\(-]*[[:digit:]]{6,10}\", $string))\r\n {\r\n return(true);\r\n }\r\n\r\n // Passed the test\r\n return(false);\r\n}", "public static function checkPhone($phone)\n {\n if (strlen($phone) >= 10) {\n return true;\n }\n return false;\n }", "function vUSPhone( $phoneNo )\r\n\t\t{\r\n\t\t\t# Checks if number has dashes\r\n\t\t\tif( strpos( $phoneNo,'-' ) )\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?[-\\s.]?\\d{3}[-\\s.]\\d{4}/x', $phoneNo);\r\n\t\t\t\t\r\n\t\t\t# Checks if number has periods\r\n\t\t\telseif( strpos( $phoneNo,'.' ) )\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?[.]?\\d{3}[.]\\d{4}/x', $phoneNo);\r\n\t\t\t\r\n\t\t\t# Validate just numbers\t\r\n\t\t\telse\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?\\d{3}\\d{4}/x', $phoneNo);\r\n\t\t\t\r\n\t\t}", "private function checkNumero($tel)\n {\n $pattern = '/\\+\\d{2}+[0-9]{9,15}|[0-9]{9,15}/';\n if (!preg_match($pattern, $tel)){\n echo \"<br>ERRORE nel numero di telefono : \".$tel;\n throw new InvalidArgumentException();\n }\n else return true;\n }", "function isBadPhone( string $field )\r\n {\r\n \r\n return ( array_search( $field, BAD_PHONES ) !== false || !preg_match( ALLOWED_CODES, $field ) ); \r\n }", "public function testValidatePhoneNumber__ReturnsValid_GivenCountrycodeNoDialingCodeRequiredTrue()\n {\n $person = new StdPerson;\n\n $this->assertEquals(\n 'Please enter a valid phone number',\n $person->validatePhoneNumber(\"+44 360832\", true)\n );\n }", "public function validation_phone_number($phone_number,$password){\n\t\t\t// $user_details=$this->db->get('users')->result_array();\n\n\t\t\t$this->db->where('phone_number',$phone_number);\n\t\t\t$this->db->where('password',$password);\n\t\t\t$query = $this->db->get('users');\n\t\t\tif($query->num_rows() > 0 ){\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\t\n\t\t}", "public function validation_phone_number($phone_number,$password){\n\t\t\t// $user_details=$this->db->get('users')->result_array();\n\n\t\t\t$this->db->where('phone_number',$phone_number);\n\t\t\t$this->db->where('password',$password);\n\t\t\t$query = $this->db->get('users');\n\t\t\tif($query->num_rows() > 0 ){\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\t\n\t\t}", "function validate_mobile($mobile)\n{\n return preg_match('/^[0-9]{12}+$/', $mobile);\n}", "private function valid_mobile() {\n return (strlen($this->mobile) == 10 && is_numeric($this->mobile));\n }", "function validatePhone($id){\n global $isValidSSWelcome;\n //remove basic phone characters\n $id = str_replace(\" \",\"\",$id);\n $id = preg_replace('/-/',\"\",$id);\n $id = preg_replace('/\\(/',\"\",$id);\n $id = preg_replace('/\\)/',\"\",$id);\n $id = preg_replace('/_/',\"\",$id);\n //echo \"<p>$id</p>\"; for de-bugging purposes\n if (is_numeric($id) && strlen($id)===10){\n return;\n }\n else{\n echo \"<p>Valid Phone Number must be entered</p>\";\n $isValidSSWelcome = false;\n }\n}", "function validateTelNum($num)\r\n {\r\n preg_match_all($this->re, $num, $matches, PREG_SET_ORDER, 0);\r\n if (empty($matches)) {\r\n $this->invalid_number[] = $num;\r\n return \"invalid number\";\r\n } else {\r\n return $num;\r\n }\r\n }", "public static function is_e123_phone($in) {\r\n\t\t$regex = '@' . self::e123_phone_regex() . '@';\r\n\t\treturn preg_match($regex, $in);\r\n\t}", "function comprobarTelefono($telefono){\r\n if(!preg_match(\"/^[0-9]{9}$/\", $telefono)){\r\n return false;\r\n }\r\n return true;\r\n}", "function isPhoneNumber($string) {\n\tif(preg_match(\"/^(1?(?: |\\-|\\.)?(?:\\(\\d{3}\\)|\\d{3})(?: |\\-|\\.)?\\d{3}(?: |\\-|\\.)?\\d{4})$/\",$string)==1)\n\t\t\treturn true;\n\telse\n\t\t\treturn false;\n}", "public static function validatePhoneNumber($phoneNumber) {\n $response = array(\n 'status' => false,\n 'message' => '',\n );\n try {\n $phonePrefix = substr($phoneNumber, 0, 2);\n if ($phonePrefix == '44') {\n $phoneNumber = substr($phoneNumber , 2);\n }\n $phonePrefix = substr($phoneNumber, 0, 1);\n if ($phonePrefix != '0') {\n $phoneNumber = '0'. $phoneNumber;\n }\n $clientId = env('PHONE_VALIDATE_API_KEY', '');\n $countryCode = config('appConstants.phone_validate_default_country');\n $client = new Client();\n $res = $client->request('GET', 'http://apilayer.net/api/validate'\n . '?access_key='.$clientId\n . '&country_code='.$countryCode\n . '&format=1'\n . '&number='.$phoneNumber);\n if($res->getStatusCode() == '200') {\n $responseBody = json_decode($res->getBody(), true);\n if (isset($responseBody['valid'])\n && $responseBody['valid']) {\n $response['status'] = true;\n } else {\n if (isset($responseBody['error'])) {\n self::event($responseBody['error'], self::VALIDATE_PHONE_LOG_FILE, self::DAILY);\n }\n }\n } else {\n $response['message'] = trans('messages.validate_phone_api_error');\n }\n } catch (Exception $ex) {\n $response['message'] = $ex->getMessage();\n self::event($ex->getMessage() . \"|\" . $ex->getLine(), self::VALIDATE_PHONE_LOG_FILE, self::DAILY);\n }\n return $response;\n }", "public function testPhone() {\n $this->assertEquals('666-1337', Format::phone(6661337));\n $this->assertEquals('(888) 666-1337', Format::phone('8886661337'));\n $this->assertEquals('1 (888) 666-1337', Format::phone('+1 8886661337'));\n }", "public function PhoneNoCheck($phone=\"\"){\n\t\t\t\n\t\t// if (preg_match(\"/^\\(?(\\d{3})\\)?[-\\. ]?(\\d{3})[-\\. ]?(\\d{4})$/\",$phone))\n\t\t if (preg_match(\"/^\\s*(?:\\+?(\\d{1,3}))?[-. (]*(\\d{3})[-. )]*(\\d{3})[-. ]*(\\d{4})(?: *x(\\d+))?\\s*$/\",$phone))\n\t\t\treturn true;\n\t\telse\n\t\t return false;\n\t\t}", "function verifyPhone ($testString) {\n $regex = '/^(?:1(?:[. -])?)?(?:\\((?=\\d{3}\\)))?([2-9]\\d{2})(?:(?<=\\(\\d{3})\\))? ?(?:(?<=\\d{3})[.-])?([2-9]\\d{2})[. -]?(\\d{4})(?: (?i:ext)\\.? ?(\\d{1,5}))?$/';\n\treturn (preg_match($regex, $testString));\n}", "function validateHomePhoneNumber($string){\n\tif($string == '') {return '';}\n\tif(!preg_match(\"/^\\d{10}$/\", $string)){\n\t\treturn 'Home phone number is invalid </br>';\n\t}\n\treturn '';\n}", "abstract public function validateNumber(): bool;", "function checkPhoneNumberValidity($phoneNum='')\n\t{\n\t\tglobal $db737;\n\t\tif(!$phoneNum)\n\t\t\treturn;\n\t\t$phoneNumber =phoneNumberCheck($phoneNum);\n\t\tif($phoneNumber){\n\t\t\t$sql =\"select PHONE_NUM from newjs.PHONE_JUNK WHERE PHONE_NUM IN('$phoneNumber','0$phoneNumber')\";\n\t\t $res = mysql_query($sql,$db737) or die(\"$sql\".mysql_error($db737));\n\t\t if($row = mysql_fetch_array($res))\n\t\t\t\t$phoneJunk =true;\n\t\t}\n\t\tif($phoneNumber && !$phoneJunk)\n\t\t\treturn $phoneNumber;\n\t\treturn;\t\n\t}", "public function isValid($number);", "public function testValidatePhoneNumber__ReturnsValid_GivenCountrycodeNoDialingCodeRequiredFalse()\n {\n $person = new StdPerson;\n\n $this->assertEquals(\n 'Please enter a valid phone number',\n $person->validatePhoneNumber(\"+44 360832\", false)\n );\n }", "public static function isPhoneNumber($number)\n {\n return preg_match('/^[+0-9. ()-]*$/', $number);\n }", "public static function phone($number, $lengths = NULL)\r\n {\r\n if ( ! is_array($lengths))\r\n {\r\n $lengths = array(7,10,11);\r\n }\r\n\r\n // Remove all non-digit characters from the number\r\n $number = preg_replace('/\\D+/', '', $number);\r\n\r\n // Check if the number is within range\r\n return in_array(strlen($number), $lengths);\r\n }", "function validateBusinessPhoneNumber($string){\n\tif($string == '') {return 'Business Phone number is required </br>';}\n\tif(!preg_match(\"/^\\d{10}$/\", $string)){\n\t\treturn 'Business phone number is invalid </br>';\n\t}\n\treturn '';\n}", "public static function validate_number($number){\r\n if(!preg_match('/^[0-9]*$/', $number)) return FALSE;\r\n return TRUE;\r\n }", "public function hasInvalidPhone($string) : bool\n {\n $nums = strlen(\n preg_replace(\n \"/[^0-9]/\", \"\", $string\n )\n ); \n return ($nums < 10 || $nums > 11) ? true && $this->setError(true) : false;\n }", "public static function phone($number)\n\t{\n\t\t// Remove o que não for número\n\t\t$number = preg_replace('/\\D/', '', $number);\n\n\t\t// Nenhum formato conhecido\n\t\tif (strlen($number) < 8) {\n\t\t\treturn $number;\n\t\t}\n\n\t\t// Até 9 dígitos\n\t\tif (strlen($number) <= 9) {\n\t\t\treturn preg_replace('/(\\d{4})(\\d*)/', '$1-$2', $number);\n\t\t}\n\n\t\t// Demais formatos\n\t\treturn preg_replace('/(\\d{2})(\\d{4})(\\d*)/', '($1) $2-$3', $number);\n\t}", "function parseUSPhoneNumber($phoneNumber){\n\t\t$input = preg_replace('/\\D/', '', $phoneNumber);\n\t\t$areaCode;\n\t\t$phone;\n\t\t//if it's not 10 or 11 in length we have an issue\n\t\tif(strlen($input) == 11){\n\t\t\t$areaCode = substr($input, 1,3);\n\t\t\t$phone = substr($input, 4,7);\n\t\t\treturn [\"area\" => $areaCode, \"phone\" => $phone];\n\t\t} else if(strlen($input) == 10){\n\t\t\t$areaCode = substr($input, 0,3);\n\t\t\t$phone = substr($input, 3,7);\n\t\t\treturn [\"area\" => $areaCode, \"phone\" => $phone];\n\t\t\t//(123)123-1234\n\t\t}\n\t\treturn false;\n\t}", "public function testMobileNumberIsValid($data)\n {\n $pattern = \"/^[(]{0,1}[0-9]{2,3}[)]{0,1}[-\\s\\.]{0,1}[0-9]{2,4}[-\\s\\.]{0,1}[0-9]{4}$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "public function phoneValidate(\n $number,\n $countryCode = null,\n $ip = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/phone-validate';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'user-id' => Configuration::$userId,\n 'api-key' => Configuration::$apiKey,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //prepare parameters\n $_parameters = array (\n 'output-case' => 'camel',\n 'number' => $number,\n 'country-code' => $countryCode,\n 'ip' => $ip\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::post($_queryUrl, $_headers, Request\\Body::Form($_parameters));\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'NeutrinoAPILib\\\\Models\\\\PhoneValidateResponse');\n }", "public function hasVerifiedPhone();", "function filterphone($field) {\n $pattern = \"/^[0-9\\_]{9,10}/\";\n //validate phone number\n if (preg_match($pattern,$field)){ \n return $field;\n }else{\n return FALSE;\n }\n}", "public static function validate_phone( $field_names ) {\n\t\tif ( is_array( $field_names ) ) {\n\t\t\tforeach ( $field_names as $field )\n\t\t\t\tself::validate_phone( $field );\n\n\t\t\treturn; // We're done with this method at this point\n\t\t}\n\t\t\n\t\t// Don't try to validate blank data (this allows optional fields to be validated only if they've been filled out)\n\t\tif ( $_POST[$field_names] === '' )\n\t\t\treturn;\n\t\t\n\t\t// Check if the formatting is valid\n\t\tif ( ! self::is_invalid( $field_names ) && ! preg_match( '/^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/', $_POST[$field_names] ) )\n\t\t\tself::log_error( $field_names, ERROR_PHONE_FORMAT );\n\t}", "public function verify_phone_number()\n\t{\n\t\t$user_id = Input::get('userId');\n\t\t$verification_code = Input::get('verificationCode');\n\n\t\tif ($this->notifyRepo->smsVerificationCheck($user_id, $verification_code))\n\t\t{\n\t\t\t$this->notifyRepo->smsSaveVerifiedPhoneNumber($user_id);\n\t\t\t$this->notifyRepo->smsDeleteVerifyRecord($user_id);\n\t\t\t$valid = [\n\t\t\t\t'status' => true,\n\t\t\t\t'message' => 'Your phone number has been verified.'\n\t\t\t];\n\t\t\treturn $valid;\n\t\t}\n\n\t\t$valid = [\n\t\t\t'status' => false,\n\t\t\t'message' => 'The code you entered does not match the code we sent you.'\n\t\t];\n\t\treturn $valid;\n\t}", "public function phoneCheck($phone){\n\t\t\t$sql = \"SELECT Contact_Number FROM customer WHERE Contact_Number = :Contact_Number\";\n\t\t\t$query = $this->db->pdo->prepare($sql);\n\t\t\t$query->bindValue(\":Contact_Number\", $phone);\n\t\t\t$query->execute();\n\n\t\t\tif ($query->rowCount() > 0) {\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function phone($phone = null);", "public function is_phone_number_specified($username = '')\n {\n\n if($username) $this->username = $username;\n\n\n $cp = database::getInstance()->get('user',\"CP\",[\n\n \"isVerify\" => user_type::PHONE_NUMBER_VERIFIED,\n\n \"verification_code[!]\" => null,\n\n \"user_url\" => $this->username\n\n ]);\n\n\n return preg_match(REGEX::PHONE_NUMBER,$cp);\n\n }", "static public function isPhoneNumber($phoneNumber)\n {\n return preg_match('/^[+0-9. ()-;]*$/', $phoneNumber);\n }", "public function typePhone($number)\n {\n try {\n // Initialize CURL:\n $ch = curl_init('http://apilayer.net/api/validate?access_key='.$this->tokenPhone.'&number='.$number.'');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // Store the data:\n $json = curl_exec($ch);\n curl_close($ch);\n\n // Decode JSON response:\n $validationResult = json_decode($json, true);\n\n if($validationResult['valid']){\n return $validationResult['line_type'];\n }\n return false;\n } catch (\\Exception $e){\n return false;\n }\n }", "function nrua_sanitize_phone_number( $phone_mobile )\n{\n\t// = Remove all non int chars\n\t$phone_mobile = filter_var( $phone_mobile, FILTER_SANITIZE_NUMBER_INT );\n\t$phone_mobile = str_replace(\"+\", \"\", $phone_mobile);\n\t$phone_mobile = str_replace(\"-\", \"\", $phone_mobile);\n\t\n\t// = Add the international char\n\t$phone_mobile = '+' .$phone_mobile;\n\t\n\t// = Check lenght\n\tif ( ( strlen( $phone_mobile ) < 10 ) || ( strlen( $phone_mobile ) > 14 ) ) \n\t{\n\t\t$phone_mobile = null;\n\t}\n\t\n\treturn $phone_mobile;\n}" ]
[ "0.826107", "0.8146867", "0.80432236", "0.7989112", "0.7952532", "0.7930814", "0.7906691", "0.7869428", "0.782557", "0.78233105", "0.77366245", "0.7669982", "0.76321816", "0.76309514", "0.7517778", "0.7479392", "0.745683", "0.74535406", "0.7453168", "0.74396807", "0.74049157", "0.73988616", "0.73971045", "0.735441", "0.734913", "0.73420346", "0.7298006", "0.7289879", "0.7273461", "0.7267642", "0.7259988", "0.7201354", "0.7155275", "0.7155275", "0.7152769", "0.71427405", "0.71194607", "0.7075058", "0.70657605", "0.70486486", "0.7038425", "0.7036631", "0.70316", "0.70307326", "0.7027455", "0.700439", "0.6978158", "0.69728845", "0.69654346", "0.6961389", "0.6939906", "0.6927993", "0.6918214", "0.691803", "0.6899682", "0.6892312", "0.6880804", "0.6871353", "0.68637216", "0.68369114", "0.68313324", "0.6819425", "0.681816", "0.6810857", "0.6810857", "0.68003035", "0.6787774", "0.6758224", "0.6756291", "0.67517906", "0.6723528", "0.672293", "0.67218435", "0.67046875", "0.6690832", "0.6665663", "0.66606593", "0.6647027", "0.6643972", "0.66369116", "0.66365904", "0.65947914", "0.6563533", "0.6562984", "0.6560396", "0.6541257", "0.6528505", "0.65077436", "0.64341295", "0.64256394", "0.6420999", "0.64092726", "0.6402326", "0.6360994", "0.6349948", "0.63305205", "0.6289011", "0.62818915", "0.6239332", "0.6230886" ]
0.6798838
66
Sets the data class variable
public function set_data($data) { $this->data = $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setData($data) {}", "public function setData($data)\n {\n $this->_data = $data;\n }", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}", "function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}", "function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}", "function setData($data)\n {\n $this->data = $data;\n }", "final public function setData($data) {\n $this->data = $data;\n }", "public function setData($data) { \n $this->data = $data; \n }", "public function setData() \n {\n // Empty, to be overridden \n }", "private function setData($data)\n {\n \t$this->data = $data;\n }", "public function setData( $data )\n {\n $this->data = $data;\n }", "public function setData($data) {\n $this->data = $data;\n }", "public function setData($data)\r\n\t{\r\n\t\t$this->data = $data;\r\n\t}", "public function setData($_data)\n {\n $this->_data = $_data;\n }", "public function set($data);", "public function setData($data) \n\t{\n $this->data = $data;\n }", "public function setData()\n {\n }", "public function setData()\n {\n }", "public function setData()\n {\n }", "public function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}", "public function setData($data)\n {\n $this->data = $data;\n }", "public function setData($data)\n {\n $this->data = $data;\n }", "public function setData($data)\r\n {\r\n }", "private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }", "protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }", "function set(array $data) {\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "public function set_data($data)\n {\n }", "public function set_data($data)\n {\n }", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setData($data);", "public function setDatas()\n\t{\n\t\t$this->data[\"skeleton\"] = $this->getSkeleton();\n\t\t$this->data[\"css\"] = $this->getCss();\n\t\t$this->data[\"javascript\"] = $this->getJavascript();\n\t\t$this->data[\"module\"] = $this->getModule();\n\t\t$this->data[\"site\"] = $this->getSite();\n\t\t\t\t\t\t\n\t\t$this->_nodeName = $this->getNodeName();\n\t\t$this->_value = $this->getNodeValue();\n\t}", "function setData($data){\n\t\tif(!is_array($data)){\n\t\t\tvar_dump($data);\n\t\t\texit;\n\t\t}\n\t\tforeach($data as $key => $value){\n\t\t\tif(isset(static::$fields[$key]) && static::$fields[$key]['type']=='enum'){\n\t\t\t\tif($value){\n\t\t\t\t\tif(!in_array(strtoupper($value), static::$fields[$key]['values'])){\n\t\t\t\t\t\treturn RetErrorWithMessage('INCORRECT_VALUE', preg_replace('/.+\\\\\\/si', '', get_called_class()).': Wrong field value('.$value.'), field \"'.$key.'\" can be one of: '.print_r(static::$fields[$key]['values'], true));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value = strtoupper($value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->{$key} = $value;\n\t\t}\n\t\tforeach(static::$fields as $field_name => $option){\n\t\t\tif(!isset($this->{$field_name})){\n\t\t\t\tif($option['default']){\n\t\t\t\t\t$this->{$field_name} = $option['default'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n $this->instance_generated = true;\n\t\treturn null;\n\t}", "public function setData($data): void\n {\n $this->data = $data;\n }", "public function setData($data)\n\t{\n\t\t$this->_data = unserialize($data);\n\t\t$this->_hashFunc = $this->_data['hashFunc'];\n\t}", "public function dtgClassVariable_Bind() {\n\t\t\t$this->dtgClassVariable->TotalItemCount = ClassVariable::CountAll();\n\n\t\t\t$objClauses = array();\n\t\t\tif ($objClause = $this->dtgClassVariable->OrderByClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\tif ($objClause = $this->dtgClassVariable->LimitClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\t$this->dtgClassVariable->DataSource = ClassVariable::LoadAll($objClauses);\n\t\t}", "function setData($data)\n {\n $this->date=$data;\n }", "protected function setData($data) {\n $this->data = collect($data);\n }", "public static function setData(Data $data)\n {\n self::$data = $data;\n }", "public function setData($data){\n\t\t$this->_storage = $data;\n\t\t\n\t\t// set update flag\n\t\t$this->_isModified = true;\n\t\t\n\t\t// new data available\n\t\t$this->_dataAvailable = true;\n\t}", "protected function assignMemberVariables(array $data)\n {\n foreach ($data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function setData(array $data) {\n\t\t$this->_data = $data;\n\t}", "public function __construct($data){\r\n $this->data = $data;\r\n }", "public function setData()\n {\n $this->data=new \\DateTime('now');\n\n }", "public function setClass($class){\n $this->_class = $class;\n }", "public static function setData($data)\n {\n self::$rawData = $data;\n }", "public function __set($var,$val)\n\t{\n\t\t$this->data[$var] = $val;\n\t}", "function set_data($name, $value) {\n $this->data[$name] = $value;\n }", "public function __construct($data)\n {\n $this->_data = $data;\n }", "public function __construct($data)\n {\n $this->_data = $data;\n }", "public function initialize()\n {\n $this->data = new stdClass();\n }", "public function load_data( $data ) {\r\n foreach ( $data as $key => $value ) {\r\n $this->$key = $value;\r\n }\r\n }", "function __construct()\n {\n $this->_data = array();\n }", "function __construct($data){\n\t $this->data=$data;\n }", "private function setData()\n {\n if ($this->config->has('auth.external_concrete')) {\n $data = $this->config->get('auth.external_concrete', '');\n } else {\n // legacy support\n $data = $this->config->get('auth.external_concrete5', '');\n }\n $authUrl = $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete/attempt_auth']);\n $attachUrl = $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete/attempt_attach']);\n $baseUrl = $this->urlResolver->resolve(['/']);\n $path = $baseUrl->getPath();\n $path->remove('index.php');\n $name = trim((string) array_get($data, 'name', t('External concrete')));\n\n $this->set('data', $data);\n $this->set('authUrl', $authUrl);\n $this->set('attachUrl', $attachUrl);\n $this->set('baseUrl', $baseUrl);\n $this->set('assetBase', $baseUrl->setPath($path));\n $this->set('name', $name);\n $this->set('user', $this->app->make(User::class));\n }", "public function __construct ($data)\n {\n $this->_data = $data;\n }", "function set($data) {\n\tif (! is_object($data)) throw new Exception('Supplied argument is not an object.');\n\t\n\tforeach (get_object_vars($data) as $prop=>$val) {\n\t if (property_exists($this,$prop)) {\n\t\t$this->$prop = $val;\n\t }\n\t}\n\t\n }", "private function setData($data) {\r\n\t\t$this->set_cd_jogo($data[\"cd_jogo\"]);\r\n\t\t$this->set_nm_jogo($data[\"nm_jogo\"]);\r\n\t\t$this->set_vl_jogo($data[\"vl_jogo\"]);\r\n\t\t$this->set_ds_sinopse(utf8_decode($data[\"ds_sinopse\"]));\r\n\t\t$this->set_dt_lancamento($data[\"dt_lancamento_jogo\"]);\r\n\t\t$this->set_ds_requisito_minimo($data[\"ds_requesito_minimo\"]);\r\n\t\t$this->set_ds_requisito_sugerido($data[\"ds_requesito_sugerido\"]);\r\n\t}", "public function setClass($class) {\r\n\t$this->class = $class;\r\n }", "public function __construct($data) {\n $this->data = $data;\n }", "public function setData($data) {\n $this->data = (string) $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "function setAllData(&$data) {\n\t\t$this->_data =& $data;\n\t}", "public function setData (array $data) : void {\n\t\t$this->data = $data;\n\t}", "public function setData($data)\n {\n $this->data = $data;\n $this->normalizedData = $this->normalize($data);\n $this->transformedData = $this->transform($this->normalizedData);\n }", "private function setData($data){\n\t\n\t\t$this->setIdusuario($data['idusuario']);\n\t\t$this->setDeslogin($data['deslogin']);\n\t\t$this->setDessenha($data['dessenha']);\n\t\t$this->setDtcadastro(new DateTime($data['dtcadastro']));\t\t\n\t}", "public function set_all_data($data)\n\t{\n\t\t$this->_data = $data;\n\t}", "function __data() {\n\t\tif ($data = $this->Session->read('data')) {\n\t\t\tforeach ($data as $k => $i) {\n\t\t\t\t$obj = ClassRegistry::init($k);\n\t\t\t\t$this->data[$k] = $i;\n\t\t\t}\n\t\t\t$this->Session->write('data', null);\n\t\t}\n\t\t// attempts to remember identity of commentor and prefill fields\n\t\tif (empty($this->data['Comment']) && $data = $this->Cookie->read('CommentUser')) {\n\t\t\t$this->data['Comment'] = $data;\n\t\t}\n\t}", "public function initialize()\n\t{\n\t\t$this->data = new stdClass();\n\t}", "public function setObjectData(&$data)\n {\n $objVarNames = array_keys(get_object_vars($this));\n $theData = $data;\n if (is_object($theData)) $theData = get_object_vars($data);\n foreach($theData as $propertyName => &$propertyValue)\n {\n foreach ($objVarNames as &$varName)\n {\n if (strcasecmp($varName, $propertyName) == 0)\n {\n $this->$varName = $propertyValue;\n }\n }\n }\n }", "protected function set_class( $class ) {\n\t\t$this->class = $class;\n\t\t$this->is_class_set = true;\n\t}", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data) {\n $this->setValues($data);\n }", "function __set($name, $value)\r\n {\r\n $this->data[$name] = $value;\r\n }", "public function __construct($data)\n {\n //\n $this->data = $data;\n }", "function set($d){\n\t self::$data = array();\n\t self::$data = array_merge(self::$data,$d);//contenue de la variable passer du model a la vue\n }", "function set($d){\n self::$data = array();\n self::$data = array_merge(self::$data,$d);//contenue de la variable passer du model a la vue\n }", "public function setTestData(Dataset $dataset)\n {\n $this->testData = $dataset;\n }", "protected function setData($data)\n {\n $this->sha1 = null;\n $this->data = $data;\n }", "public function setData(array $data)\n {\n $this->data = $data;\n }", "public function setData(array $data)\n {\n $this->data = $data;\n }", "public function setData(array $data)\n {\n $this->data = $data;\n }", "public function setData(array $data)\n {\n $this->data = $data;\n }", "private function _setUserData($userData){\n $this->_userData = $userData;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }" ]
[ "0.70790046", "0.6990115", "0.68945223", "0.6881957", "0.6881957", "0.6881957", "0.6851844", "0.68491364", "0.6822401", "0.6807914", "0.67924696", "0.67772025", "0.67764556", "0.6773775", "0.67635477", "0.67623335", "0.67514896", "0.67304325", "0.67304325", "0.67304325", "0.67160183", "0.6713276", "0.6713276", "0.6698445", "0.6676385", "0.66169363", "0.66082186", "0.65979236", "0.65972245", "0.658648", "0.658648", "0.658648", "0.658648", "0.658648", "0.6459978", "0.6451589", "0.6446662", "0.64171857", "0.6410127", "0.6396928", "0.6387766", "0.6312486", "0.63088363", "0.6286587", "0.62712044", "0.6250682", "0.6232172", "0.6166991", "0.61460125", "0.6140622", "0.6134644", "0.6125957", "0.6125957", "0.61229265", "0.6110875", "0.6100849", "0.60933477", "0.6092178", "0.6089404", "0.608671", "0.6072452", "0.6052569", "0.60475373", "0.6045495", "0.6044867", "0.6044663", "0.6044032", "0.6023296", "0.6015141", "0.6003426", "0.5997276", "0.5997216", "0.5991967", "0.5989947", "0.5987824", "0.59869075", "0.5976678", "0.5976037", "0.5971818", "0.5965224", "0.5964126", "0.594941", "0.5947946", "0.5947946", "0.5947946", "0.5947946", "0.59447527", "0.59333616", "0.59333616", "0.59333616", "0.59333616", "0.59333616", "0.59333616", "0.59333616", "0.59333616", "0.59333616", "0.59333616", "0.59333616", "0.59333616", "0.59333616" ]
0.6648333
25
Sets the type class variable
public function set_type($type) { $check = ''; if (empty($type)) { $check = new WP_Error('forgot_type', __('Specify the data type to sanitize.', $this->plugin_name)); } if (is_wp_error($check)) { wp_die($check->get_error_message(), __('Forgot data type.', $this->plugin_name)); } $this->type = $type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set($typeId, $class);", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "public function setClass($class);", "public function setClass($class){\n $this->_class = $class;\n }", "function setType($type) {\n $this->type = $type;\n }", "public function set_typeNum()\n {\n // init the map\n $this->initVarTypeNum();\n }", "public function setClass(string $class_name);", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($t){\n $this->type = $t;\n }", "public function __construct()\n {\n $fullClassName = explode('\\\\', get_class($this));\n $this->type = (string)array_pop($fullClassName);\n }", "function setInitiateType( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->InitiateType = $value;\n }", "public function setType( $type ) {\n\n\t\t$this->type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setType($type)\r\n {\r\n $this->type = $type;\r\n }", "public function setClass($class) {\r\n\t$this->class = $class;\r\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}", "public function SetType($type){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "function setType($type = \"\")\n\t\t{\n\t\t\t$this->type = $type;\n\t\t}", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function SetType($type){\r\n\t\t$this->type = (string) $type;\r\n\t}", "public function setClass($class){\n $this->class=$class;\n }", "protected function assignType()\n {\n $this->type = 'master';\n }", "protected function assignType()\n {\n $this->type = 'master';\n }", "public function setType($type) {}", "protected function set_class( $class ) {\n\t\t$this->class = $class;\n\t\t$this->is_class_set = true;\n\t}", "public function set_type($type)\n {\n $this->set_default_property(self::PROPERTY_TYPE, $type);\n }", "public function setType( $type )\n {\n }", "public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}", "private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }", "public function setClass($class)\n {\n $this->class = $class;\n }", "protected function setType()\n {\n $this->client_type = $this->getType();\n }", "public function setTyp( $type );", "public function setType($v)\n { return $this->set('type', $v); }", "public function setType($type){ }", "protected function set_type() {\n\t\t$this->type = 'kirki-color';\n\t}", "public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }", "public function setType($type)\n {\n $this['type'] = $type;\n }", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "function settype(&$var, string $type): void\n{\n error_clear_last();\n $result = \\settype($var, $type);\n if ($result === false) {\n throw VarException::createFromPhpError();\n }\n}", "function setType($type) {\n\t\treturn $this->type = $type;\n\t}", "public function __construct($type) {\n $this->type = $type;\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }" ]
[ "0.7236561", "0.69025236", "0.69025236", "0.68611073", "0.6805492", "0.6773723", "0.6699411", "0.66067976", "0.65672505", "0.65672505", "0.65672505", "0.6550795", "0.654392", "0.6508318", "0.64956826", "0.6479973", "0.6479973", "0.6477879", "0.64739853", "0.646793", "0.646793", "0.64255905", "0.6414953", "0.6412702", "0.6412702", "0.6412702", "0.6412702", "0.6412702", "0.6412702", "0.6412702", "0.6412702", "0.6412702", "0.6407673", "0.638957", "0.638957", "0.63754255", "0.63753116", "0.63470834", "0.63470834", "0.63453454", "0.6340474", "0.6332258", "0.63080484", "0.6296152", "0.6272745", "0.6269712", "0.6264487", "0.6255725", "0.624996", "0.6241583", "0.6207904", "0.6177969", "0.61566204", "0.61549324", "0.61549324", "0.61549324", "0.61549324", "0.61549324", "0.61549324", "0.61549324", "0.61549324", "0.61487603", "0.6106788", "0.60996485", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657", "0.60732657" ]
0.0
-1
Create a new GET request with the required parameters
public function get_user_info(OAuth_Consumer $consumer, OAuth_Token $token) { $url = 'https://api.linkedin.com/v1/people/~:(id,first-name,last-name,headline,member-url-resources,picture-url,location,public-profile-url)'; $request = OAuth_Request::forge('resource', 'GET', $url, array( 'oauth_consumer_key' => $consumer->key, 'oauth_token' => $token->access_token, )); // Sign the request using the consumer and token $request->sign($this->signature, $consumer, $token); $user = OAuth_Format::factory($request->execute(), 'xml')->to_array(); // Create a response from the request return array( 'uid' => $user['id'], 'name' => $user['first-name'].' '.$user['last-name'], 'nickname' => end(explode('/', $user['public-profile-url'])), 'description' => $user['headline'], 'location' => isset($user['location']['name']) ? $user['location']['name'] : null, 'urls' => array( 'Linked In' => $user['public-profile-url'], ), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGetRequest(): ParameterBag { return $this->get; }", "private function newRequest($queryString= '') {\n return new Request(new TestInput('GET', '/'.$queryString));\n }", "public function & GetRequest ();", "private function initGetRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl().'?'.$this->getQuery())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_GET)\n ;\n }", "public function get($params = []);", "public function request()\n {\n $request = new GuzzleHttp\\Psr7\\Request('GET', 'ProductsSimple');\n\n return $request->withUri($request->getUri()->withQuery(http_build_query([\n 'startRow' => $this->skip ? $this->skip + 1 : null,\n 'pageRows' => $this->take,\n 'updatedAfter' => $this->updatedAfter ? $this->updatedAfter->format('Y-m-d\\TH:i:s') : null\n ])));\n }", "private function GET() {\n global $_GET;\n $getData = array();\n foreach($_GET as $key => $value) {\n $getData[$key] = $value;\n }\n $this -> response[\"response\"] = $getData;\n return;\n }", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "private function GET($url,$params=false){\n return $this->Request($url,$params,HTTP_GET);\n }", "public function getRequestParams();", "abstract public function get(Request $request);", "public function _get($url = null, $parameters = []);", "protected function getCreateRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\": 1}');\n\t\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "protected function _initGetParameters()\n {\n $get = new DataHolder($_GET);\n\n // add query params\n $queryString = substr($_SERVER['REQUEST_URI'], strlen($get->get('_path')) + 2);\n foreach (Util::queryStringToArray($queryString) as $key => $value)\n {\n $get->set($key, $value);\n }\n\n $this->set('_get', $get);\n }", "protected function getReadRequest()\n\t{\n\t\t$url = $this->url();\n\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\":1, \"foo\":\"bar\"}');\n\t\t\n\t\treturn new Api\\Request\\Read((string) $url);\n\t}", "public function getRequest() {}", "public function getRequest() {}", "public function request()\n {\n return new GuzzleHttp\\Psr7\\Request('GET', 'Persons/'.$this->id);\n }", "public function createRequest();", "public function createRequest();", "protected function obtainGetRequest() {\n $request = Request::createFromGlobals();\n return $request->query;\n }", "protected function getRequest() {}", "public function getRequest() {\n $params = array('fetchLicensesByPidRequest', 'fetchLicensesByUrlRequest');\n foreach ($params as $parameter) {\n $getter = 'get' . ucfirst($parameter);\n if ($value = $this->$getter()) {\n $this->setParameter($parameter, $value);\n }\n }\n\n return $this;\n }", "function get(Request &$request, Response &$response);", "public function makeRequest( $url, $method = 'GET', $headers = null );", "protected function newRequest($queryString= '') {\n parse_str(ltrim($queryString, '?'), $params);\n\n $r= new HttpScriptletRequest();\n $r->setParams($params);\n $r->setURI(new URL(self::BASE_URL.$queryString));\n\n return $r;\n }", "public function get($url, $params);", "public static function _GET()\n {\n if(!self::$_get) {\n $values = $_GET;\n self::$_get = new HttpParams($values);\n }\n return self::$_get;\n }", "public function doGet($path = '', array $query = array());", "protected function getAllRequest()\n {\n\n $resourcePath = '/links';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function obtainRequest() {\n return Request::createFromGlobals();\n }", "public function get()\n {\n return $this->setMethod(__FUNCTION__)\n ->makeRequest();\n }", "protected function _getRequest() {\n\t\treturn new Request;\n\t}", "function request($url = '', $format='xml', $params=null, $method = \"GET\", $data = null, $headers = null) {\n\t\t$query_string_params = array();\n\t\t\t\t\n\t\t// add additional parameters if necessary\n\t\tif (!is_null($params) && is_array($params)) {\n\t\t\t$query_string_params = $params;\n\t\t}\n\t\t\n\n\t\t// set proper format request\n\t\tif ($this->format_as_extension) { $this->baseURL .= '.' . $format; }\n\t\telse { $query_string_params['format'] = $format; }\n\n\t\t// add the url as parameter, oembed-style\n\t\t$query_string_params['url'] = $url;\t\t\n\t\t\n\t\t$this->setQueryString($query_string_params);\t\t\n\n\t\treturn parent::request('', $method, $data, $headers);\n\t}", "public function getRequestWrapper();", "public function createRequest()\n {\n return new ChipVN_Http_Request;\n }", "public function get($requestUrl, array $requestParams = [], array $requestHeaders = []);", "public function createRequest($url);", "public function testAddGetParam()\n\t{\n\t\t$URL = new URL('http://' . self::TESTHOST . \"/requestInfos.php?getA=hallo\");\n\t\t$Payload = new Payload(new DataAsGET('getB', 'halloB'));\n\n\t\t$Request = new Request($URL, new PUT(), $Payload);\n\t\t$this->assertTrue(\n\t\t\t$Request->getResponseAs(\n\t\t\t\tnew class extends AbstractResponse\n\t\t\t\t{\n\t\t\t\t\tpublic function createByRequest($body, Headerlist $Headers, HTTPStatusCode $Status, \\DateInterval $RequestTime)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bodyArr = json_decode($body, true);\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t$bodyArr['_GET']['getA'] == 'hallo'\n\t\t\t\t\t\t\t&& $bodyArr['_GET']['getB'] == 'halloB'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}", "public function GET($query_params = null)\n {\n $query_string = '';\n\n if (is_array($query_params)) {\n $query_string = $this->constructQueryParams($query_params);\n }\n\n $url = $this->url . $query_string;\n $response = $this->curlGet($url);\n\n return $response;\n }", "public function get($url, $query = array(), $headers = array());", "function getRequest();", "public function request();", "public function get()\n\t{\n\t\t$response = $this->builder->get( $this->buildParameters(), $this->buildUrlAdditions() );\n\n\t\treturn $response;\n\t}", "public static function doGet(Array $params)\n {\n $request = new self();\n\n $params = array_merge(array('url' => '', 'data' => array(), 'requestMethod' => 'GET', 'tryNum' => 1), $params);\n $url = $params['url'];\n $tryNum = $params['tryNum'];\n $data = http_build_query($params['data']);\n\n $curl_options = array(\n CURLOPT_VERBOSE => 0,\n CURLOPT_HEADER => 0,\n CURLOPT_FOLLOWLOCATION => 1,\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_SSLVERSION => 3,\n CURLOPT_SSL_VERIFYPEER => 0,\n CURLOPT_SSL_VERIFYHOST => 0,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_HTTPHEADER => array(\"Content-Type: application/x-www-form-urlencoded\", \"Accept: text/plain\"),\n );\n\n if (!in_array($params['requestMethod'], array('GET', 'POST')))\n {\n $curl_options[CURLOPT_CUSTOMREQUEST] = $params['requestMethod'];\n }\n\n if (is_debugmode('verbose')) {\n $verboseFile = fopen('php://temp', 'r+');\n $curl_options[CURLOPT_VERBOSE] = 1;\n $curl_options[CURLOPT_STDERR] = $verboseFile;\n }\n\n if ($data)\n {\n if ($params['requestMethod'] == 'POST')\n {\n $curl_options[CURLOPT_POST] = 1;\n $curl_options[CURLOPT_POSTFIELDS] = $data;\n } else {\n $url .= '?' . $data;\n }\n }\n $curl_options[CURLOPT_URL] = $url;\n\n $ch = curl_init();\n curl_setopt_array($ch, $curl_options);\n\n do\n {\n $result = curl_exec($ch);\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $tryNum--;\n } while ($http_code >= 500 && $tryNum > 0);\n $effective_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n curl_close($ch);\n\n if ($params['requestMethod'] == 'POST')\n {\n $effective_url .= '?' . $data;\n }\n\n $request->_setAnswer(array(\n 'result' => $result,\n 'http_code' => $http_code,\n 'effective_url' => $effective_url,\n 'request_method' => $params['requestMethod'],\n ));\n\n if (is_debugmode('request')) {\n $request->debug(array(\n 'Mode' => 'Request'\n ));\n }\n if (is_debugmode('verbose')) {\n rewind($verboseFile);\n $request->_setAnswer(array(\n 'verbose_info' => fread($verboseFile, 8192),\n ));\n\n $request->debug(array(\n 'Mode' => 'Verbose request'\n ));\n }\n return $request;\n }", "public function processGetRequest(){\n\t\t$query = $this->request->getQueryString();\n\t\t$params = $this->request->getPathParameters();\n\t\tif (!empty($params)){\n\t\t\t\n\t\t\t$uid \t= $this->extractUserId();\n\t\t\t$controller = new ExampleController();\n\t\t\t$result = $controller->getUserById($uid);\n\t\t\tif ($result){\t\n\t\t\t\tnew Response('200', $result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnew Response('404');\n\t\t\t} \n\t\t}\n\t\telse{\n\t\t\t// get all\n\t\t\t$controller = new ExampleController();\n\t\t\t$results = $controller->getAllUsers($query);\n\t\t\tnew Response('200', $results);\n\t\t}\n\t}", "protected function getIndexRequest()\n\t{\n\t\t$url = $this->url();\n\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter(\n\t\t\t\t\t'output', \n\t\t\t\t\t'{\"entities\":[{\"id\":1,\"foo\":\"bar\"},{\"id\":2,\"foo\":\"baz\"}]}'\n\t\t\t\t);\n\t\t\t\t\n\t\treturn new Api\\Request\\Index((string) $url);\n\t}", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }", "function get($url, $args = array()) {\n\t\t$defaults = array('method' => 'GET');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}", "public function test_happy_flow_get()\n {\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $_GET['sp-entity-id'] = 'http://mock-sp';\n\n $request = new Request($_GET, $_POST, [], [], [], $_SERVER);\n\n $this->assertTrue($this->validator->isValid($request));\n }", "private function requestNews($queryParams)\n {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, \"http://newsapi.org/v2/everything?\" . $queryParams);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // disable printing result\n $response = curl_exec($curl);\n curl_close($curl);\n return $response;\n }", "public function get($uri, $queryParams = ''){\n// $headers = [\n// 'Authorization' => 'Bearer '.$this->token\n// ];\n//\n// return $client->request(\n// 'GET',\n// $this->getUrl($uri),\n// array('headers'=>$headers,'query' =>$queryParams)\n// );\n//\n $client = new Client();\n return $client->request('GET', $this->getUrl($uri), ['query' => $queryParams]);\n }", "public function get($params = [])\n {\n $this->setMethod('spread');\n\n if (is_array($params) && ! isset($params['requests'])) {\n $params = ['requests' => json_encode($params)];\n }\n\n return $this->httpClient->post($this->getRequestURL(), [\n 'form_params' => $this->getQueryBody($params)\n ]);\n }", "public function get()\n {\n $this->method = 'GET';\n return $this;\n }", "public static function createFromGlobals()\n {\n $class = __CLASS__;\n\n \n //Modification for modouth flow TODO: extend request class and override createFromGlobals method\n //to handle params stored in session\n \n $OAUTH_PARAMS = array();\n \n $clientKey = 'modoauth-clientid';\n $resTypeKey = 'modoauth-responsetype';\n $stateKey = 'modoauth-state';\n \n if(isset($_SESSION['modoauth'])){\n $oauthParams = $_SESSION['modoauth'];\n $OAUTH_PARAMS = array(\n \"client_id\"=>$oauthParams[$clientKey],\n \"response_type\"=>$oauthParams[$resTypeKey],\n \"state\"=>$oauthParams[$stateKey]\n );\n }\n \n $request = new $class(array_merge($_GET,$OAUTH_PARAMS), $_POST, array(), $_COOKIE, $_FILES, $_SERVER);\n\n $contentType = $request->server('CONTENT_TYPE', '');\n $requestMethod = $request->server('REQUEST_METHOD', 'GET'); \n if (0 === strpos($contentType, 'application/x-www-form-urlencoded')\n && in_array(strtoupper($requestMethod), array('PUT', 'DELETE'))\n ) {\n parse_str($request->getContent(), $data);\n $request->request = $data;\n } elseif (0 === strpos($contentType, 'application/json')\n && in_array(strtoupper($requestMethod), array('POST', 'PUT', 'DELETE'))\n ) {\n $data = json_decode($request->getContent(), true);\n $request->request = $data;\n }\n \n return $request;\n }", "public function get() {\n\t\t$this->method('GET');\n\t\treturn $this;\n\t}", "private function Request($url,$params=false,$type=HTTP_GET){\n \n // Populate data for the GET request\n if($type == HTTP_GET) $url = $this->MakeUrl($url,$params);\n \n \n // borrowed from Andy Langton: http://andylangton.co.uk/\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n if ( isset($_SERVER['HTTP_USER_AGENT']) ) {\n curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );\n } else {\n // Handle the useragent like we are Google Chrome\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.X.Y.Z Safari/525.13.');\n }\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n //$acceptLanguage[] = \"Accept-Language:\" . $this->ClientLanguage;\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $acceptLanguage); \n // Populate the data for POST\n if($type == HTTP_POST) {\n curl_setopt($ch, CURLOPT_POST, 1); \n if($params) curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n }\n\n //execute\n $response=curl_exec($ch);\n $headers=curl_getinfo($ch);\n\n //fetch errors\n $errorNumber = curl_errno($ch);\n $errorMessage = curl_error($ch);\n\n curl_close($ch);\n\n // replace ids with their string values, added because of some\n // PHP-version can't handle these large values\n $response = preg_replace('/id\":(\\d+)/', 'id\":\"\\1\"', $response);\n\n // we expect JSON, so decode it\n $json = @json_decode($response, true);\n\n // validate JSON\n if ($json === null) {\n // should we provide debug information\n if (self::DEBUG) {\n // make it output proper\n echo '<pre>';\n\n // dump the header-information\n var_dump($headers);\n\n // dump the error\n var_dump($errorMessage);\n\n // dump the raw response\n var_dump($response);\n\n // end proper format\n echo '</pre>';\n }\n\n // throw exception\n throw new Exception('Invalid response.');\n }\n\n // any errors\n if (isset($json['diagnostic']['error_msgs'])) {\n // should we provide debug information\n if (self::DEBUG) { \n\n echo '<pre>';\n echo \"<h3>Header</h3>\";\n // dump the header-information\n var_dump($headers);\n\n echo \"<h3>Error message</h3>\";\n // dump the error\n var_dump($errorMessage);\n\n echo \"<h3>Raw Response</h3>\";\n // dump the raw response\n var_dump($response);\n\n echo \"<h3>Response</h3>\";\n var_dump($json);\n \n echo '</pre>';\n exit();\n }\n\n // throw exception\n /*\n if (isset($json['errors'][0]['message'])) {\n throw new Exception($json['errors'][0]['message']);\n } elseif (isset($json['errors']) && is_string($json['errors'])) {\n throw new Exception($json['errors']);\n } else throw new Exception('Invalid response.');\n */\n }\n\n return $json;\n }", "abstract public function request();", "public function retrieve( array $params );", "abstract protected function requestApi($action = '', $params = array(), $method = 'POST');", "public function __construct($get_fields=NULL){\n\t\tif($_SERVER['REQUEST_URI'] != ''){\n\t\t\tif($_SERVER['QUERY_STRING']){\n\t\t\t\t$this->request = explode('/',$_SERVER['QUERY_STRING']);\n\t\t\t\t// this is a wee bit of code to make the array_combine function work\n\t\t\t\t// and to process query strings as the URLS they resemble in the order of the array that is passed to it\n\t\t\t\tif( (int) count($this->request) != (int) count($get_fields) )\n\t\t\t\t\t\tforeach($get_fields as $loc=>$value)\n\t\t\t\t\t\t\tif(!array_key_exists($loc,$this->request ))\n\t\t\t\t\t\t\t\tunset($get_fields[$loc]);\n\t\t\t\t$this->script_name = $_SERVER['SCRIPT_NAME'];\n\t\t\t\t$this->request = array_combine($get_fields,$this->request);\n\t\t\t\t$get_fields!=NULL && is_array($get_fields) AND self::set_get( $this->request) ;\n\t\t\t}\n\t\t}\n\t}", "public function getRequest(): Request\n\t{\n\t\t//Get php://input for PUT and DELETE methods\n\t\tparse_str(file_get_contents('php://input'), $_DATA);\n\t\treturn new Request($_SERVER, $_GET + $_POST + $_DATA);\n\t}", "protected function templistsGetRequest()\n {\n\n $resourcePath = '/templists';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // 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 toRequest(): Request\n {\n // Create URI\n $uri = new Uri(sprintf($this->uriTemplate, $this->shop));\n\n // Create headers\n $authenticatedRequestHeader = $this->accessTokenTransformer\n ->toAuthenticatedRequestHeader($this->accessToken);\n\n // Create headers\n $headers = array_merge($this->headers, $authenticatedRequestHeader);\n\n // Create request\n return new Request($this->httpMethod, $uri, $headers);\n }", "public function get($endpoint = '', $query=[], $body='');", "public static function get($uri,$params=[],$options=[]) {\n return self::request('GET',$uri,$params,$options);\n }", "public function request($path, array $parameters = array(), $httpMethod = 'GET', ApiInterface $api);", "public function request_get($uri, array $options = array()) {\n $options['method'] = 'GET';\n return $this->request($uri, $options);\n }", "public function get()\n\t\t{\n\t\t\t$aArgument = func_get_args();\n\t\t\t$sURL = array_shift( $aArgument );\n\t\t\t$aData = (bool) count( $aArgument ) ? array_shift( $aArgument ) : Array();\n\t\t\t$mReferer = (bool) count( $aArgument ) ? array_shift( $aArgument ) : false;\n\n\t\t\treturn $this->request( \"get\", $sURL, $aData, $mReferer );\n\t\t}", "private function rebuildGet()\n {\n $url = $_SERVER['REQUEST_URI'];\n $pos = strpos($url, '?');\n \n if ($pos !== false)\n {\n parse_str(substr($url, $pos+1, (strlen($url)-($pos+1))), $_GET);\n }\n }", "public static function get() {\n return self::call(\"GET\");\n }", "protected function restNewslettersGetRequest()\n {\n\n $resourcePath = '/rest/newsletters';\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 get(string $url, array $input = [], $headers = null);", "public static function requireParams() {\n\t\tswitch($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'GET': $parameters = $_GET; break;\n\t\t\tcase 'POST': $parameters = $_POST; break;\n\t\t\tcase 'PUT':\n\t\t\tcase 'DELETE': $parameters = static::getInputVars(); break;\n\t\t}\n\n\t\t$params = func_get_args();\n\t\t$class = new \\stdClass;\n\t\tforeach ($params as $param) {\n\t\t\tif (!isset($parameters[$param])) {\n\t\t\t\tif (Application::inDevelopment()) {\n\t\t\t\t\t$passedParams = implode(',', array_keys($parameters));\n\t\t\t\t\tLog::debug(\"Missing {$_SERVER['REQUEST_METHOD']} parameter '{$param}', only got \" . (strlen($passedParams) > 0 ? $passedParams : '[nothing]'));\n\t\t\t\t}\n\t\t\t\tApplication::error(400, 'Missing one of the parameters');\n\t\t\t}\n\n\t\t\t$class->$param = $parameters[$param];\n\t\t}\n\n\t\treturn $class;\n\t}", "public function get(array $queryParams, $endpoint);", "function request() {\n return new Request;\n }", "public function request($method, $endpoint = '', $query=[], $body='');", "protected function getPricelistsRequest()\n {\n $resourcePath = '/pricelists';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // 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 actionGetByParams()\n {\n $this->params = [];\n foreach ($_GET as $key => $value) {\n array_push( $this->params, $value);\n }\n\n $data = $this->starships;\n if (sizeof($this->params) == 1) {\n return $this->sortByParams($data, $this->params);\n } else {\n return $this->sortByParams($data, $this->params);\n }\n }", "public function GetParamsGen() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n\n if (isset($_REQUEST['data'])) {\n $idSociete = $_REQUEST['data'][\"idSociete\"];\n // Input validations\n if (!empty($idSociete)) {\n try {\n $sql = $this->db->prepare(\"SELECT * FROM paramsGenerale WHERE idSociete = :idSociete LIMIT 1\");\n $sql->bindParam('idSociete', $idSociete, PDO::PARAM_INT);\n $sql->execute();\n\n if ($sql->rowCount() > 0) {\n $result = $sql->fetch();\n\n // If success everythig is good send header as \"OK\" and user details\n $this->response($this->json($result), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage());\n }\n }\n }\n\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid param\");\n $this->response($this->json($error), 400);\n }", "public function getrequest()\n {\n $request = User::getrequest();\n return result::repsonse(true,$request);\n }", "function request($httpMethod, $service, $apiMethod, array $parameters = array(), array $options = array());", "public function get($path, $parameters = null);", "function curl_get($url, array $get = NULL, array $headers = NULL, array $options = array()) { \n $defaults = array( \n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), \n CURLOPT_HEADER => 0, \n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => TRUE, \n CURLOPT_TIMEOUT => 4,\n $headers\n ); \n \n $ch = curl_init(); \n curl_setopt_array($ch, ($options + $defaults));\n \n if ( ! $result = curl_exec($ch)) { \n trigger_error(curl_error($ch)); \n } \n curl_close($ch); \n return $result; \n}", "public function query($params)\n { \n return $this->request(Resource::RESOURCE_QUERY, $params);\n }", "public function createRequest($method = RequestInterface::GET, $uri = null, $headers = null, $body = null, array $options = array())\n {\n if (is_array($body)) {\n $body['pio_appkey'] = $this->getConfig()->get(\"appkey\");\n } else {\n $body = array('pio_appkey' => $this->getConfig()->get(\"appkey\"));\n }\n\n // Remove Guzzle internals to prevent them from going to the API\n unset($body[AbstractCommand::HEADERS_OPTION]);\n unset($body[AbstractCommand::ON_COMPLETE]);\n unset($body[AbstractCommand::DISABLE_VALIDATION]);\n unset($body[AbstractCommand::RESPONSE_PROCESSING]);\n unset($body[AbstractCommand::RESPONSE_BODY]);\n unset($body[AbstractCommand::HIDDEN_PARAMS]);\n\n if ($method == RequestInterface::GET || $method == RequestInterface::DELETE) {\n $request = parent::createRequest($method, $uri, $headers, null, $options);\n $request->getQuery()->replace($body);\n } else {\n $request = parent::createRequest($method, $uri, $headers, $body, $options);\n }\n $request->setPath($request->getPath() . \".json\");\n\n return $request;\n }", "public function __construct(){\r\n\t\t\t$this->request_vars = array();\r\n\t\t\t$this->data = '';\r\n\t\t\t$this->http_accept = (strpos($_SERVER['HTTP_ACCEPT'], 'json')) ? 'json' : 'xml';\r\n\t\t\t$this->method = 'GET';\r\n\t\t}", "public function tspRequest()\n {\n\n $resourcePath = '/tsp';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $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 // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function accountDetailsRequest()\n {\n\n $resourcePath = '/accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // 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 static function create()\n {\n $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : 'text/html';\n return (new Request(\n $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'] ,\n $_REQUEST, $contentType\n ))->processBody();\n }", "protected function getShopRequest()\n {\n $resourcePath = '/shop';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // 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 }", "abstract protected function httpQuery(\n RequestMethodEnum $_method,\n string $_url,\n array $_params = [],\n array $_extra_options = []\n ): HttpResponse;", "private function url_params()\n {\n return \"?user={$this->login}&password={$this->password}&answer=json\";\n }", "function http_request($method, $url = null, $body = null, ?array $options = null, ?array &$info = null) {}" ]
[ "0.6881905", "0.67728555", "0.6693427", "0.66574484", "0.66235125", "0.66087985", "0.65796006", "0.64358807", "0.64358807", "0.64358807", "0.64358807", "0.64358807", "0.64358807", "0.64358807", "0.64358807", "0.6405585", "0.6402044", "0.6401777", "0.6391412", "0.63656855", "0.6362956", "0.63600373", "0.63290256", "0.63290256", "0.6308247", "0.62720937", "0.62720937", "0.62345755", "0.6182941", "0.6180953", "0.61801404", "0.6167959", "0.6158203", "0.6150455", "0.6146633", "0.61309785", "0.6130972", "0.6089434", "0.6085395", "0.60685265", "0.6062186", "0.6030629", "0.6021909", "0.6012922", "0.6006408", "0.59989953", "0.59819907", "0.5975119", "0.59568983", "0.5949371", "0.59487313", "0.5933603", "0.5921844", "0.5919742", "0.59095144", "0.5879209", "0.5856341", "0.5856159", "0.5853993", "0.5850623", "0.5842756", "0.5839186", "0.58152854", "0.58012396", "0.5793876", "0.5768744", "0.5761134", "0.5753166", "0.5745908", "0.5740412", "0.57388747", "0.57320607", "0.57248706", "0.5722122", "0.57216024", "0.5720307", "0.5709814", "0.5709143", "0.5688062", "0.568684", "0.56715244", "0.5667353", "0.5666846", "0.5664326", "0.5648773", "0.5640248", "0.5631479", "0.56228244", "0.56168777", "0.55998546", "0.5585028", "0.55825585", "0.5579491", "0.55792755", "0.5578284", "0.557539", "0.5571209", "0.5566545", "0.55535537", "0.5552846", "0.5552264" ]
0.0
-1
Instantiates the Model and Load classes
function __construct() { $this->load = new Load(); $this->model = new Model(); $this->home(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function init() {\n\t\tcore::loadClass(\"database\");\n\n\t\t/* Child tables */\n\t\tcore::loadClass(\"doorkey_model\");\n\t\tcore::loadClass(\"key_history_model\");\n\t}", "public function __construct() {\n $this->load = new Load();\n $this->model = new Model();\n }", "public function __construct()\n {\n parent::__construct();\n $this->app->loadClass('date');\n $this->loadModel('task');\n $this->loadModel('order', 'crm');\n $this->loadModel('customer');\n }", "private function loadModel()\n {\n require_once APP . '/model/User.php';\n // create new \"model\" (and pass the database connection)\n $this->model = new User($this->db);\n }", "public function init()\n {\n\t\t$this->user_model = new Application_Model_Users;\n\t\t$this->request_model = new Application_Model_Requests;\n\t\t$this->material_model = new Application_Model_Materials;\n\t\t$this->course_model = new Application_Model_Courses;\n\t\t$this->comment_model = new Application_Model_Comments;\n\t\t$this->category_model = new Application_Model_Categories;\n \t$this->assoc_rules_model = new Application_Model_Assocrules;\n }", "function __construct()\n {\n $this->openDatabaseConnection();\n $this->loadModel();\n }", "public function loadModel() : void\n {\n $model = $this->newModel();\n\n $model->loadModel($this->modelPath);\n $model->printModel();\n\n $this->fm = FunctionMap::loadFunctionMap();\n }", "private function loadModel() {\n // name as requested resource.\n $name = $this->name.'Model';\n $path = str_replace(kPlaceholder, $this->version, kModelsFolder);\n $path = $path . $name . \".php\";\n // If it does not exist, go with\n // the default Model class.\n if (!file_exists($path)) {\n return new Model();\n } else {\n if (!class_exists($name)) {\n include $path;\n }\n\n return new $name();\n }\n }", "public function model() {\n require_once \"../app/models/model.php\";\n $this->model = new Model($this->db);\n }", "private function loadModels()\n {\n $this->use = ( ! isset($this->use)) ? [$this->class] : $this->use;\n\n if ($this->use) {\n foreach ($this->use as $model) {\n self::load('model', $model);\n }\n }\n }", "public function __construct(){\n require_once 'EntidadBase.php'; // Incluye el archivo EntidadBase\n require_once 'BaseModel.php'; // Incluye el archivo BaseModel\n foreach(glob('Model/*.php') as $file){ // Recorre todos los archivos de la carpeta Model con la extensión PHP.\n require_once($file); // Incluye el archivo\n }\n }", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "public function __construct()\n {\n $this->imageModel = new ImageModel();\n $this->userModel = new User();\n $this->psychologySupervisorModel = new PsychologySupervisor();\n $this->registerSupervisionModel = new RegisterSupervision();\n $this->updateSupervisionModel = new UpdateSupervisionModel();\n }", "public function __construct()\r\n\t{\r\n\tparent::__construct();\r\n\t\r\n\t//load database libray manually\r\n\t$this->load->database();\r\n\t\r\n\t//load Model\r\n\t$this->load->model('Hello_Model');\r\n\t}", "function loadModel ($name){\n $file = ROOT.DS.'models'.DS.$name.'.php';\n require_once($file);\n\n if(!isset($this->name)){\n $this->$name = new $name();\n }\n }", "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "function __construct()\n {\n // load model\n Load::loadModel(\"helpDesk\");\n }", "public function __construct()\n\t{\n\t\t//MVC: makes CodeIgniter style $this->load->model() available to my controllers\n\t\t$this->load = new modelLoader($this);\n\t}", "private function _load_models()\n {\n foreach ($this->models as $model)\n {\n $this->load->model($this->_model_name($model), $model);\n }\n }", "private function _load_models()\r\n {\r\n foreach ($this->models as $model)\r\n {\r\n $this->load->model($this->_model_name($model), $model);\r\n }\r\n }", "public function __construct() {\n // load our model\n $this->userModel = $this->model('User'); // will check models folder for User.php\n }", "protected function setModel()\n {\n $class = 'Src\\Modules\\\\' . $this->module_name . '\\Models\\\\' . $this->class . 'Model';\n $this->model = new $class;\n $this->model->setModuleName( $this->module_name );\n $this->model->run();\n }", "public function initialize()\n {\n parent::initialize();\n $this->loadModel('Projects');\n $this->loadModel('ProjectsInjections');\n $this->loadModel('Colonies');\n }", "private function modelLoader( $className ) {\r\n\t\t// $className = trim( str_replace(\"_\", \"/\", $className), \"/\" );\r\n\t\t@include_once CORE_MODEL . $className .'.php';\r\n\t\t\r\n\t}", "function __construct() {\n $this->loteModel = new loteModel();\n }", "function __construct() {\n parent::__construct();\n $this->load->model('flightModel');\n $this->load->model('flight');\n $this->load->model('wackyModel');\n $this->load->model('fleetModel');\n }", "public function __construct() {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init DateTimeLib library object\n $this->dateTimeLibObj = new DateTimeLib();\n\n // Init Search model object\n $this->searchObj = new Search();\n\n // Init UtilityLib library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init Patients model object\n $this->patientsObj = new Patients();\n\n // Init StaticDataConfig model object\n $this->staticDataObj = new StaticDataConfig();\n\n // Init DoctorProfile model object\n $this->doctorprofileObj = new DoctorProfile();\n\n // Init DoctorProfile model object\n $this->appointmentCategoryObj = new AppointmentCategory();\n\n // Init ManageCalendar model object\n $this->manageCalendarObj = new ManageCalendar();\n\n // Init ManageCalendar model object\n $this->timingObj = new Timing();\n }", "protected function _loader(){\n\t\t/*\n\t\t* \n\t\t* Load all the Model to use database\n\t\t* Load all the library\n\t\t*\n\t\t*/\n\t\t$this->load->model('post');\n\t\t$this->load->model('user');\n\t\t$this->load->library('form_validation');\n\t}", "function __construct()\n {\n parent::__construct();\n $this->__resTraitConstruct();\n $this->load->model('VSMModel');\n $this->load->model('TextPreprocessingModel');\n\n }", "function __construct() {\n parent::__construct();\n \n //INIT CONSTANTS\n $this->CONT_ROOT=$this->LIB_CONT_ROOT.'paper/';\n //load all models for this controller\n $this->load->model(array());\n //load all models for this controller\n $models = array();\n //load all models in above array\n foreach($models as $mdl=>$tbl){\n $this->load->model('common_m',$mdl);\n $this->$mdl->init(array('table'=>$tbl));\n }\n \n }", "function __construct()\n {\n parent::__construct();\n $this->load->database();\n $this->load_model('book', $this->auth);\n $this->load_model('user', $this->auth);\n $this->load_model('participant', $this->auth);\n $this->load_model('question', $this->auth);\n }", "public function __construct()\n {\n $this->ModelUser = new LoginRegisterModel();\n $this->modelCategorie = new CategoriesModel();\n\t\t/* ********** fin initialisation Model ********** */\n }", "function __construct(){\n foreach(glob(\"model/*.php\") as $file){\n require_once $file;\n }\n\n }", "static private function loadModels() {\n\n $config = Application::getConfig();\n\n if ($handle = opendir($config[\"system\"][\"models-folder\"])) {\n\n /* Das ist der korrekte Weg, ein Verzeichnis zu durchlaufen. */\n while (false !== ($entry = readdir($handle))) {\n if($entry != \".\" && $entry != \"..\") {\n require $config[\"system\"][\"models-folder\"] . \"/\" .$entry;\n }\n }\n closedir($handle);\n }\n }", "public function loadModel(){\n $this->load->model('Data_Model');\n return new Data_Model($this->used_table,$this->used_db);\n }", "public function __construct(){\n\n\t\t$this->types_model = new Types();\n\t}", "public function init() {\n $bootstrap = $this->getInvokeArg(\"bootstrap\");\n $this->aConfig = $bootstrap->getOptions();\n $this->view->aConfig = $this->aConfig;\n $this->model= new Model_InfoBusiness();\n $this->modelMapper= new Model_InfoBusinessMapper();\n $this->modelProvince = new Model_MasterProvince();\n $this->modelProvinceMapper = new Model_MasterProvinceMapper();\n $this->modelDistrict = new Model_MasterDistrict();\n $this->modelDistrictMapper = new Model_MasterDistrictMapper();\n $this->modelWard = new Model_MasterWard();\n $this->modelWardMapper = new Model_MasterWardMapper();\n }", "function loadModel($name){\n\t\t$dir = APP . \"Entity\" . DS;\n\n\t\t$file = str_replace([$dir,\".php\"], [\"\",\"\"], $name);\n\n\t\tif(!isset($this->$file)){\n\t\t\trequire_once $name;\n\t\t\t$this->$file = new $file();\n\t\t\tif(isset($this->Form)){\n\t\t\t\t$this->$file->Form = $this->Form; \n\t\t\t}\n\t\t}\n\n\n\t}", "public static function loadModel($params)\n\t{\n\t\tif(!self::$_model_loaded){\n\t\t\tself::loadLibrary('SHIN_Model');\n\t\t\tself::loadLibrary('SHIN_SelectQuery');\n\t\t\tself::$_model_loaded = TRUE;\n\t\t}\n\t\n\t\t$__data = preg_split(\"/_/\", $params[0]);\n\t\t$app_raw_name = strtolower($__data[0]);\n\t\t\n\t\tif($app_raw_name == 'sys'){\n\t\t\t$app_folder = self::$_config['core']['shinfw_folder'];\n\t\t} else {\n\t\t\t$app_folder = self::$applistpath[$app_raw_name];\n\t\t}\n\t\t\n\t\t$path = self::$_config['core']['base_path'].$app_folder;\n\t\t\t\n\t\t$__p = \tstrtolower($path.DIRECTORY_SEPARATOR.'models'.DIRECTORY_SEPARATOR.$params[0].'.php');\n\t\t\n\t\tif(count($params) == 2)\n\t\t{\n if(!is_file($__p))\n\t\t\t{\n self::show_error(\"Model \".$__p.\" not exists. Pls check path.\");\n }\n\t\t\trequire_once($__p);\n\t\t\t\n\t\t\tself::$_models[strtolower($params[1])] = new $params[0]();\n\t\t} else {\n\t\t\trequire_once($__p);\n\t\t}\n\t\t\n\t\treturn;\n }", "private function loadClass() {\n $this->_instances = array();\n\n $this->_instances['log'] = new Log();\n if(ENVIRONMENT == self::ENVIRONMENT_DEV) {\n $this->_instances['debug'] = new Debug();\n $this->_instances['panel'] = new Panel();\n }\n $this->_instances['controller'] = null;\n $this->_instances['configuration'] = new Configuration();\n $this->_instances['routing'] = new Routing();\n }", "public function __construct() {\n $this->openConnection();\n $this->model();\n }", "public function __construct(){\n $this->sliderModel = $this->model('Slider');\n $this->siteInfoModel = $this->model('SiteInfo');\n $this->officeModel = $this->model('Office');\n $this->categoryModel = $this->model('Category');\n $this->brandModel = $this->model('Brands');\n $this->productModel = $this->model('Products');\n $this->imgModel = $this->model('Image');\n }", "function __construct() {\n parent::__construct();\n $this->load->model('Fontend_model');\n $this->load->model('Package_model');\n }", "function __construct()\n {\n // load model\n Load::loadModel(\"group\");\n }", "function loadModel($model){\n $url='models/'.$model.'model.php';//models/alumnomodel.php\n //validando que el modelo exista\n if(file_exists($url)){\n //si axiste lo llamamos\n require $url;\n $modelName=$model.'Model';\n //instancia de la clase del modelo recibido\n $this->model=new $modelName;\n }\n }", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}", "public function __construct()\n{\nparent::__construct();\n\n//load database libray manually\n$this->load->database();\n\n//load Model\n$this->load->model('welcomemodel');\n}", "public function load() {\r\n\t\t$this->includes();\r\n\t\t$this->inits();\r\n\t}", "public function __construct() {\n $this->load();\n }", "public function __construct()\n {\n parent::__construct();\n $this->load->model(['m_voting', 'm_master', 'm_prospects', 'm_factors']);\n }", "public function __construct()\n {\n\n $this->SubCategory = new SubCategoriesModel;\n $this->Functions = new ModelFunctions();\n }", "protected function __construct()\n {\n $this->load();\n }", "public function generateModels () {\r\n $modelParam = \\app\\lib\\router::getModel();\r\n $ModelPath = \\app\\lib\\router::getPath();\r\n $ModelName = \"app\\model\\\\\" . end($ModelPath);\r\n $this->model =new $ModelName;\r\n }", "public function __construct()\n {\n self::autoload();\n }", "private static function model()\n {\n $files = ['ORM_', 'CRUD', 'ORM', 'Collection', 'ModelArray'];\n $folder = static::$root.'MVC/Model'.'/';\n\n self::call($files, $folder);\n\n $files = ['ForeingKeyMethodException', 'ColumnNotEmptyException', 'ManyPrimaryKeysException', 'TableNotFoundException', 'ModelNotFoundException', 'PrimaryKeyNotFoundException'];\n $folder = static::$root.'MVC/Model/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "private function model()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR;\n $class_name = '';\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n\n $tmp = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $tmp = join('_', $tmp);\n $class_name .= ApplicationHelpers::camelize($tmp);\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n $class_name .= ucfirst(strtolower($this->args['name']));\n\n $args = array(\n \"class_name\" => ucfirst(strtolower($this->args['name'])),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_model'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n );\n\n $template = new TemplateScanner(\"model\", $args);\n $model = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Model already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $model))\n {\n $message .= 'Created model: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create model: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the migration for the new model\n $this->migration();\n\n return;\n }", "public function __construct(){\n\t\tinclude_once(\"model/crews_model.php\");\n\t\t$this->model = new crews_model();\n\t}", "public function __construct()\n {\n\n $this->loginModel = new LoginModel();\n $this->pinjamModel = new PinjamModel();\n $this->db = db_connect();\n\n // $this->kategoriModel = new KategoriModel();\n }", "public function initialize()\n {\n parent::initialize();\n\n // Create config strings\n $this->config = [\n 'models' => [\n 'Files' => __d('elabs', 'File'),\n 'Notes' => __d('elabs', 'Note'),\n 'Posts' => __d('elabs', 'Article'),\n 'Projects' => __d('elabs', 'Project'),\n 'Albums' => __d('elabs', 'Album'),\n ]\n ];\n\n // Load models\n foreach (array_keys($this->config['models']) as $model) {\n $this->$model = TableRegistry::get($model);\n }\n }", "private static function _loadModels(){\n if (self::$_models == null){\n $sql = 'SELECT id, uuid, name, description, version_id, created FROM v_model WHERE 1';\n $models = Mysql::query($sql);\n if ($models){\n $_models = array();\n foreach($models as $model){\n $sql = \"SELECT id, model_id, uuid, name, description, type, list, instance_model_id, version_id, created FROM v_property WHERE model_id = '{$model->id}'\";\n $properties = Mysql::query($sql);\n if ($properties){\n $model->properties = $properties;\n $_models[] = $model;\n }\n }\n self::$_models = $_models;\n }\n }\n }", "public function __construct()\n {\n $this->model = new BaseModel;\n }", "function __construct(){\n\n\t\t\tparent::__construct();\n\t\t\t/* models will be loaded here */\n\t\t\t$this->load->model('teach_login', 'teach_lgn');\n\t\t\t$this->load->model('teacher_acc/teach_acc_reg', 'teach_Acc');\n\t\t\t$this->load->model('teacher_acc/get_teach_acc', 'teach_F');\n\n\t\t}", "public function __construct(){\n parent::__construct();\n\t\t$this->load->model('notification_model');\n\t\t$this->load->model('cities_model');\n\t\t$this->load->model('areas_model');\n\t\t$this->load->model('groups_model');\n }", "public function loadModel()\n {\n $data = Contest::find($this->modelId);\n $this->title = $data->title;\n $this->description = $data->description;\n $this->image = $data->image;\n $this->featured_image = $data->featured_image;\n\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('ModelsExecuteMaster');\n\t\t$this->load->model('GlobalVar');\n\t\t$this->load->model('Apps_mod');\n\t}", "function __autoload($className) {\n require_once \"../model/\" . $className . '.php';\n}", "public function __construct(){\n parent::__construct();\n //load database libray manually\n $this->load->database();\n //load Model\n $this->load->model('Pessoa_model');\n }", "function __construct() {\n $this->model = new HomeModel();\n }", "public function __construct()\n\t{\n\t\tforeach(Config::item('core.preload') as $type => $load)\n\t\t{\n\t\t\tif ($load == FALSE) continue;\n\n\t\t\tforeach(explode(',', $load) as $name)\n\t\t\t{\n\t\t\t\tif (($name = trim($name)) == FALSE) continue;\n\n\t\t\t\tswitch($type)\n\t\t\t\t{\n\t\t\t\t\tcase 'libraries':\n\t\t\t\t\t\tif ($name == 'database')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->database();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->library($name);\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'models':\n\t\t\t\t\t\t$this->model($name);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n\n //load database libray manually\n $this->load->database();\n\n //load Model\n $this->load->model('Senddata_model');\n }", "protected function setup_models()\n\t{\n\t}", "public function loadModel(){\n\t\t$className = get_class($this);\n\t\tforeach(func_get_args() as $model){\n\t\t\t$entity = EntityManager::getEntityInstance($model);\n\t\t\tself::$_settingLock[$className] = true;\n\t\t\t$this->$model = $entity;\n\t\t\tself::$_settingLock[$className] = false;\n\t\t}\n\t}", "function __construct() {\n $this-> CI =& get_instance();\n $this -> CI -> load -> model('Admin_model');\n // Nos comemos la libreria que la virgen solo corre si sale corriendo\n }", "public function __construct()\n {\n parent::__construct();\n //自动加载相对应的数据模型\n if ($this->auto_load_model) {\n $model_name = $this->model_name ? $this->model_name . '_model' : $this->router->fetch_class() . '_model';\n $this->load->model($model_name, 'model');\n }\n $this->_set_user();\n $this->_check_resource();\n }", "public function __construct() {\n\t\t$config = ['config_student', 'config_course'];\n\t\t$models = ['courses_model', 'lessons_model'];\n\t\t$this->common_model->autoload_resources($config, $models);\n\t}", "public function __construct()\n {\n // All of my models are like this\n parent::__construct(get_class($this));\n // Calling methods to get the relevant data\n $this->generateNewsData();\n $this->generateAnalyticsData();\n $this->generatePostsData();\n }", "function __construct()\n\t\t{\n\t\t\t// Call the Model constructor\n\t\t\tparent::__construct();\n\t\t $this->load->database();\t\n\t\t}", "protected function _construct()\n {\n $this->_init(Model::class, ResourceModel::class);\n }", "public function __construct(){\n // $this->team = new \\Model\\Business\\Department();\n $this->config = new \\Model\\Business\\YearPerformanceConfigCyclical();\n $this->record = new \\Model\\Business\\RecordYearPerformanceQuestions();\n $this->question = new \\Model\\Business\\YearPerformanceFeedbackQuestions();\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t// $this->load->model('colleges');\n\t\t// $this->load->model('programs');\n\t\t$this->load->model('courses_model', 'courses');\n\t\t$this->load->model('user_model', 'user');\n\t\t$this->load->model('forms_model', 'forms');\n\t\t$this->load->model('evaluation_model', 'evaluation');\n\t}", "public function __construct(){\n get_instance()->load->model('lists');\n }", "public function __construct()\n\t{\n\t\t$this->modelProducts = new ProductsModel();\n\t\t/* ********** fin initialisation Model ********** */\n\t}", "public function __construct() \n {\n parent::__construct();\n $this->load->model(\n [\n 'Pages_model',\n 'Article_model'\n ]\n );\n $this->class_path_name = $this->router->fetch_class();\n }", "public function __construct()\n {\n $this->userModel = new User();\n $this->instituteModel = new Institute(UserCommon::getLoggedInUserId());\n $this->common = new InstituteType();\n \n }", "function __construct() {\n $this->model = new Students();\n $this->view = new StudentsView();\n }", "private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('ModelsExecuteMaster');\n\t\t$this->load->model('GlobalVar');\n\t\t$this->load->model('Apps_mod');\n\t\t$this->load->model('LoginMod');\n\t}", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('ModelsExecuteMaster');\n\t\t$this->load->model('GlobalVar');\n\t\t$this->load->model('Apps_mod');\n\t\t$this->load->model('LoginMod');\n\t}", "function __construct()\n {\n parent::__construct();\n $this->load->model('User');\n $this->load->model('Pesan');\n $this->load->model('Obat');\n }", "public function __construct()\n {\n require_once APPPATH.'config/database.php';\n\n // Set up class loading. You could use different autoloaders, provided by your favorite framework,\n // if you want to.\n //require_once APPPATH.'libraries/Doctrine/Common/ClassLoader.php';\n\n // We use the Composer Autoloader instead - just set\n // $config['composer_autoload'] = TRUE; in application/config/config.php\n //require_once APPPATH.'vendor/autoload.php';\n\n //A Doctrine Autoloader is needed to load the models\n // first argument of classloader is namespace and second argument is path\n\n // setup class loading\n $entitiesClassLoader = new ClassLoader('models', APPPATH);\n $entitiesClassLoader->register();\n\n foreach (glob(APPPATH.'modules/*', GLOB_ONLYDIR) as $m) {\n $module = str_replace(APPPATH.'modules/', '', $m);\n $entitiesClassLoader = new ClassLoader($module, APPPATH.'modules');\n $entitiesClassLoader->register();\n }\n\n $loader = new ClassLoader('Proxies', APPPATH.'Proxies');\n $loader->register();\n\n // Set up Gedmo\n // $classLoader = new ClassLoader('Gedmo', APPPATH.'third_party');\n // $classLoader->register();\n // $evm = new EventManager;\n // // timestampable\n // $evm->addEventSubscriber(new TimestampableListener);\n // // sluggable\n // $evm->addEventSubscriber(new SluggableListener);\n // // tree\n // $evm->addEventSubscriber(new TreeListener); \n\n // Set up caches\n $config = new Configuration;\n $cache = new ArrayCache;\n $config->setMetadataCacheImpl($cache);\n $driverImpl = $config->newDefaultAnnotationDriver(array(APPPATH.'models'));\n $config->setMetadataDriverImpl($driverImpl);\n $config->setQueryCacheImpl($cache);\n\n // Set up models\n $reader = new AnnotationReader($cache);\n // $reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\\\');\n $models = array(APPPATH.'models');\n foreach (glob(APPPATH.'modules/*/models', GLOB_ONLYDIR) as $m)\n array_push($models, $m);\n $driver = new AnnotationDriver($reader, $models);\n $config->setMetadataDriverImpl($driver);\n\n // Proxy configuration\n $config->setProxyDir(APPPATH.'/proxies');\n $config->setProxyNamespace('Proxies');\n\n // Set up logger\n // $logger = new EchoSQLLogger;\n // $config->setSQLLogger($logger);\n\n $config->setAutoGenerateProxyClasses( TRUE );\n\n // Database connection information\n $connectionOptions = array(\n 'driver' => 'pdo_mysql',\n 'user' => $db['default']['username'],\n 'password' => $db['default']['password'],\n 'host' => $db['default']['hostname'],\n 'dbname' => $db['default']['database']\n );\n\n // Create EntityManager\n $this->em = EntityManager::create($connectionOptions, $config);\n }", "public function __construct() {\n\t\t\n\t\tparent::__construct();\n\n\t\t$this->load->model('user_m');\n\t\t$this->load->model('setup_m');\n\t\t$this->load->model('material_m');\n\t\t$this->load->model('assessment_m');\n\t\t$this->load->model('assignment_m');\n\n\n\t}", "function __construct()\n {\n parent::__construct();\n $this->load->model('BH');\n\n }", "public function __construct () {\n\t\tparent::__construct ();\n\t\t\n\t\tif ($this->models)\n\t\tforeach ($this->models as $model) {\n\t\t\tunset ($this->models[$model]);\n\t\t\t$this->models[$model] = $this->session->getModel ($model,$this);\n\t\t\t$this->$model = $this->models[$model];\n\t\t}\n\t}", "function __construct() {\n parent::__construct();\n $this->load->model('Demo');\n }", "public function loadModel()\n {\n if ($this->_modelName == null) {\n $this->_modelName = $this->_controllerName . '_Model';\n $this->load->model($this->_modelName);\n }\n }", "private function init()\n\t{\n\t\tforeach (isLoadedClass() as $objName)\n\t\t{\n\t\t\t$this->$objName =& loadClass('', '', $objName);\n\t\t}\n\t}", "function __construct()\n {\n\t\tparent::__construct();\n $this->load->model('subject_teachs');\n $this->load->model('years');\n $this->load->model('enrolls');\n $this->load->model('lecturer_responsibles');\n $this->load->model('assessments');\n $this->load->model('subjects');\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->load->model('data');\n\t}", "function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->load->model('colleges_model', 'colleges');\n\t\t// $this->load->model('programs');\n\t\t$this->load->model('courses_model', 'courses');\n\t\t$this->load->model('user_model', 'user');\n\t\t$this->load->model('forms_model', 'forms');\n\t\t$this->load->model('evaluation_model', 'evaluation');\n\t}" ]
[ "0.74059755", "0.73941755", "0.7359586", "0.7278778", "0.7209426", "0.7067413", "0.7043376", "0.70078754", "0.6996288", "0.6994316", "0.69548005", "0.69172853", "0.68836665", "0.686296", "0.6830915", "0.681001", "0.6793108", "0.6773899", "0.67595494", "0.6750379", "0.6749394", "0.6715737", "0.67088836", "0.6669048", "0.66689205", "0.66643524", "0.66436625", "0.66395515", "0.66355264", "0.6625488", "0.66220385", "0.6618969", "0.66146064", "0.660696", "0.65931225", "0.6591229", "0.6585111", "0.6581949", "0.6579556", "0.65679634", "0.65645987", "0.65593356", "0.65514654", "0.6546289", "0.65460545", "0.65428203", "0.65428203", "0.6542406", "0.65405756", "0.6536421", "0.6519081", "0.6517853", "0.65140545", "0.6506889", "0.65028995", "0.6502716", "0.6492004", "0.6491748", "0.6489221", "0.6483933", "0.6483052", "0.64806694", "0.6475797", "0.6471679", "0.6471456", "0.6469747", "0.6461033", "0.64606565", "0.6458668", "0.64583325", "0.64551085", "0.6449877", "0.64481497", "0.64392513", "0.6426044", "0.6421257", "0.6404196", "0.63995445", "0.63975525", "0.63821304", "0.63779134", "0.63776344", "0.63776124", "0.6373123", "0.6373106", "0.63719076", "0.6368627", "0.63597625", "0.63597625", "0.63491195", "0.6345392", "0.6342545", "0.63380927", "0.6334508", "0.6321049", "0.6320892", "0.6320256", "0.6317195", "0.6313366", "0.63119" ]
0.64407235
73
Function that displays the view
function home() { $data = $this->model->user_info(); $this->load->view('mainView.php', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view');\n\t}", "public function view() {\r\n\r\n\t}", "public function view(){\n\t\t$this->buildListing();\n\t}", "function showView()\n\t{\n\t\ttrigger_error(\"showView() is not implemented\");\n\t}", "public function index()\n\t{\n $this->view->render();\n\t}", "public function index()\n {\n\n\n $this->view->render();\n }", "public function show()\n {\n /** Configure generic views */\n $this->setupViews();\n /** Render views */\n ?>\n <html>\n <body>\n <?php\n /** Render views */\n $this->head_view->render();\n $this->secondary_nav_bar->render();\n $this->tree_view->render();\n $this->title_view->render();\n $this->primary_nav_bar->render();\n $this->render_page();\n ?>\n </body>\n </html>\n <?php\n }", "function index() {\n\n $this->view->render();\n\n }", "public function view() {\n }", "protected function viewAction()\n {\n }", "public function Display(){\n\t\trequire($this->viewFileName);\n\t}", "public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function view() {\n $this->view->data['view'] = 'hehe';\n /*** load the index template ***/\n $this->view->show('index/view');\n }", "public function view() {\n\t\treturn;\n\t}", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "public function view() {\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authenticate()) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend/login', '<strong>Error:</strong> Please login to continue.');\n\t\t\t}\n\t\t\t// Authorize w/ backend app.\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authorize('sharers', 'view')) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend', '<strong>Error:</strong> Insufficient user access.');\n\t\t\t}\n\t\t\t// Load view.\n\t\t\treturn $this->_loadView(dirname(__FILE__) .'/views/view.tpl');\n\t\t}", "public function view() {\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authenticate()) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend/login', '<strong>Error:</strong> Please login to continue.');\n\t\t\t}\n\t\t\t// Authorize w/ backend app.\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authorize('blog', 'view')) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend', '<strong>Error:</strong> Insufficient user access.');\n\t\t\t}\n\t\t\t// Load view.\n\t\t\treturn $this->_loadView(dirname(__FILE__) .'/views/view.tpl');\n\t\t}", "public function actionView()\n {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}", "public static function view() \n {\n $articleDAO = new ArticleDAO();\n $articles = $articleDAO->load();\n\n $dispatch = new Dispatch();\n $dispatch->render(\n 'main_page', [\n 'articles' => $articles\n ]\n );\n }", "public function index()\n {\n $this->view();\n }", "public function index()\n {\n $this->view();\n }", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "public function view()\n {\n $this->processParametersForView();\n \n if ($this->view === 'main/base') { //Legacy and body\n extract($this->data);\n \n include(__DIR__ . '/../View/' . $this->view . '.php');\n \n return;\n }\n \n //Templates\n $this->latteView();\n }", "public function actionView() {}", "public function actionView() {}", "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 view()\n {\n //\n }", "public function show()\n {\n return $this->view();\n }", "function view() {\n\t\treturn '';\n\t}", "public function viewAction()\n {\n $tiles = [];\n // Reuse the parameters from $_REQUEST\n // If we are going to render a full page for edit form, we shall also render the _form_controls\n $tiles[] = Region::create($this->getViewRegionPath(), array_merge($_REQUEST, [\n '_form_controls' => true,\n ]));\n return $this->render($this->findTemplatePath('page.html'), ['tiles' => $tiles ]);\n }", "function view()\n\t{\n\t\tglobal $tree, $ilUser, $ilCtrl, $lng;\n\n\t\t$this->showHierarchy();\n\t}", "function displayView($view_path) {\r\n return Angie::getTemplateEngine()->displayView($view_path);\r\n }", "public function display() {\n echo $this->render();\n }", "public function index() {\n\n\t\t\t$controller = $this->nav->getPageController();\n\t\t\tif(isset($controller) && is_object($controller)) {\n\t\t\t\tassert($controller instanceof \\Toeswade\\IController);\n\n\t\t\t\t$action = $this->nav->getPageAction();\n\t\t\t\t$params = $this->nav->getParams();\n\t\t\t\t\n\t\t\t\tif(isset($action)) {\n\t\t\t\t\t$view = $controller->$action($params);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$view = $controller->index();\n\t\t\t\t}\n\n\t\t\t\tassert($view instanceof \\Toeswade\\IView);\n\t\t\t\t$main = $view->getHTML();\n\t\t\t\t$title = $view->getTitle();\n\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t$main = 'default';\n\t\t\t\t$title = $main;\n\t\t\t}\n\t\t\t$this->view->setTitle($title);\n\t\t\t$this->view->setMain($main);\n\t\t\t$this->view->setNav($this->nav->getMainNavigation());\n\n\t\t\t$this->view->render();\n\t\t}", "Public Function ChamaView(){\n $params = array();\n echo ($this->gen_redirect_and_form(BaseController::ReturnView(BaseController::getPath(), get_class($this)), $params));\n }", "Public Function ChamaView(){\n $params = array();\n echo ($this->gen_redirect_and_form(BaseController::ReturnView(BaseController::getPath(), get_class($this)), $params));\n }", "public function view(){\n\n\t$this->registry->template->blog_heading = 'This is the blog heading';\n\t$this->registry->template->blog_content = 'This is the blog content';\n\t$this->registry->template->show('blog_view');\n}", "public function view(){\n\n\t$this->registry->template->blog_heading = 'This is the blog heading';\n\t$this->registry->template->blog_content = 'This is the blog content';\n\t$this->registry->template->show('blog_view');\n}", "abstract protected function renderView();", "public function index(){\r\n $this->display();\r\n }", "public function index(){\n \n $this->display();\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 actionView()\n {\n \n }", "public function views()\n {\n }", "public function views()\n {\n }", "public function views()\n {\n }", "public function view()\n\t{\n\t\t$this->load->database();\n\t\t$this->load->view('/admin/header');\n\t\t$this->load->view('/admin/content');\n\t}", "public function Index() {\n $this->Display();\n }", "Public Function ChamaView() {\n $params = array();\n echo ($this->gen_redirect_and_form(BaseController::ReturnView(BaseController::getPath(), get_class($this)), $params));\n }", "public function show()\n\t{\n\t\t\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function getView() {}", "public function getView() {}", "public function view(){\n\t\t\t$this->__switchboard();\n\t\t}", "public function getView(){ }", "function index()\n {\n $this->_view_edit('view');\n }", "public function show();", "public function show();", "public function show();", "public function show();", "public function display()\n\t{\n\t\tparent::display();\n\t}", "private function display(){\n\t\t \n\t\tif(empty($this->view)){\n\t\t\tthrow new Exception(\"Empty view requested!\");\n\t\t}\n\t\t\n\t\t$controller_class = \"Controllers_\" . $this->view;\n\t\t\n\t\tif(!class_exists($controller_class)){\n\t\t\tthrow new Exception(\"Controller not found for determined view '{$this->view}'\");\n\t\t\treturn;\n\t\t} \n\t\t\n\t\t$this->controller = new $controller_class($_GET, $_POST);\n\t\t\n\t\t$output = $this->controller->display();\n\t\treturn $output;\n\t}", "public function show()\n\t{\n\n\t}", "public function index()\n {\n return view($this->_config['view']);\n }", "public function index()\n {\n return view($this->_config['view']);\n }", "public function index()\n {\n return view($this->_config['view']);\n }", "public function show()\n {\n //the board string is used in the view\n $data = $this->getBoardAsString();\n require VIEW_PATH.'web.php';\n\n }", "public function IndexAction() {\r\n $this->ExecuteView();\r\n }", "public function index()\n\t{\n\t\t$this->view($this->user_id);\n\t}", "public function action_view()\n {\n // Correct page has been loaded in the before() function\n $pagename = Wi3::inst()->routing->args[0];\n $this->prepareForViewing($pagename);\n // Render page\n $renderedInAdminArea = false;\n $this->request->response = Wi3_Renderer::renderPage($pagename, $renderedInAdminArea);\n // Page caching will be handled via an Event. See bootstrap.php and the Caching plugin\n }", "public function getView()\n {\n }", "public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$adv=CCacheHelper::getAdvertisement(123);\n\t\t$data=compact('adv');\n\t\t$this->render('view',$data);\n\t}", "public function view(): mixed;", "public function ViewAction()\r\n\t{\r\n\t\t$this->View->author = $this->Author->select();\r\n\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 view() {\n\t\t// Find page by url slug\n\t\t$slug = $this->app->getSlug();\n\t\t$page = Page::findBySlug($slug);\n\t\t\n\t\t// If page exists render it, otherwise 404\n\t\tif ($page) {\n\t\t\t$this->title = $page->name;\n\t\t\t$this->pageData['page'] = $page;\n\t\t\t$this->render('view');\n\t\t} else {\n\t\t\t$this->noRoute();\n\t\t}\n\t}", "private static function view()\n {\n $files = ['View'];\n $folder = static::$root.'MVC/View'.'/';\n\n self::call($files, $folder);\n\n $files = ['Template', 'Views'];\n $folder = static::$root.'MVC/View/Libs'.'/';\n\n self::call($files, $folder);\n\n $files = ['ViewNotFoundException'];\n $folder = static::$root.'MVC/View/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function index() {\n $this->renderView(\"index\");\n }", "public function getView();", "public function viewAction()\n {\n $blogpostId = $this->_registry->args[0];\n $blogpost = new Rwtt_Entity_BlogPost();\n $blogpost->loadById($blogpostId);\n $this->view->title = $blogpost->title;\n $this->view->content = $blogpost->content;\n }", "public function show()\n {\n //\n }", "public function show() {\n \n }", "public function display(){}", "public function display()\n {\n $this->view->viewFile = \"404\";\n echo $this->view->generateMarkup();\n }", "public function personHistoryView(){\n $this->view('auditor/personHistoryView');\n \n $this->view->render(); // This is how load the view\n }", "public function show() {\n\t}", "public function display() {}" ]
[ "0.8342671", "0.822674", "0.8211723", "0.8069244", "0.80444956", "0.80033183", "0.78948283", "0.78610516", "0.7820675", "0.77964765", "0.77833325", "0.7716576", "0.77064896", "0.76971924", "0.76970154", "0.76818407", "0.7680434", "0.7663264", "0.7663264", "0.76576406", "0.7652951", "0.76359695", "0.7613274", "0.7602613", "0.75821537", "0.75821537", "0.756801", "0.7564324", "0.7548443", "0.7548443", "0.7539796", "0.7537225", "0.7509802", "0.7493964", "0.74918824", "0.74406433", "0.7387397", "0.7376573", "0.7375789", "0.73718596", "0.73718596", "0.73644936", "0.73644936", "0.73473483", "0.7341637", "0.73391366", "0.7326347", "0.7326347", "0.7326347", "0.7323333", "0.73217356", "0.7321323", "0.7321323", "0.73205394", "0.73180765", "0.7315504", "0.73095715", "0.730262", "0.730262", "0.730262", "0.730262", "0.730262", "0.72902805", "0.72902805", "0.72838753", "0.72770345", "0.7276461", "0.7274481", "0.7274481", "0.7274481", "0.7274481", "0.7274045", "0.72554743", "0.7244271", "0.724039", "0.724039", "0.724039", "0.7233079", "0.7229985", "0.72253835", "0.7223385", "0.7219386", "0.7207476", "0.718038", "0.71694475", "0.716696", "0.71624625", "0.71624625", "0.71624625", "0.71597147", "0.7155422", "0.71305865", "0.7126726", "0.71200913", "0.7117178", "0.711418", "0.71074724", "0.7103295", "0.7102792", "0.7102639", "0.710114" ]
0.0
-1
function for connecting to the database
function db_connect() { // Requiring the configuration file that holds the config data for connection require 'config.php'; try { $conn = new PDO("mysql:host=localhost;dbname=packsave", $config['DB_USER'], $config['DB_PASS']); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo 'ERROR: '. $e->getMessage(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function connectToDB() {}", "public function connect_db() {\n }", "public function connectDB() {}", "function connectDB();", "private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}", "function connectToDatabase() {\n\n $host = self::servername;\n $databaseName = self::dbname;\n $password = self::password;\n $username = self::username;\n //To create the connection\n $conn = new mysqli($host, $username, $password, $databaseName);\n self::$conn = $conn;\n //Connection Checking, if there is a connection error, print the error\n if ($conn->connect_error) {\n exit(\"Failure\" . $conn->connect_error);\n }\n }", "function connect_to_db(){\n\t\t//Fun Fact: @ suppresses errors of the expression it prepends\n\t\t\n\t\t//Connect to the database and select the database\t\t\t\n\t\ttry{\n\t\t\t$this->connection = new PDO(\"mysql:host=$DATABASE_HOST;dbname=DATABASE_NAME\", DATABASE_USER, DATABASE_PASS);\n\t\t\t$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t}catch(PDOException $err){\n\t\t\tdie('Could not connect to database' . $err->getMessage());\n\t\t}\t\t\n\t}", "private function dbConnect(){\n $database=new \\Database();\n return $database->getConnection();\n }", "private function connectDB()\n\t{\n\t\t$this->db = ECash::getMasterDb();\n\t\t\n\t//\t$this->dbconn = $this->db->getConnection();\n\t}", "function dbConnect () {\n\t$con = mysql_connect($this -> host, $this -> user, $this -> pass);\n mysql_select_db($this->dbname,$con);\n\t}", "function db_connect(){\n\t\tif(SQ_DEBUG){\n\t\t\t$this->dbh = mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true);\n\t\t}else{\n\t\t\t$this->dbh = @mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true);\n\t\t}\n\t\t\n\t\tif (!$this->dbh){\n\t\t\t$error_message = sprintf(SQ_DB_CONN_ERROR_MESSAGE, $this->dbhost, $this->dbuser);\n\t\t\tthrow new SQ_Exception($error_message, SQ_DB_CONN_ERROR_CODE);\n\t\t}\n\t\t$this->ready = true;\n\t\t\n\t\ttry{\n\t\t\t$this->select($this->dbname, $this->dbh);\n\t\t}catch(SQ_Exception $e){\n\t\t\tthrow $e;\n\t\t}\n\t}", "function connect(){\r\n\r\n\r\n $db = mysqli_connect('[Server]','[User]','[Password]','[Database]');\r\n\r\n\r\n return $db;\r\n }", "private function connect() {\n $host = $this->dbConfig[$this->selected]['host'];\n $login = $this->dbConfig[$this->selected]['login'];\n $password = $this->dbConfig[$this->selected]['password'];\n $database = $this->dbConfig[$this->selected]['database'];\n try {\n $this->db = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=utf8', $login, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n//\t\t\t$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } catch (PDOException $e) {\n die('Could not connect to DB:' . $e);\n }\n }", "public function connectToDatabase(){\n\t\t$dbinfo=$this->getDBinfo();\n\n\t\t$host=$dbinfo[\"host\"];\n\t\t$dbname=$dbinfo[\"dbname\"];\n\t\t$user=$dbinfo[\"user\"];\n\t\t\n $pass=$this->getPassword();//don't share!!\n\n try{\n $DBH = new PDO(\"mysql:host=$host;dbname=$dbname\", $user, $pass);\n $DBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n }catch(PDOException $e){\n $this->processException($e);\n }\n \n $this->setDBH($DBH);\n }", "function connect()\n {\n\trequire_once dirname(__FILE__) . '/db_config.php';\n\t$connstring = \"host={$DB_SERVER} port={$DB_PORT} dbname={$DB_DATABASE} \".\n\t\t \"user={$DB_USER} password={$DB_PASSWORD}\";\n\t$db = pg_connect($connstring);\n\n\treturn $db;\n }", "public function connectdb()\n {\n $this->db = mysql_connect($this->host,$this->port, $this->user, $this->pass)\n if (!$db)\n {\n die('Could not connect: ' . mysql_error());\n }\n\n mysql_select_db($this->database, $this->db);\n }", "public function connectDB ($param);", "function connectDB(){\n\t\tif(!$this->conId=mysql_connect($this->host,$this->user,$this->password)){\n trigger_error('Error connecting to the server '.mysql_error());\n exit();\n\t\t}\n\t\tif(!mysql_select_db($this->database,$this->conId)){\n\t\t\t trigger_error('Error selecting database '.mysql_error());\n\t\t\t exit();\n\t\t}\n\t}", "private function connect(){\n\t\trequire (__DIR__ . '/../../config.php');\n\t\t$mysqlCFG =$database['mysql'];\n\t\t\n\t\tif(!self::$db){\n\t\t\t$connectionString = \"mysql:host=$mysqlCFG[host];dbname=$mysqlCFG[dbname]\";\n\t\t\ttry{\n\t\t\t\tself::$db = new \\PDO($connectionString, $mysqlCFG['user'], $mysqlCFG['password']);\n\t\t\t\tself::$db->setAttribute( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t\t}catch(\\PDOException $e){\n\t\t\t\tdie(\"Ocurrio un error al conectar con la base de datos: $e->getMessage()\");\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function connect_db()\n\n\t{\n\n\t\t\n\n\t\t$param_array = func_get_args();\n\n\t\t//$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::connect_db() - PARAMETER LIST : ', $param_array, true);\n\n\t\t\n\n\t\t$error_title = 'Error In Method : database_manipulation::connect_db()';\n\n\t\t$error_str = '';\n\n\t\t\n\n\t\t$con = mysql_connect(\"serevername\",$this->dbusername,$this->dbpassword);\n\n\t\t\n\n\t\t$error_str .= mysql_error();\n\n\t\t\n\n\t\t$res = mysql_select_db($this->dbname, $con);\n\n\n\n\t\t$error_str .= mysql_error();\n\n\t\t\n\n\t\t//log errors...\n\n\t\t$GLOBALS['logger_obj']->error($error_title, $error_str, 'mysql');\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::connect_db() - Return Value : ', $con, true);\n\n\n\n\t\treturn $con;\n\n\n\n\t}", "private function func_connect() {\n $this -> lnk = mysql_connect($this -> host, $this -> user, $this -> password, true) OR die('Could not connect to the database - Why: '.mysql_error());\n mysql_select_db($this -> database) OR die('Could not find database: '.mysql_error());\n }", "function OpenCon() {\n $dbhost = \"\";\n $dbuser = \"\";\n $dbpass = \"\";\n if($_SERVER['SERVER_NAME'] == \"localhost\"){\n $dbhost = \"localhost\";\n $dbuser = \"root\";\n $dbpass = \"root\";\n }\n else{\n $dbhost = \"db.cs.dal.ca\";\n $dbuser = \"aio\";\n $dbpass = \"ge7ochooCae7\";\n }\n $db = \"aio\";\n $conn = new mysqli($dbhost, $dbuser, $dbpass, $db) or die(\"Connect failed: %s\\n\". $conn -> error);\n return $conn;\n }", "function connect()\n\t{\n\t\tglobal $connection;\n\n\t\t$connection = mysql_connect(HOST, USER, PASS)\n\t\t\tor die(\"Cannot connect to $host as $user:\" . mysql_error());\n \n\t\tmysql_select_db(DBNAME)\n\t\t\tor die (\"Cannot open $dbName:\" . mysql_error());\n\n\t}", "function db_connect() {\n\t$database = new mysqli(DB_SERVER, DB_USER, DB_PASS, DB_NAME); //create the object $connection\n\tconfirm_db_connect($database);\n\n\t// this function returns the object $connection with the database\n\treturn $database; \n\t}", "function connect(){\n\n\t\t$conn = mysql_connect(DB_HOST , DB_USER , DB_PASS) ;\n\t\tif(!$conn){\n\t\t\tdie('could not connect to :'.mysql_error()) ;\n\t\t}\n\n\t\terror_log('conn- databsae: $conn') ;\n\n\t\t// select a database\n\t\t$database = mysql_select_db(DB_NAME, $conn );\n\n\t\tif (!$database) {\n\t\t\t\tdie('Could not use database '.DB_NAME .mysql_error() );\n\t\t}\n\t\telse {\n\t\t\treturn $conn ;\n\t\t}\n\n\t}", "function connectDatabase() {\n mysql_pconnect(SERVER, USERNAME, PASSWORD)\n or die('Could not connect: ' . mysql_error());\n\n mysql_select_db(DATABASE_NAME)\n or die('Could not select: ' . mysql_error());\n}", "public function connect($db_properties);", "private function connectToDb()\n {\n //home connect\n $link =pg_connect(\"host=localhost dbname=user1 user=postgres\");\n if(!$link)\n {\n die('Connect Error');\n }\n $this->dbConnect = $link;\n }", "function db()\n\t{\n\t\tglobal $dbhost, $dbuser, $dbpass, $dbname;\n\t\t$this->db_server_link = @mysql_connect($dbhost, $dbuser, $dbpass);\n\t\tmysql_select_db($dbname, $this->db_server_link) ;\n\t}", "function db_connect()\n\t{\t\n\t\tini_set('display_errors', 'On');\n\t\t$hostname = 'oniddb.cws.oregonstate.edu'; \n\t\t$dbname = 'gonsalvj-db';\n\t\t$username = 'gonsalvj-db';\n\t\t$password = 'PAKum3uAIPOc0WJY';\n\t\n\t\t$mysqli = new mysqli($hostname,$dbname ,$password,$username);\n\t\tif($mysqli->connect_errno){\n\t\t\techo \"Connection error \" . $mysqli->connect_errno . \" \" . $mysqli->connect_error;\n\t\t}\t\n\t\treturn $mysqli;\n\t}", "function db_connect() {\n // $connection = mysqli_connect('localhost', 'ics325fa2005', '','root');\n $conn = mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_NAME);\n\n confirm_db_connect();\n return $connection;\n }", "private function connect()\n {\n if ($this->configuration->get('db.connector') == 'PDO') {\n $dsn = \"mysql:host=\" . $this->configuration->get('db.host') . \";dbname=\" . $this->configuration->get('db.name');\n $options = array();\n $this->db = new PDO(\n $dsn, $this->configuration->get('db.username'), $this->configuration->get('db.password'), $options\n );\n } elseif ($this->configuration->get('db.connector') == 'mysqli') {\n $this->db = mysqli_connect(\n $this->configuration->get('db.host'), $this->configuration->get('db.username'), $this->configuration->get('db.password'), $this->configuration->get('db.name')\n );\n }\n }", "public function db_connect(){\n $db_username = $this->db['username'];\n $db_password = $this->db['password'];\n $db_host = $this->db['host'];\n\n // Start Connection\n $mysql = mysqli_connect($db_host,$db_username,$db_password);\n (!$mysql ? die(\"ERROR: \" . mysqli_error($this->mysql)) : TRUE);\n // Return MySQL Resource\n return $mysql;\n }", "private function connect() {\n $this->load->database();\n }", "function DbConnection() { \n\t\t/*if(file_exists('../lib/dbconfig.xml')){\n\t\t\t\n\t\t $xml = simplexml_load_file('../lib/dbconfig.xml');\n\t\t\t$this->user =$xml->user;\n\t\t\t$this->password =$xml->password;\n\t\t\t$this->host =$xml->host;\n\t\t\t$this->database =$xml->name;\n\t\t \n\t\t} \n\t\telse{\n\t\t\t\n\t\t exit('Failed to open :database_configuration.xml');\n\t\t \n\t\t}*/\n\t\t$this->host='localhost';\n\t\t$this->user='root';\n\t\t$this->database='iims';\n\t\t$this->password='';\n\t\t\n\t\t\n\t\t $this->linkId = @mysql_connect($this->host, $this->user,$this->password)or die(\"Error in connecting to db server: \".mysql_error()); \n\t\t$this->db = @mysql_select_db($this->database,$this->linkId)or die(\"Error in connecting to database: \".mysql_error()); \n\t}", "function db_connect($db_hostname, $db_username, $db_password, $db_name)\n\t{ global $db_port;\n\t\t$this->db_connection = pg_connect(\"host=\".$db_hostname.\" port=\".$db_port.\" dbname=\".$db_name.\" user=\".$db_username.\" password=\".$db_password) \n\t\t\tOR die (\"Connection Error to PostgreSQL Server\");\n\t\treturn $this->db_connection;\n\t}", "function connect() \n\t{\n include(\"salon_connect.php\");\n\t\t\n \n\t\t$connection = mysqli_connect(DB_server,DB_user,DB_pass,DB_data);\n\n return $connection;\n }", "function connect() \n\t{\n include(\"salon_connect.php\");\n\t\t\n \n\t\t$connection = mysqli_connect(DB_server,DB_user,DB_pass,DB_data);\n\n return $connection;\n }", "function createConection(){\n\n\t\tglobal $db_host;\n\t\tglobal $db_usr;\n\t\tglobal $db_pwd;\n\t\tglobal $db_name;\n\t\tglobal $db_port;\n\n\t\treturn pg_connect('user='.$db_usr.' password='.$db_pwd.' host= '.$db_host.' dbname = '.$db_name.' port = '.$db_port);\n\t}", "function db_connect(){\r\n global $database;\r\n\r\n return mysqli_connect(\r\n $database['server'],\r\n $database['username'],\r\n $database['password'],\r\n $database['db_name']\r\n );\r\n }", "function connect() // this function connects to mysql database\n\t{\n \t\t// this step can verify host, users, and password are correct before the connection; otherwise, \n \t\t//connection will be failed if one of them is incorrect \n\t\tmysql_connect(DB_HOST,DB_USER,DB_PASS) or die('could not connect to database'. mysql_error());\n\n\t\tmysql_select_db(DB_NAME);\n\t}", "function dbConnect(){\n\t$host = \"localhost\"; // for uta.cloud server, \"localhost\" is the host name. Do not edit.\n\t$user = \"egsutacl_egs3925\"; // put your own user name here.\n\t$pwd = \"Es*2802*\"; // put your own database password here\n\t$database = \"egsutacl_4350\"; // put your database name here\n\t$port = \"3306\"; // server-specific. For uta.cloud, the port number is 3306 (the default port)\n\n\t/* Initiate a new mysqli object to connect to the Database. Store the mysqli object in a variable $conn. */\n\t$conn = new mysqli($host, $user, $pwd, $database, $port) or die(\"could not connect to server\");\n\n\t// return $conn to the fucntion call\n\treturn $conn;}", "function connectToDatabase() {\n $servername = '127.0.0.1';\n $username = 'runlog_user';\n $password = 'run4FUN';\n $db = 'runlog';\n\n try {\n $conn = new PDO(\"mysql:host=$servername;dbname=$db\", $username, $password);\n // set the PDO error mode to exception\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch(PDOException $e) {\n echo \"Database connection failed: \" . $e->getMessage();\n }\n return $conn;\n }", "protected function connectDB () {\n $host=$this->Parameters['db_host'];\n $username=$this->Parameters['db_username'];\n\t\t$password=$this->Parameters['db_userpassword'];\n\t\t$dbname=$this->Parameters['db_name'];\n\t\t\n $this->Conn = new mysqli ($host,$username,$password,$dbname);\n if($this->Conn->connect_errno > 0){\n throw new Exception('Unable to connect to database [' . $this->Conn->connect_error . ']');\n }\n }", "private function connect()\n\t{\n\t\t$connectionData = $this->app->file->requireFile('config.php');\n\t\t\n\t\textract($connectionData);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tstatic::$connection = new PDO('mysql:host=' . $server . ';dbname=' . $dbname, $dbuser, $dbpass);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t\n\t\t\tstatic::$connection->exec('SET NAMES utf8');\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\t\t\t\t\n\t}", "function connect() {\n include(\"salon_connect.php\");\n\t\t\n \n\t\t$connection = mysqli_connect(DB_server,DB_user,DB_pass,DB_data);\n\n return $connection;\n }", "public function connect()\n {\n $data = $this->app->file->requireFile('config.php');\n extract($data);\n try {\n static::$DB = new PDO('mysql:host=' . $server . ';dbname=' . $dbname , $dbuser , $dbpass);\n\n static::$DB->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE , PDO::FETCH_OBJ);\n static::$DB->setAttribute(PDO::ATTR_ERRMODE , PDO::ERRMODE_EXCEPTION);\n static::$DB->exec('SET NAMES utf8');\n\n }\n catch (PDOException $e){\n die($e->getMessage());\n }\n }", "function conectiondb()\n\t{\n\t\tif (!($link=@mysql_pconnect($this->home,$this->user,$this->pass)))\n\t\t//if(!($link=@mysql_connect(\"67.227.188.182\",\"forttec_usr433d\",\"Er56-df3G?1\")))\n\t\t{\n\t\t echo \"*-*-*-Error when connecting itself to the database\".mysql_error();\n\t exit();\n\t \t}\n \t\tif (!mysql_select_db($this->database,$link))\n\t \t{\n \t echo \"Error the database not exists\";\n\t exit();\n \t\t}\n\t\tset_time_limit(20000);\n \t\treturn $link;\n\t}", "private static function get_connect(){\n static::$db = pg_connect(static::$host . \" \" . static::$port . \" \" . static::$database . \" \" . static::$user . \" \" . static::$pass);\n }", "function connectdb() {\n include('dbinfo.php');\n $con=mysql_connect($host,$user,$password);\n if (!$con) {\n\t\tdie('Could not connect to mysql: ' . mysql_error());\n\t}\n mysql_select_db($database) or die('Error connecting to database. '. mysql_error());\n}", "function dbConnect(){\r\n\t$host = \"localhost\"; // this is typically just \"localhost\"\r\n\t$user = \"id1360972_elliott\"; // user name\r\n\t$pwd = \"170592\"; // database password\r\n\t$database = \"id1360972_mysqldemo\"; // database name\r\n\r\n\t// initiate a new mysqli object to connect to the Database. Store the mysqli object in a variable $conn.\r\n\t$conn = new mysqli($host, $user, $pwd, $database) or die(\"could not connect to server\");\r\n\r\n\t// return $conn to the fucntion call\r\n\treturn $conn;}", "private function connectToDatabase()\n {\n return DbConnection::connectToDatabase($this->link);\n }", "function setDatabaseConnection($host,$database,$user,$pass);", "public function connect() {\r\n\t\t$this->connection = mysql_connect($this->host, $this->username, $this->password);\r\n\t\t$this->selectDB($this->squema);\r\n\t}", "function conn()\n {\n require_once(\"../hidden/db_login_info.php\");\n \tif(!isset($GLOBALS['dbc']))\n \t{\n \t\t$GLOBALS['dbc'] = @mysqli_connect($dbhost, $dbuser, $dbpass)\n \t\t\tOR die (\"<p>1:Could not connect to database</p>\");\n\t\t\n \t\t@mysqli_select_db($GLOBALS['dbc'], $dbname)\n \t\t\tOR die (\"<p>2:Could not select the database</p>\");\n \t}\n }", "function db_connect() {\n\t$link = mysql_connect('localhost', 'ceng499', 'ceng499');\n\tif(!$link) {\n\t\tdie('Could not connect: 50000' . mysql_error());\n\t}\n\t\n\t$db_selected = mysql_select_db('pihome', $link);\n\tif(!$db_selected) {\n\t\tdie ('Can\\'t use pihome: ' . mysql_error());\n\t}\n}", "function dbConnect(){\n\t\tglobal $config;\n\t\t$conn = mysql_connect($config[\"db_server\"], $config[\"db_utente\"], $config[\"db_password\"]) or die (\"Errore nella connessione al db: \" . mysql_error());\n\t\tmysql_select_db($config[\"db_database\"]) or die (\"Errore nella selezione del db: \" . mysql_error());\n\t\treturn $conn;\t\n\t}", "function connectSql()\n{\n $host = '';\n $username = '';\n $password = '';\n $database = '';\n $link = connect($host, $username, $password, $database);\n return $link;\n}", "function accedi_db() {\n include(\"db.conf.php\");\n $db = mysql_connect($db_host, $db_user, $db_pass);\n mysql_select_db($db_name, $db);\n }", "function _dbconnect() \n {\n global $database;\n $link = mysql_connect($database['dbhost'], $database['user'], $database['pass']);\n if (!$link) { die('Not connected : ' . mysql_error()); }\n $db_selected = mysql_select_db($database['dbname'], $link);\n if (!$db_selected) { die ('Can\\'t use '.$database['dbname'].' : ' . mysql_error()); } \n }", "private function connect()\n {\n if (! is_null(self::$db)) {\n return;\n }\n\n // $this->host \t= $Database->host;\n // $this->user \t= $Database->user;\n // $this->pass \t= $Database->pass;\n // $this->database\t= $Database->database;\n\n $conn = 'mysql:dbname=' . $this->dbInfo->database . ';host=' . $this->dbInfo->host.';charset=utf8';\n try {\n self::$db = new PDO($conn, $this->dbInfo->user, $this->dbInfo->pass);\n } catch (PDOException $e) {\n die('Could not connect to database (' . $conn . ')');\n }\n }", "public function connect() {\n if ($this->link = mysql_connect($this->host, $this->user, $this->pass)) {\n if (!empty($this->name)) {\n if (!mysql_select_db($this->name)) {\n $this->exception(\"Could not connect to the database!\");\n }\n }\n } else {\n $this->exception(\"Could not create database connection!\");\n }\n }", "function connect()\n\t{\n\t\t$this->db=new MySQLi($this->localhos,$this->username,$this->passw,$this->data_name)or die(\"could not connect\");\n\t\t\n\t\treturn $this->db;\n\t}", "function connectDb($p1, $p2, $p3, $p4)\n\t{\n\t\t//$con = mysqli_connect(\"localhost\", \"root\", \"abcde\", \"qpkg\"); \n\t\t$con = mysqli_connect($p1, $p2, $p3, $p4);\n\t\tmysqli_query($con, \"SET NAMES 'UTF8'\");\n\n\t\tif (mysqli_connect_error()) {\n\t\t\techo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn $con;\n\t\t}\n\t}", "public function connect(){\n $this->database->connect($this->server, $this->login, $this->password, $this->db_name);\n if($this->database->connect_errno){\n return;\n }\n //nastavi kodovanie databazy na UTF-8\n $this->database->query(\"SET CHARACTER SET utf8\");\n $this->connected=true;\n }", "private function connect() {\r\n\t\tunset($this->dbLink);\r\n\t\t/* create connection to database host */\r\n\t\t// $dbLink = mysql_connect(\"mysql.localhost\", \"de88623\", \"proberaum1\");\r\n\t\t$dbLink = mysql_connect(\"localhost\", \"robert\", \"YMbHFY+On2\");\r\n\t\t/* select database */\r\n\t\tmysql_select_db(\"robert_www_parkdrei_de\");\r\n\t\t/* set link to database as a object attribute */\r\n\t\t$this->dbLink = $dbLink;\r\n\t}", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "protected function db_connect() {\n \n // Data source name\n $this->dsn = 'mysql:host=' . $this->db_host . ';dbname=' . $this->db_name . ';charset=' . $this->db_charset;\n\n // Makes a connection to the database\n $this->db_conn = new PDO( $this->dsn, $this->db_user, $this->db_password );\n\n // When fetching an SQL row it turn into an object\n $this->db_conn->setAttribute( PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ );\n // Gives the Error reporting atribute and throws exeptions\n $this->db_conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n \n // Returns the connection\n return $this->db_conn;\n\n }", "function dbconnect()\n {\n $link = mysql_pconnect(\"localhost\", \"root\", \"s3ns89ui\") or die(mysql_error());\n $db_selected = mysql_select_db(\"analytics\", $link) or die(mysql_error());\n }", "function db_connect()\n {\n require \"config.php\";\n $connection = new mysqli($host, $db_username, $db_pw, $dbname);\n return $connection;\n }", "public function db_connect()\n\t\t{\n\t\t\t$conn = mysqli_connect(LOCALHOST, USERNAME, PASSWORD) or die(mysqli_error()); \n\t\t\treturn $conn;\n\t\t}", "function connectDB() {\n $dbh = mysqli_connect(\"127.0.0.1:3306\", \"admin\", \"P@ssw0rd\", \"travelexperts\");\n return $dbh;\n }", "function connect() {\n trigger_before( 'connect', $this, $this );\n $this->conn = mysql_connect($this->host,$this->user,$this->pass,$this->opt1,$this->opt2);\n if (!$this->conn) {\n $this->db_open = false;\n trigger_error(\"Sorry, the database connection failed. Please check your database connection settings.\".@mysql_error($this->conn), E_USER_ERROR );\n } else {\n $this->db_open = mysql_select_db($this->dbname);\n if (!$this->db_open)\n trigger_error(@mysql_error($this->conn), E_USER_ERROR );\n }\n return $this->db_open;\n }", "public function connect() {\n $this->database = new mysqli(\n $this->dbinfo['host'],\n $this->dbinfo['user'],\n $this->dbinfo['pass'],\n $this->dbinfo['name']\n );\n if ($this->database->connect_errno > 0)\n return $this->fail(\"Could not connect to database: [{$this->database->connect_error}]\");\n }", "function connect() {\n // import database connection variables\n require_once __DIR__ . '/db_config.php';\n\n // Connecting to mysql database\n $con = mysqli_connect(DB_SERVER, DB_USER, DB_PASSWORD) or die(mysqli_error());\n\n // Selecing database\n $db = mysqli_select_db($con, DB_DATABASE) or die(mysqli_error()) or die(mysqli_error());\n\n // returing connection cursor\n\n return $con;\n }", "function connect()\n\t{\n\t\t$this->conn = mysql_connect($this->host, $this->user, $this->password) or $this->error(mysql_error(), __LINE__, __FILE__);\n\t\t$this->serverVersion = explode('.', preg_replace('/^(\\d+)\\.(\\d+)\\.(\\d+)(.*?)$/', '\\1.\\2.\\3', mysql_get_server_info()));\n\t\t$this->select_db();\n\t}", "function connect()\n\t{\n\t\t$this->link = mysql_connect( $this->hostname, $this->username, $this->password );\n\t\t\n\t\tif( $this->link === FALSE )\n\t\t\tthrow new Exception('MySQLDatabase: Failed to connect to database.');\t\n\t\t\t\n\t\t$db_selected = mysql_select_db( $this->database, $this->link );\n\t\t\n\t\tif( $db_selected === FALSE )\n\t\t\tthrow new Exception('MySQLDatabase: Failed to select database: '.$this->database );\t\n\t}", "public function getConnect()\n {\n $this->conn = Registry::get('db');\n }", "private function dbconnect()\n {\n $this->db = new mysqli(Config::$dbhost, Config::$dbuser, Config::$dbpass, Config::$database);\n if (mysqli_connect_errno()) {\n Log::info(sprintf(\"Connect failed: %s\\n\", mysqli_connect_error()));\n exit();\n }\n }", "function connect_to_database () {\n $conn = mysqli_connect (\"localhost\", \"root\", \"\", \"db_enrico_manicaro\")\n or die (\"Unable to connect to the database.\");\n \n return $conn;\n }", "function dbconnect()\n\t{\n\t\t$dbConnString = \"host=173.254.28.90 options='--client_encoding=UTF8' user=feedmati_user dbname=feedmati_system password=PZi0wuz9n+XX\";\n\t\t$dbConn = pg_connect($dbConnString ) or die(\"Problem with connection to PostgreSQL:\".pg_last_error());\n\t\treturn $dbConn;\n\t}", "function dbconnect() {\n $link = mysql_connect(\"localhost\", \"cadmin\", \"cadmin\")\n or die(\"Could not connect : \" . mysql_error());\n mysql_select_db(\"cevents\") or die(\"Could not select database\"); \n}", "public function connect() { \n\t\t// Try and connect to the database\n\t\tif (!isset(self::$connection)) {\n\t\t\t/*Load configuration as an array. Use the actual location of your configuration file (Ini file isn't working for now)\n\t\t\t$config = parse_ini_file('C:/wamp/www/database/config.ini'); \n\t\t\tself::$connection = new mysqli('localhost',$config['username'],$config['password'],$config['dbname']);*/\n\t\t\tself::$connection = new mysqli('thepark.db.5969281.hostedresource.com','thepark','OIZtRQmFhopZnGgPOofbLGQbENlVcTk6BOQCNX6PgmaunxRqVO@','thepark');\n\t\t}\n\n\t\t// If connection was not successful, handle the error\n\t\tif (self::$connection === false) {\n\t\t\t// Handle error by notifiying admin and taking user to error page\n\t\t\tmail('[email protected]','Database connection error','A tried to load a page and the database connection failed');\n\t\t\theader('Location: ../error.php');\n\t\t\texit();\n\t\t}\n\t\treturn self::$connection;\n\t}", "public static function databaseConnect()\n {\n self::$mysqli->connect(self::$dbHost, self::$dbUser, self::$dbPass, self::$dbName);\n }", "function openDatabaseConnection() {\n\t\t# open connection to MySQL database\n\t\t$link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD)\n\t\t\tor die(\"Could not connect to the SQL database server help\");\n\t\tmysql_select_db(MYSQL_DATABASE) or die(\"Could not connect to the SQL database server\");\n\t}", "function connect(\n\t\t$dbname)\n\t{\n\t\trequire 'config.php';\n\n\t\t$servername = $configs['db_servername'];\n\t\t$username = $configs['db_username'];\n\t\t$password = $configs['db_password'];\n\n\t\t// Create connection\n\t\t$this->connection = new mysqli($servername, $username, $password, $dbname);\n\n\t\t// Check connection\n\t\tif ($this->connection->connect_error) {\n\t\t\tdie(\"Connection failed: \" . $this->connection->connect_error);\n\t\t}\n\t}", "function connect()\n {\n $this->db = new MysqliAdapter($this->config[$this->sectionName]);\n \n if (isset($this->config[$this->sectionName]['username']) && isset($this->config[$this->sectionName]['password']))\n {\n if (!$this->db->connect())\n {\n writeLog('Could not connect to server', E_USER_ERROR);\n exit;\n }\n writeLog(\"connect successfull\");\n } \n else \n {\n writeLog(\"no username or password\");\n $this->unauthorized();\n exit;\n }\n }", "private function db_connect() {\n\n\t\t$new_link = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : TRUE;\n\t\t$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;\n\n\t\t// Connect to database.\n\t\tif ( DEBUG_MODE ) {\n\t\t\t$this->dbcon = mysqli_connect($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname, $this->dbport);\n\t\t} else {\n\t\t\t$this->dbcon = @mysqli_connect($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname, $this->dbport);\n\t\t}\n\n\t\tif ( mysqli_connect_errno () ) {\n\t\t\t/* ===== Bail ===== */\n\t\t\tif (DEBUG_DISPLAY) {\n\t\t\t\techo (\"Failed to connect to MySQL: \" . mysqli_connect_error() . '<br />');\n\t\t\t}\n\t\t}\n\n\t\t// Set charset.\n\t\tmysqli_set_charset ( $this->dbcon, $this->dbcharset );\n\n\t\t// Set collate.\n\t\t// mysqli_query ( $this->dbcon, \"COLLATE {$this->dbcollate}\" );\n\n\t\t// Set the database as ready for queries.\n\t\t$this->ready = TRUE;\n\t}", "function db_connect() {\n static $conn;\n\n if (!isset($conn))\n if (!($conn = mysqli_connect(\"localhost:3306\", \"root\", \"samsung\", \"rush00\")))\n die (\"Connection failed: \" . mysqli_error($conn));\n return ($conn);\n }" ]
[ "0.8563752", "0.8514852", "0.85057884", "0.8452861", "0.83215505", "0.81249756", "0.80927604", "0.80416805", "0.80143887", "0.80126905", "0.7918791", "0.79169834", "0.7894085", "0.7870125", "0.78358555", "0.78251123", "0.7819531", "0.7817315", "0.7799797", "0.7794364", "0.7785114", "0.77814883", "0.7771996", "0.7769188", "0.7761863", "0.7747417", "0.77395177", "0.770783", "0.76986134", "0.7688169", "0.76829964", "0.7679559", "0.7672452", "0.7666263", "0.7663216", "0.7653561", "0.7649677", "0.7649677", "0.7644577", "0.7641841", "0.7639082", "0.7634534", "0.76337063", "0.7630461", "0.7628651", "0.7628582", "0.7628459", "0.7624372", "0.76242596", "0.76224416", "0.7609609", "0.7608102", "0.7606974", "0.7603873", "0.7602215", "0.76000607", "0.75962406", "0.75939584", "0.75927836", "0.7590682", "0.75906086", "0.7581242", "0.7575666", "0.7574413", "0.75645155", "0.7559631", "0.7559451", "0.7559451", "0.7559451", "0.7559451", "0.7559451", "0.7559451", "0.7559451", "0.7559451", "0.7559451", "0.7559451", "0.7559451", "0.7559451", "0.755527", "0.75537705", "0.7553535", "0.75403166", "0.7538839", "0.7523416", "0.7515197", "0.7514044", "0.75127757", "0.7507024", "0.7497218", "0.74811655", "0.7478422", "0.74723995", "0.7472229", "0.74704504", "0.7468654", "0.74677265", "0.7466061", "0.74641734", "0.7460882", "0.7460106" ]
0.7622392
50
create the base and utility objects available to all models on model creation
public function __construct($admin = false) { $this->viewModel = new ViewModel(); if ($admin) { $this->adminViewData(); } else { $this->commonViewData(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function modelFactory();", "public function __construct()\n {\n $this->imageModel = new ImageModel();\n $this->userModel = new User();\n $this->psychologySupervisorModel = new PsychologySupervisor();\n $this->registerSupervisionModel = new RegisterSupervision();\n $this->updateSupervisionModel = new UpdateSupervisionModel();\n }", "public static function __init() {\r\n\t\t$class = __CLASS__;\r\n\t\t\r\n\t\t// Use the library Page model's validation rules combined with the default (but the library gets priority) this way the default rules can be changed, but if left out will still be used (to help make things nicer)\r\n\t\t// $class::_object()->validates = static::_object()->validates += $class::_object()->validates;\r\n\t\t// Now going to just override... The way things were extended, it somehow picked up validates property from other models...weird.\r\n\t\t// All this means is care needs to be taken, there's not many validation rules by default anyway...\r\n\t\t// TODO: Think about this, because it may not be a bad thing it gives more control to a developer but it \r\n\t\t$class::_object()->validates = static::_object()->validates;\r\n\t\t\r\n\t\t// Same for the search schema, the library gets priority, but combine them.\r\n\t\t$class::_object()->search_schema = static::_object()->search_schema += $class::_object()->search_schema;\r\n\t\t\r\n\t\t// Replace any set display name for context\r\n\t\t$class::_object()->display_name = static::_object()->display_name;\r\n\t\t\r\n\t\t// Replace any action_redirect properties (holds redirects for each core Minerva controller method, ie. create, update, and delete)\r\n\t\t$class::_object()->action_redirects = static::_object()->action_redirects;\r\n\t\t\r\n\t\t// Replace any URL field and URL separator values\r\n\t\t$class::_object()->url_field = static::_object()->url_field;\r\n\t\t$class::_object()->url_separator = static::_object()->url_separator;\r\n\t\t\r\n\t\t// Set the library name for this model\r\n\t\t$model_path = Libraries::path(get_class(static::_object()));\r\n\t\t$full_lib_path = LITHIUM_APP_PATH . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR;\r\n\t\t$library_string = substr($model_path, strlen($full_lib_path));\r\n\t\t$library_pieces = explode('/', $library_string);\r\n\t\t$class::_object()->library_name = $library_pieces[0];\r\n\t\t\r\n\t\t// Set the document type (for manualy set document_type values)\r\n\t\t$class::_object()->document_type = static::_object()->document_type;\r\n\t\t\r\n parent::__init();\r\n }", "public function init()\n {\n\t\t$this->user_model = new Application_Model_Users;\n\t\t$this->request_model = new Application_Model_Requests;\n\t\t$this->material_model = new Application_Model_Materials;\n\t\t$this->course_model = new Application_Model_Courses;\n\t\t$this->comment_model = new Application_Model_Comments;\n\t\t$this->category_model = new Application_Model_Categories;\n \t$this->assoc_rules_model = new Application_Model_Assocrules;\n }", "public function __construct() {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init DateTimeLib library object\n $this->dateTimeLibObj = new DateTimeLib();\n\n // Init Search model object\n $this->searchObj = new Search();\n\n // Init UtilityLib library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init Patients model object\n $this->patientsObj = new Patients();\n\n // Init StaticDataConfig model object\n $this->staticDataObj = new StaticDataConfig();\n\n // Init DoctorProfile model object\n $this->doctorprofileObj = new DoctorProfile();\n\n // Init DoctorProfile model object\n $this->appointmentCategoryObj = new AppointmentCategory();\n\n // Init ManageCalendar model object\n $this->manageCalendarObj = new ManageCalendar();\n\n // Init ManageCalendar model object\n $this->timingObj = new Timing();\n }", "function\t__construct()\t{\n\t\t\t\t/* contrutor da classe pai */\n\t\t\t\tparent::__construct();\n\t\t\t\t/* abaixo deverão ser carregados helpers, libraries e models utilizados\n\t\t\t\t\t por este model */\n\t\t}", "protected function typicalSetup()\n {\n $class = $this->class;\n $static = new $class;\n\n if ($static instanceof Model) {\n $this->_id (\"ID\", FieldBlueprint::PRIMARY, null);\n $this->_uid (\"UID\", FieldBlueprint::UID, null);\n }\n }", "protected function setup_models()\n\t{\n\t}", "public function __construct()\n {\n // All of my models are like this\n parent::__construct(get_class($this));\n // Calling methods to get the relevant data\n $this->generateNewsData();\n $this->generateAnalyticsData();\n $this->generatePostsData();\n }", "function _construct() {\n $userModel = UserModel::class;\n $model = VideoModel::class;\n $view = VideoView::class;\n }", "public function __construct()\n {\n $this->model = new BaseModel;\n }", "protected function createBaseModel()\n {\n $name = $this->qualifyClass('Model');\n $path = $this->getPath($name);\n\n if (!$this->files->exists($path)) {\n $this->files->put(\n $path,\n $this->files->get(__DIR__.'/../../stubs/model.base.stub')\n );\n }\n }", "public static function __init() {\r\n\t\t// $validates properites to this Page model. $_schema can never be changed,\r\n\t\t// only extended. $validates can be changed and extended, but if default\r\n\t\t// field rules are left out, they will be used from this parent model.\r\n\t\t$class = __CLASS__;\r\n\t\t\r\n\t\t// Use the library Page model's validation rules combined with the default (but the library gets priority) this way the default rules can be changed, but if left out will still be used (to help make things nicer)\r\n\t\t// $class::_object()->validates = static::_object()->validates += $class::_object()->validates;\r\n\t\t// Now going to just override... The way things were extended, it somehow picked up validates property from other models...weird.\r\n\t\t// All this means is care needs to be taken, there's not many validation rules by default anyway...\r\n\t\t// TODO: Think about this, because it may not be a bad thing it gives more control to a developer but it \r\n\t\t$class::_object()->validates = static::_object()->validates;\r\n\t\t\r\n\t\t// Same for the search schema, the library gets priority, but combine them.\r\n\t\t$class::_object()->search_schema = static::_object()->search_schema += $class::_object()->search_schema;\r\n\t\t\r\n\t\t// Replace any set display name for context\r\n\t\t$class::_object()->display_name = static::_object()->display_name;\r\n \r\n // Append access rules as models get extended, giving the last model priority\r\n // ie. Main model has a rule for index to restrict all. Extended model says to allow all. Everyone is allowed.\r\n // ie. Main model has no index rule. Extended model says to allow all. Everyone is allowed.\r\n // ie. Main model has an index rule to restrict all. Extended model has no index rule. Everyone is restricted.\r\n // ie. This model has an index rule to restirct all. Main model has a rule to allow all. Extended model has an index rule to restrict all. Everyone is restricted.\r\n // TODO: look into doing this for other properties...\r\n\t\t$class::_object()->access = static::_object()->access += $class::_object()->access;\r\n\t\t\r\n\t\t// Replace any action_redirect properties (holds redirects for each core Minerva controller method, ie. create, update, and delete)\r\n\t\t$class::_object()->action_redirects = static::_object()->action_redirects;\r\n\t\t\r\n\t\t// Replace any URL field and URL separator values\r\n\t\t$class::_object()->url_field = static::_object()->url_field;\r\n\t\t$class::_object()->url_separator = static::_object()->url_separator;\r\n\t\t\r\n\t\t// Set the library name for this model\r\n\t\t$model_path = Libraries::path(get_class(static::_object()));\r\n\t\t$full_lib_path = LITHIUM_APP_PATH . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR;\r\n\t\t$library_string = substr($model_path, strlen($full_lib_path));\r\n\t\t$library_pieces = explode('/', $library_string);\r\n\t\t$class::_object()->library_name = $library_pieces[0];\r\n\t\t\r\n parent::__init();\r\n }", "public function __construct()\n {\n $this->userModel = new User();\n $this->instituteModel = new Institute(UserCommon::getLoggedInUserId());\n $this->common = new InstituteType();\n \n }", "abstract protected function prepareModels();", "public function __construct(){\n // $this->team = new \\Model\\Business\\Department();\n $this->config = new \\Model\\Business\\YearPerformanceConfigCyclical();\n $this->record = new \\Model\\Business\\RecordYearPerformanceQuestions();\n $this->question = new \\Model\\Business\\YearPerformanceFeedbackQuestions();\n }", "public function init_objects() {\n $this->controller_oai = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Expose();\n $this->list_sets = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Sets();\n $this->list_metadata_formats = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Metadata_Formats();\n $this->list_records = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Records();\n $this->get_record = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Get_Record();\n $this->identify = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Identify();\n $this->identifiers = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Identifiers();\n }", "public function __construct() {\n $this->load = new Load();\n $this->model = new Model();\n }", "function __construct()\n {\n // 呼叫模型(Model)的建構函數\n parent::__construct();\n \n }", "protected function createObjects() {\n\t\t$this->lblId = $this->mctHut->lblId_Create();\n\t\t$this->lstPosition = $this->mctHut->lstPosition_Create();\n\t\t$this->txtName = $this->mctHut->txtName_Create();\n\t}", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init General staticData Model Object\n $this->staticDataObj = new StaticData();\n }", "public function __construct(){\n require_once 'EntidadBase.php'; // Incluye el archivo EntidadBase\n require_once 'BaseModel.php'; // Incluye el archivo BaseModel\n foreach(glob('Model/*.php') as $file){ // Recorre todos los archivos de la carpeta Model con la extensión PHP.\n require_once($file); // Incluye el archivo\n }\n }", "public function __construct()\n {\n $this->_policyModel = new Datasource_Insurance_LegacyPolicies();\n $this->_enquiryModel = new Datasource_ReferencingLegacy_Enquiry();\n \n $this->_declinerenewalModel = new Datasource_Insurance_Policy_DeclineRenewal();\n $this->_declinerenewalquestionsModel = new Datasource_Insurance_Policy_DeclineRenewalQuestions();\n $this->_declinerenewalresponsesModel = new Datasource_Insurance_Policy_DeclineRenewalResponses();\n }", "function __initObjects() {\n\t\t$settings = $this->settings[$this->model->alias];\n\t\t$this->time = new TimeHelper();\n\t\t$this->solr = new Apache_Solr_Service($settings['host'], $settings['port'], $settings['path']);\n\t}", "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "protected function CreateObjects() {\n\t\t$this->lblId = $this->mctAddress->lblId_Create();\n\t\t$this->lstPerson = $this->mctAddress->lstPerson_Create();\n\t\t$this->txtStreet = $this->mctAddress->txtStreet_Create();\n\t\t$this->txtCity = $this->mctAddress->txtCity_Create();\n\t}", "abstract protected function newModel(): Model;", "function __construct()\n {\n parent::__construct();\n $this->__resTraitConstruct();\n $this->load->model('VSMModel');\n $this->load->model('TextPreprocessingModel');\n\n }", "function __construct(){\n //de booksView y booksModel, adapte el resto del control \n //para que funcionara bien con estos cambios\n $this->view = new AuthView();\n $this->model = new UserModel();\n $this->booksView = new BooksView();\n $this->booksModel = new BooksModel();\n $this->categoryModel = new CategoryModel();\n $this->authHelper = new AuthHelper();\n }", "abstract protected function model();", "abstract protected function model();", "public function __construct()\n {\n parent::__construct();\n $this->instituion_grade = new \\App\\Models\\Institution_grade();\n $this->education_grades = new Education_grade();\n $this->academic_period = new Academic_period();\n $this->institution_students = new Institution_student();\n $this->institutions = new Institution();\n $this->institution_class_students = new Institution_class_student();\n $this->institution_classes = new Institution_class();\n $this->institution_student_admission = new Institution_student_admission();\n }", "public function __construct()\n {\n parent::__construct();\n $this->app->loadClass('date');\n $this->loadModel('task');\n $this->loadModel('order', 'crm');\n $this->loadModel('customer');\n }", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "abstract function model();", "abstract function model();", "abstract function model();", "abstract function model();", "private function _generateModels() {\n\n $model = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/model.mustache');\n $apiModel = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/api_model.mustache');\n $link = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/link.mustache');\n\n $baseModel = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/base_model.mustache');\n $baseApiModel = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/base_api_model.mustache');\n $baseLink = file_get_contents($this->_rootDir . '/' . self::TEMPLATE_DIR . '/base_link.mustache');\n\n $modelDir = $this->_rootDir . '/' . self::TARGET_PATH . '/';\n if (is_dir($modelDir)) {\n shell_exec('rm -rf ' . $modelDir);\n }\n\n foreach ($this->_definitions as $definition) {\n $dir = $modelDir . $definition->namespace . '/';\n $baseDir = $modelDir . '_Base/' . $definition->namespace . '/';\n $baseFile = 'Base' . $definition->name . '.php';\n $file = $definition->name . '.php';\n $basePath = $baseDir . $baseFile;\n $path = $dir . $file;\n\n if (!is_dir($dir)) {\n mkdir($dir, 0777, true);\n }\n\n if (!is_dir($baseDir)) {\n mkdir($baseDir, 0777, true);\n }\n\n if (file_exists($path)) {\n unlink($path);\n }\n\n if (file_exists($basePath)) {\n unlink($basePath);\n }\n\n if (in_array(strtolower($definition->name), $this->_paths)) {\n //ApiModel\n $content = $this->_mustache->render($apiModel, $definition->getArray());\n $baseContent = $this->_mustache->render($baseApiModel, $definition->getArray());\n } else if (substr($definition->name, -3) == 'Rel') {\n //Link\n $content = $this->_mustache->render($link, $definition->getArray());\n $baseContent = $this->_mustache->render($baseLink, $definition->getArray());\n } else {\n //Model\n $content = $this->_mustache->render($model, $definition->getArray());\n $baseContent = $this->_mustache->render($baseModel, $definition->getArray());\n }\n file_put_contents($path, $content);\n file_put_contents($basePath, $baseContent);\n }\n }", "public static function init() {\n\t\tcore::loadClass(\"database\");\n\n\t\t/* Child tables */\n\t\tcore::loadClass(\"doorkey_model\");\n\t\tcore::loadClass(\"key_history_model\");\n\t}", "abstract public function model();", "abstract public function model();", "abstract public function model();", "abstract public function model();", "private function instantiateAll() {\n $this->Corporations = new Corporations($this);\n $this->MemberTracking = new MemberTracking($this);\n $this->Characters = new Characters($this);\n $this->Stations = new Stations($this);\n $this->Facilities = new Facilities($this);\n $this->Industry = new Industry($this);\n $this->Markets = new Markets($this);\n $this->Universe = new Universe($this);\n $this->Contracts = new Contracts($this);\n $this->Wallet = new Wallet($this);\n $this->Assets = new Assets($this);\n $this->Killmails = new Killmails($this);\n $this->Status = new Status($this);\n $this->Usage = new Usage($this);\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init dateTimeLibObj library object\n $this->dateTimeLibObj = new DateTimeLib();\n\n // Init StaticDataConfig model object\n $this->staticDataObj = new StaticDataConfig();\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init dateTimeLibObj library object\n $this->dateTimeLibObj = new DateTimeLib();\n\n // Init StaticDataConfig model object\n $this->staticDataObj = new StaticDataConfig();\n }", "public static function model() {\n //here __CLASS__ or self does not work because these will return coreModel class name but this is an abstract class so php will generate an error.\n //get_called_class() will return the class name where model is called.It may be the child.\n $class = get_called_class();\n return new $class;\n }", "public function __construct(){\n $this->sliderModel = $this->model('Slider');\n $this->siteInfoModel = $this->model('SiteInfo');\n $this->officeModel = $this->model('Office');\n $this->categoryModel = $this->model('Category');\n $this->brandModel = $this->model('Brands');\n $this->productModel = $this->model('Products');\n $this->imgModel = $this->model('Image');\n }", "public function __construct()\n {\n\n $this->SubCategory = new SubCategoriesModel;\n $this->Functions = new ModelFunctions();\n }", "public function init() {\n $bootstrap = $this->getInvokeArg(\"bootstrap\");\n $this->aConfig = $bootstrap->getOptions();\n $this->view->aConfig = $this->aConfig;\n $this->model= new Model_InfoBusiness();\n $this->modelMapper= new Model_InfoBusinessMapper();\n $this->modelProvince = new Model_MasterProvince();\n $this->modelProvinceMapper = new Model_MasterProvinceMapper();\n $this->modelDistrict = new Model_MasterDistrict();\n $this->modelDistrictMapper = new Model_MasterDistrictMapper();\n $this->modelWard = new Model_MasterWard();\n $this->modelWardMapper = new Model_MasterWardMapper();\n }", "function __construct()\n\t{\n\t\t\n\t\t\n\t\tparent::__construct();\n\t\t\n\t\t$this->load->model('manage_product'); \n\t\t$this->load->model('manage_banner'); \n\t\t$this->load->model('manage_activity');\n\t\t\n\t}", "public function generateModels () {\r\n $modelParam = \\app\\lib\\router::getModel();\r\n $ModelPath = \\app\\lib\\router::getPath();\r\n $ModelName = \"app\\model\\\\\" . end($ModelPath);\r\n $this->model =new $ModelName;\r\n }", "function __construct() {\n parent::__construct();\n $this->load->model('Fontend_model');\n $this->load->model('Package_model');\n }", "public function __construct () {\n\t\tparent::__construct ();\n\t\t\n\t\tif ($this->models)\n\t\tforeach ($this->models as $model) {\n\t\t\tunset ($this->models[$model]);\n\t\t\t$this->models[$model] = $this->session->getModel ($model,$this);\n\t\t\t$this->$model = $this->models[$model];\n\t\t}\n\t}", "protected function _construct()\n {\n $this->_init(Model::class, ResourceModel::class);\n }", "public function __construct(){\n\t\t$this->AB = new About(); \n\t\t$this->AP = new AppModel();\n\n\t}", "function __construct()\n {\n parent::__construct();\n $this->load->model('m_user');\n $this->load->model('m_user_group');\n $this->load->model('m_user_has_user_group');\n }", "function __construct()\n {\n parent::__construct();\n $this->load->model('User');\n $this->load->model('Pesan');\n $this->load->model('Obat');\n }", "public function __construct() { //this is not called from concrete class...\n\t\t\t$this->modelName = 'aaaaaaaaaabstract';\n\t\t\techo 'constructing a ' . static::class . '<br>';\n\t\t}", "function init()\n {\n foreach ($GLOBALS['_PX_models'] as $model=>$val) {\n if (isset($val['relate_to'])) {\n foreach ($val['relate_to'] as $related) {\n if ($this->_model == $related) {\n // The current model is related to $model\n // through one or more foreign key. We load\n // the $model to check on which fields the\n // foreign keys are set, as it is possible in\n // one model to have several foreign keys to\n // the same other model.\n if ($model != $this->_model) {\n $_m = new $model();\n $_fkeys = $_m->getForeignKeysToModel($this->_model);\n } else {\n $_fkeys = $this->getForeignKeysToModel($this->_model);\n }\n foreach ($_fkeys as $_fkey=>$_fkeyval) {\n //For each foreign key, we add the\n //get_xx_list method that can have a\n //custom name through the relate_name\n //value.\n if (isset($_fkeyval['relate_name'])) {\n $mname = $_fkeyval['relate_name'];\n } else {\n $mname = strtolower($model);\n }\n $this->_methods_list['get_'.$mname.'_list'] = array($model, $_fkey);\n }\n break;\n }\n }\n }\n if (isset($val['relate_to_many']) && \n in_array($this->_model, $val['relate_to_many'])) {\n $this->_methods_list['get_'.strtolower($model).'_list'] = $model;\n $this->_manytomany[$model] = 'manytomany';\n }\n }\n foreach ($this->_cols as $col=>$val) {\n $field = new $val['type']($col);\n if ($field->type == 'foreignkey') {\n $this->_methods_get['get_'.strtolower($col)] = array($val['model'], $col);\n $this->_fk[$col] = 'foreignkey';\n }\n if ($field->type == 'manytomany') {\n $this->_methods_list['get_'.strtolower($col).'_list'] = $val['model'];\n $this->_manytomany[$val['model']] = 'manytomany';\n }\n foreach ($field->add_methods as $method) {\n $this->_methods_extra[$method[0]] = array(strtolower($col), $method[1]);\n }\n }\n }", "function __construct()\n {\n parent::__construct();\n\t\t$this->load->model('common','common');\n }", "public function createModel()\n {\n }", "public function __construct(){\n\n\t\t$this->types_model = new Types();\n\t}", "protected abstract function model();", "public function __construct() {\n parent::__construct();\n $this->load->model(\"modelo_base\");\n \n }", "public function init()\n {\n $this->ctrlActionModel = new Admin_Model_Acl_ControllersActions();\n $this->dbController = new Admin_Model_DbTable_Acl_ModuleController();\n $this->dbAction = new Admin_Model_DbTable_Acl_Action();\n }", "function __construct() {\n parent::__construct();\n \n //INIT CONSTANTS\n $this->CONT_ROOT=$this->LIB_CONT_ROOT.'paper/';\n //load all models for this controller\n $this->load->model(array());\n //load all models for this controller\n $models = array();\n //load all models in above array\n foreach($models as $mdl=>$tbl){\n $this->load->model('common_m',$mdl);\n $this->$mdl->init(array('table'=>$tbl));\n }\n \n }", "public static function boot()\n\t{\n\t\tparent::boot();\n\n self::creating(function($model){\n\t\t\tif(empty($model->user_id)){\n\t\t\t\t$model->user_id = Auth::user()->id;\n\t\t\t}\n $model->code = uniqid();\n $model->slug = static::generateUniqueSlug($model->name);\n\t\t\tif(empty($model->status_id)){\n \t$model->status_id = Status::getStatusForNewProject()->id;\n\t\t\t}\n });\n }", "public function __construct() {\r\n $this->template = new Template();\r\n $this->settingsModel = new settingsModel();\r\n $this->dbUtil = new DBUtil();\r\n $this->combovalue = $this->settingsModel->populatetypeValues();\r\n $this->logger = Logger::getLogger(\"========= Metadata Controller =========== \");\r\n }", "public abstract function model();", "function __construct() {\n parent::__construct();\n $this->load->model('flightModel');\n $this->load->model('flight');\n $this->load->model('wackyModel');\n $this->load->model('fleetModel');\n }", "public function __construct()\n\t{\n\t\t$this->admin = new Admin;\n\t\t$this->account = new Account;\n\t\t$this->batch = new Batch;\n\t\t$this->category = new Category;\n\t\t$this->comment = new Comment;\n\t\t$this->feature = new Feature;\n\t\t$this->feedback = new Feedback;\n\t\t$this->institute = new Institute;\n\t\t$this->locality= new Locality;\n\t\t$this->location = new Location;\n\t\t$this->schedule = new Schedule;\n\t\t$this->subcategory = new Subcategory;\n\t\t$this->subscription = new Subscription;\n\t\t$this->user = new User;\n\t\t$this->venue = new Venue;\n\t}", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('ModelsExecuteMaster');\n\t\t$this->load->model('GlobalVar');\n\t\t$this->load->model('Apps_mod');\n\t}", "public function __construct() {\n parent::__construct();\n $this->load->database();\n $this->load->model(\"base_model\");\n }", "public function __construct()\n {\n $this->ModelUser = new LoginRegisterModel();\n $this->modelCategorie = new CategoriesModel();\n\t\t/* ********** fin initialisation Model ********** */\n }", "function __construct(){\n $this->toko = new M_Toko();\n $this->produk = new M_Produk(); //variabel model merupakan objek baru yang dibuat dari class model\n }", "protected function CreateObjects() {\n\t\t$this->lblId = $this->mctLogin->lblId_Create();\n\t\t$this->lstPerson = $this->mctLogin->lstPerson_Create();\n\t\t$this->txtUsername = $this->mctLogin->txtUsername_Create();\n\t\t$this->txtPassword = $this->mctLogin->txtPassword_Create();\n\t\t$this->chkIsEnabled = $this->mctLogin->chkIsEnabled_Create();\n\t}", "public function __CONSTRUCT(){\n $this->model = new Estadobien();\n }", "function __construct(){\n\t\tparent::__construct();\n\t\t\t$this->set_model();\n\t}", "public function __construct() {\n//to make connection db \n//when you make object from class baseModel Or any child(extends) Class\n\n parent::__construct();\n $this->connecToDB();\n }", "function __construct() {\r\n parent::Model();\r\n }", "public function __construct(){\n\n parent::__construct();\n $this->load->model('User_model','user');\n $this->load->model('Sys_model','sys');\n $this->load->model('Article_model','article');\n $this->load->model('System_model','system');\n }", "function __construct() {\n $this-> CI =& get_instance();\n $this -> CI -> load -> model('Admin_model');\n // Nos comemos la libreria que la virgen solo corre si sale corriendo\n }", "function UserModel()\n\t\t{\n\t\t\t$this->QueryTool = new UserModelDataBasic(DB_NAME);\n\t\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model(['m_voting', 'm_master', 'm_prospects', 'm_factors']);\n }", "function __construct() {\n // Call the Model constructor \n parent::__construct();\n }", "public function init()\n {\n $this->_Users = new Users();\n $this->_VotsTaula = new VotsTaula();\n $this->_Categories = new Categories();\n $this->_NoticiaTaula = new NoticiaTaula();\n $this->_ComentarisTaula = new ComentarisTaula();\n $this->_NoticiesFavoritas = new NoticiesFavoritas();\n $this->_Seguidors = new Seguidors();\n $this->_Contactar = new Contactar();\n $this->_Notificaciones = new Notificaciones();\n\n }", "public function __construct()\n {\n $this->model= new Estudiante;\n $this->curso= new Curso;\n $this->usuario= new Usuario;\n $this->centrointeres= new Centrointeres;\n $this->clase= new Clase;\n $this->grado = new Grado;\n $this->asistencia= new Asistencia;\n }", "function __construct() {\r\n parent::__construct();\r\n $this->load->library('OracleModel');\r\n $this->DBObject = new OracleModel();\r\n }", "private static function model()\n {\n $files = ['ORM_', 'CRUD', 'ORM', 'Collection', 'ModelArray'];\n $folder = static::$root.'MVC/Model'.'/';\n\n self::call($files, $folder);\n\n $files = ['ForeingKeyMethodException', 'ColumnNotEmptyException', 'ManyPrimaryKeysException', 'TableNotFoundException', 'ModelNotFoundException', 'PrimaryKeyNotFoundException'];\n $folder = static::$root.'MVC/Model/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function __construct()\n {\n\n //Create a new instance of the View class\n $this->view = new View();\n\n //Create a new instance of the Template class\n $this->template = new Template();\n\n //Create a new instance of the Validator class\n $this->validator = new Validator();\n\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "function __construct()\n\t{\n\t\t// within the class.\n\t\t(object)$this->db = new dbHelper();\n\t\t(object)$this->user = new User();\n\t\t(object)$this->patient = new Patient();\n\t\t(object)$this->enc = new Encounter();\n\t\treturn;\n\t}", "public static function __init() {\r\n\t$class = __CLASS__;\r\n\t\r\n /*\r\n $extended_schema = static::_object()->_schema;\r\n \r\n\t// Loop through and ensure no one forgot to set the form key\t\t\r\n\tforeach($extended_schema as $k => $v) {\r\n\t\t$extended_schema[$k] += array('form' => array('position' => 'default'));\r\n\t}\r\n\t// Append extended schema\r\n\t$class::_object()->_schema += $extended_schema;\r\n */\r\n \r\n\t// Use the library Page model's validation rules combined with the default (but the library gets priority) this way the default rules can be changed, but if left out will still be used (to help make things nicer)\r\n\t$class::_object()->validates = static::_object()->validates += $class::_object()->validates;\r\n\t// Same for the search schema, the library gets priority, but combine them.\r\n\t$class::_object()->search_schema = static::_object()->search_schema += $class::_object()->search_schema;\r\n\t\r\n\t// Replace any set display name for context\r\n\t$class::_object()->display_name = static::_object()->display_name;\r\n\t\r\n\t// Lock the schema so values that aren't part of it can't be saved to the db.\r\n\tself::meta('locked', true);\r\n \r\n parent::__init();\r\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('ModelsExecuteMaster');\n\t\t$this->load->model('GlobalVar');\n\t\t$this->load->model('Apps_mod');\n\t\t$this->load->model('LoginMod');\n\t}", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('ModelsExecuteMaster');\n\t\t$this->load->model('GlobalVar');\n\t\t$this->load->model('Apps_mod');\n\t\t$this->load->model('LoginMod');\n\t}", "function __construct()\r\n {\r\n parent::Model();\r\n }", "public function __construct() {\r\nparent::__construct();\r\n$this->courseModel = new coursemodel();\r\n$this->personModel = new personmodel();\r\n// $this->cal = new Nepali_Calendar();\r\n}", "abstract function create();", "function __contruct()\n {\n $this->load->model('Inbound_message_model');\n $this->load->model('Psychic_model');\n $data['title'] = 'Bulletin board';\n\t\t$data['user'] = Auth::me();\n\n\t\t\n }" ]
[ "0.7049846", "0.68978715", "0.67930514", "0.6676647", "0.66736394", "0.66590863", "0.66406536", "0.6628065", "0.6504332", "0.6490862", "0.64901084", "0.64821476", "0.6467209", "0.64057404", "0.640281", "0.6331941", "0.62703705", "0.6230316", "0.6227217", "0.62157494", "0.621102", "0.6198562", "0.61975247", "0.6197403", "0.619241", "0.6181343", "0.6169656", "0.61550945", "0.6148367", "0.61481047", "0.61481047", "0.6139401", "0.6137262", "0.6129051", "0.6128773", "0.6128773", "0.6128773", "0.6128773", "0.6128665", "0.61192095", "0.61123323", "0.61123323", "0.61123323", "0.61123323", "0.6105375", "0.60957277", "0.60957277", "0.6094287", "0.6090847", "0.6070368", "0.60591245", "0.6052149", "0.6042809", "0.6036955", "0.6036766", "0.60363954", "0.6030215", "0.60268694", "0.60168356", "0.60030305", "0.59962183", "0.5978228", "0.5974636", "0.59672016", "0.59617406", "0.596072", "0.5955203", "0.5951188", "0.5949413", "0.5944565", "0.5938627", "0.59360665", "0.5930547", "0.5926599", "0.5920506", "0.5918162", "0.59168017", "0.59143335", "0.59091794", "0.5894347", "0.58938307", "0.58792764", "0.5877691", "0.5870408", "0.58657193", "0.5865059", "0.58519435", "0.58477646", "0.5847007", "0.58469325", "0.5846817", "0.58397645", "0.58393216", "0.58330506", "0.58328235", "0.58319056", "0.58319056", "0.5827321", "0.58220917", "0.58171135", "0.58131754" ]
0.0
-1
establish viewModel data that is required for all views in this method (i.e. the main template)
protected function commonViewData() { //print "Hello"; $this->viewModel->set("mainMenu", array("Home" => "home", "Help" => "help")); $this->viewModel->set("Basepath", "http://localhost/~georginfanger/georginfanger/"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewMain() {\n\t$view = new viewModel();\n\t$view->showMain();\t\n}", "private function init()\n\t{\n\t\tif(! $this->authUser = $this->auth->check_login()){\n\t\t\t$this->authUser->logged = false;\n\t\t}\n\t\t// Fill user object in view \n\t\t$this->data['authUser'] = $this->authUser;\n\n\t\t$this->data['menugang'] = $this->recipesModel->menugang();\n\t\t$this->data['hoofdgroup'] = $this->recipesModel->hoofdgroup();\n\t\t$this->data['technique'] = $this->recipesModel->technique();\n\t\t$this->data['kitchen'] = $this->recipesModel->kitchen();\n\t\t$this->data['opening'] = $this->recipesModel->opening();\n\t\t$this->data['dieten'] = $this->recipesModel->dieten();\n\t}", "protected function getViewData() {\n\n }", "public function index() {\n $this->viewModel->set(\"pageTitle\", \"MyCPD Hub\");\n $this->viewModel->set(\"heading1\", \"Mandatory & Contractual Training\");\n return $this->viewModel;\n }", "protected function renderData()\n {\n $this->view->baseUrl = $this->_baseUrl;\n $this->view->staticUrl = Zend_Registry::get('static');\n $this->view->version = Zend_Registry::get('version');\n $this->view->hostUrl = Zend_Registry::get('host');\n $this->view->photoUrl = Zend_Registry::get('photo');\n $this->view->adminUser = $this->_user;\n\n $this->view->isSuperUser = $this->_isSuperUser;\n $this->view->isViewer = $this->_isViewer;\n $this->view->isWatcher = $this->_isWatcher;\n $this->view->isEditor = $this->_isEditor;\n }", "public function __construct($admin = false) {\n $this->viewModel = new ViewModel();\n if ($admin) {\n $this->adminViewData();\n } else {\n $this->commonViewData();\n }\n }", "public function __construct()\n {\n $this->beforeFilter('crfs', ['on' => ['post', 'put', 'patch', 'delete']]);\n\n // share info data to all views - used in footer and contact page\n $info_data = Info::first();\n View::share(['info_data' => $info_data]);\n\n $notification_data = Notification::first();\n View::share(['notification_data' => $notification_data]);\n }", "private function shareModelPropsToView(): void\n {\n $model = static::${'modelClass'};\n View::share('props', (new $model())->getEditableProperties());\n }", "public function index()\n { \n $this->viewModel->set(\"pageTitle\",\"Nathan MVC\");\n return $this->viewModel;\n }", "public function index() {\n $this->viewModel->set(\"pageTitle\", \"Georg Infanger - Home\");\n $this->viewModel->set(\"content\", array('content'=>'hello///', 'test2'=>'nw'));\n return $this->viewModel;\n }", "private function initViewVars()\n {\n $this->viewEngine->vars['loggedUserId'] = $this->model->config->getVar('loggedUserId');\n $this->viewEngine->vars['isUserLogged'] = $this->model->config->getVar('isUserLogged');\n $this->viewEngine->vars['loggedUserRole'] = $this->model->config->getVar('loggedUserRole');\n\n $this->viewEngine->vars['charset'] = $this->model->config->getModuleVar('common', 'charset');\n $this->viewEngine->vars['stylesFolder'] = JAPA_PUBLIC_DIR . 'styles/'.$this->model->config->getModuleVar('common', 'styles_folder');\n $this->viewEngine->vars['scriptsFolder'] = JAPA_PUBLIC_DIR . 'scripts/'.$this->model->config->getModuleVar('common', 'scripts_folder');\n $this->viewEngine->vars['imagesFolder'] = JAPA_PUBLIC_DIR . 'scripts/'.$this->model->config->getModuleVar('common', 'images_folder');\n $this->viewEngine->vars['viewsFolder'] = JAPA_PUBLIC_DIR . 'scripts/'.$this->model->config->getModuleVar('common', 'views_folder');\n $this->viewEngine->vars['controllersFolder'] = JAPA_PUBLIC_DIR . 'scripts/'.$this->model->config->getModuleVar('common', 'controllers_folder');\n $this->viewEngine->vars['urlBase'] = $this->router->getBase();\n $this->viewEngine->vars['adminWebController'] = $this->model->config->getVar('default_module_application_controller');\n $this->viewEngine->vars['default_lang'] = $this->model->config->getModuleVar('common', 'default_lang');\n }", "protected function initialize()\n {\n $this->viewData['list_sb'] = $this->list_sb = SkeletalBone::orderBy('name', 'asc')->pluck('name', 'id');\n $this->viewData['list_side'] = $this->list_side = SkeletalElement::$side;\n $this->viewData['list_completeness'] = $this->list_completeness = SkeletalElement::$completeness;\n $this->viewData['list_lab'] = $this->list_lab = Lab::where('type', 'Isotope')->get()->pluck('full_name', 'id');\n $this->viewData['list_status'] = $this->list_status = IsotopeBatch::$status;\n $this->viewData['batchStatus'] = $this->batchStatus = 'Open';\n $this->viewData['initialshow'] = $this->initialshow = false;\n }", "public function initializeView() {}", "public function initializeView() {}", "public function _setProps() {\n $dataController = get_called_class();\n $dataController::_getMapper();\n $dataController::_getModel();\n }", "public function init() {\n\t\t$this->template->set('menu', $this->model->getMenu());\n\t\t$this->template->set('route', $this->route);\n\n\t\t$this->template->setInfo($this->model->getInfo());\n\n\t\t$user = $this->model->getUser();\n\t\t$this->template->set('auth_username', $user?$user->username:0);\n\t\t$this->template->set('auth_is_admin', $user?$user->is_admin:0);\n\t}", "public function init() {\n $bootstrap = $this->getInvokeArg(\"bootstrap\");\n $this->aConfig = $bootstrap->getOptions();\n $this->view->aConfig = $this->aConfig;\n $this->model= new Model_InfoBusiness();\n $this->modelMapper= new Model_InfoBusinessMapper();\n $this->modelProvince = new Model_MasterProvince();\n $this->modelProvinceMapper = new Model_MasterProvinceMapper();\n $this->modelDistrict = new Model_MasterDistrict();\n $this->modelDistrictMapper = new Model_MasterDistrictMapper();\n $this->modelWard = new Model_MasterWard();\n $this->modelWardMapper = new Model_MasterWardMapper();\n }", "protected function initializeView() {\n\t}", "function initData() {\n\t\t$navigationMenuItemDao = DAORegistry::getDAO('NavigationMenuItemDAO');\n\t\t$navigationMenuItem = $navigationMenuItemDao->getById($this->navigationMenuItemId);\n\n\t\tif ($navigationMenuItem) {\n\t\t\t$this->_data = array(\n\t\t\t\t'path' => $navigationMenuItem->getPath(),\n\t\t\t\t'title' => $navigationMenuItem->getTitle(null),\n\t\t\t\t'url' => $navigationMenuItem->getUrl(),\n\t\t\t\t'menuItemType' => $navigationMenuItem->getType(),\n\t\t\t);\n\t\t\t$this->setData('content', $navigationMenuItem->getContent(null)); // Localized\n\t\t} \n\t}", "private function _init()\n\t{\n\t\t$data = array();\n\t\t$data['CONTROLLER_NAME'] = $this->controllerTemplate->get_name();\n\t\t$data['VIEW_NAME'] = $this->viewTemplate->get_name();\n\t\t$data['VIEW_NAME_LINK'] = $this->viewTemplate->get_link();\n\t\t$data['MODEL_NAME'] = $this->modelTemplate->get_name();\n\t\t$data['TABLE_VIEW'] = $this->tableTemplate->get_name();\n\t\t$data['TABLE_VIEW_LINK'] = $this->tableTemplate->get_link();\n\t\t$data['DB_TABLE_NAME'] = $this->model->get_table_name();\n\t\t$data['MODEL_INSTANCE_VARIABLES'] = $this->modelTemplate->get_vars();\n\t\t$data['MODEL_SELECT_COLUMNS'] = $this->modelTemplate->get_columns();\n\n\t\treturn $data;\n\t}", "public function init()\n {\n $usuario = new Application_Model_UsuarioMapper();\n $this->view->totalUsuarios = $usuario->getQuantidade();\n\n\n }", "function viewInfo() {\n\t$view = new viewModel();\n\t$view->showInfo();\t\n}", "public function beforeRender() {\n\t$this->set('allModels', App::objects('model'));\n }", "protected function initializeStandaloneViewInstance() {}", "public function __construct(){\n $hospitals = Hospital::all();\n //sharing all hospitals to Frontend routes\n View::share('hospitals', $hospitals);\n }", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "public function __construct()\n {\n View::share('metaData', Chapter::getMetaData());\n }", "public function setup()\n {\n $dataModel = eval(\"?>\" . file_get_contents( $this->getDataModelFilename() ));\n if($dataModel instanceof DataModelInterface) {\n $dataModel = new ProjectData($dataModel);\n }\n $this->getEngine()->bindData($dataModel);\n $this->getEngine()->activate();\n }", "protected function setupLayout()\n\t{\n\n $this->user = Auth::user();\n $this->theme = Theme::uses('default')->layout('default');\n $user = $this->user;\n $this->theme->bind('user', function() use($user)\n {\n return $user;\n });\n $cat = Category::all();\n $this->theme->bind('cat', function() use($cat)\n {\n return $cat;\n });\n if (Session::get('cart')){\n $cart_count = count(Session::get('cart'));\n $this->theme->bind('cart_count', function() use($cart_count)\n {\n return $cart_count;\n });\n }\n\t}", "public function preInit()\n {\n $this->_viewEngine = Bigace_Services::get()->getService('view');\n }", "function __construct()\n {\n $suatchieu = SuatChieu::all();\n $ngaychieu = NgayChieu::all();\n $phim = Phim::all();\n $rap = Rap::all();\n\n view()->share('suatchieu',$suatchieu);\n view()->share('ngaychieu',$ngaychieu);\n view()->share('phim',$phim);\n view()->share('rap',$rap);\n }", "public function __construct()\n {\n $this->templateData = array(\n // Any data that belongs to every template.\n );\n $this->before();\n }", "function abstractInit()\n\t{\n\t\t/* Setting base url in view */\n\t\t$this->view->baseUrl = $this->_request->getBaseUrl();\n\t\t\n\t\t/* Setting the name of current module in view */\n\t\t$this->view->currentModule = $this->_request->getModuleName();\n\t\t\n\t\t/* Setting the name of current controller in view */\n\t\t$this->view->currentController = $this->_request->getControllerName();\n\t\t\n\t\t/* Setting the name of current action in view */\n\t\t$this->view->currentAction = $this->_request->getActionName();\n\t\t\n\t\t/* Setting the base url of assets in view */\n\t\t$this->view->assetUrl = $this->_request->getBaseUrl() . '/assets/';\n\t\t\n\t\t/* Addicting custom helper path */\n\t\t$this->view->addHelperPath(PLUGIN_DIR . 'Helpers/');\n\t}", "public function init()\n {\n $this->sysConfig = Zend_Registry::get('sysConfig');\n\t\t$this->view->sysConfig = $this->sysConfig;\n\t\t\n\t\t$this->config = Zend_Registry::get('config');\n\t\t$this->view->config = $this->config;\n\t\t\n\t\t$this->db=Zend_Registry::get('db');\n\t\t\n\t\t//controller and action names\n\t\t$this->controllerName = $this->getRequest()->getControllerName();\n\t\t$this->view->controllerName = $this->controllerName;\n\t\t\n\t\t$this->actionName = $this->getRequest()->getActionName();\n\t\t$this->view->actionName = $this->actionName;\n\t\t\n\t\t$this->view->baseurl=$this->config->common->baseUrl.\"/\";\n\t\t$this->view->cssurl=$this->config->common->cssPath;\n\t\t$this->view->jsurl=$this->config->common->jsPath;\n\n $this->view->items = \"\";\n $this->view->dashboard = \"\";\n $this->view->cnews = \"\";\n $this->view->expenditure = \"\";\n \n \n }", "public function init()\n {\n \t$authSession = new Zend_Session_Namespace('auth');\n\t\tif (isset($authSession->user)) {\n\t\t\t/**\n\t\t\t * @todo write this into session\n\t\t\t */\n\t\t\t$this->view->auth = $authSession->user;\n\t\t\t$this->view->role = $authSession->role;\n\t\t} else {\n\t\t\t$this->_redirect('login/index');\n\t\t}\n\t\t\n\t\t$aclSession = new Zend_Session_Namespace('acl');\n\t\tif (isset($aclSession->acl)) {\n\t\t\t$this->view->acl = $aclSession->acl;\n\t\t}\n\t\t\n\t\t//initialize models\n\t\t//user\n//\t\tif (!isset($this->userModel)) {\n//\t\t\t$this->_userModel = new Application_Model_User();\n//\t\t}\n\t\t\n\t\t//publication\n\t\tif(!isset($this->publicationModel)) {\n\t\t\t$this->_publicationModel = new Application_Model_Publication();\n\t\t}\n\t\t\n\t\t//publisher\n \tif(!isset($this->_publisherModel)) {\n\t\t\t$this->_publisherModel = new Application_Model_Publisher();\n\t\t}\n\t\t\n\t\t//@author micha\n\t\tif(!isset($this->_authorModel)) {\n\t\t\t$this->_authorModel = new Application_Model_Author();\n\t\t}\n }", "public function init()\n {\n// $this->model = new Application_Model_DbTable_Material();\n $authorization = Zend_Auth::getInstance();\n if ($authorization->hasIdentity()) {\n $this->view->user_id = Zend_Auth::getInstance()->getStorage()->read()->id;\n $this->view->is_admin=Zend_Auth::getInstance()->getStorage()->read()->is_Admin;\n }\n\n $this->_helper->layout->setLayout('admin');\n $this->model1 = new Application_Model_DbTable_MaterialType();\n }", "function default_view_context() {\n return array(\n 'metaTitle' => 'Suicide MVC', // Set in \"<head><meta>\"\n 'metaAuthor' => '', // Displayed in \"#container > #footer\" && set in \"<head><meta>\"\n 'heading' => 'Suicide MVC', // Displayed in \"#container > #header > h1\"\n\n 'styleSheets' => 'CakePHP/cake.generic.css', // ';' delimited list of paths from the $viewStyleDirectory\n 'jscripts' => '', // ';' delimited list of paths from the $viewJavascriptDirectory\n // 'sections' => 'data_list.php' // (useful to implement?)\n\n 'data' => NULL // used by model, never need to modify\n );\n}", "public function set_default_view_variables()\n\t{\n\t\t$langfile = substr(ee()->router->class, 0, strcspn(ee()->router->class, '_'));\n\n\t\t// Javascript Path Constants\n\t\tdefine('PATH_JQUERY', PATH_THEMES_GLOBAL_ASSET.'javascript/'.PATH_JS.'/jquery/');\n\t\tdefine('PATH_JAVASCRIPT', PATH_THEMES_GLOBAL_ASSET.'javascript/'.PATH_JS.'/');\n\t\tdefine('JS_FOLDER', PATH_JS);\n\n\t\tee()->load->library('javascript', array('autoload' => FALSE));\n\n\t\tee()->load->model('member_model'); // for screen_name, quicklinks\n\n\t\tee()->lang->loadfile($langfile, '', FALSE);\n\n\t\t// Meta-refresh tag\n\t\tif ($refresh = ee()->session->flashdata('meta-refresh'))\n\t\t{\n\t\t\tee()->view->set_refresh($refresh['url'], $refresh['rate']);\n\t\t}\n\n\t\t$cp_table_template = array(\n\t\t\t'table_open' => '<table class=\"mainTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">'\n\t\t);\n\n\t\t$cp_pad_table_template = array(\n\t\t\t'table_open' => '<table class=\"mainTable padTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">'\n\t\t);\n\n\t\t$member = ee('Model')->get('Member', ee()->session->userdata('member_id'))->first();\n\n\t\tif ( ! $member)\n\t\t{\n\t\t\t$member = ee('Model')->make('Member');\n\t\t}\n\n\t\t$notepad_content = ($member->notepad) ?: '';\n\n\t\t// Global view variables\n\t\t$vars =\tarray(\n\t\t\t'cp_homepage_url' => $member->getCPHomepageURL(),\n\t\t\t'cp_page_onload'\t\t=> '',\n\t\t\t'cp_page_title'\t\t\t=> '',\n\t\t\t'cp_breadcrumbs'\t\t=> array(),\n\t\t\t'cp_right_nav'\t\t\t=> array(),\n\t\t\t'cp_messages'\t\t\t=> array(),\n\t\t\t'cp_notepad_content'\t=> $notepad_content,\n\t\t\t'cp_table_template'\t\t=> $cp_table_template,\n\t\t\t'cp_pad_table_template'\t=> $cp_pad_table_template,\n\t\t\t'cp_theme_url'\t\t\t=> $this->cp_theme_url,\n\t\t\t'cp_current_site_label'\t=> ee()->config->item('site_name'),\n\t\t\t'cp_screen_name'\t\t=> $member->screen_name,\n\t\t\t'cp_avatar_path'\t\t=> ($member->avatar_filename) ? ee()->config->slash_item('avatar_url') . $member->avatar_filename : '',\n\t\t\t'cp_avatar_width'\t\t=> ($member->avatar_filename) ? $member->avatar_width : '',\n\t\t\t'cp_avatar_height'\t\t=> ($member->avatar_filename) ? $member->avatar_height : '',\n\t\t\t'cp_quicklinks'\t\t\t=> $this->_get_quicklinks($member->quick_links),\n\n\t\t\t'EE_view_disable'\t\t=> FALSE,\n\t\t\t'is_super_admin'\t\t=> (ee()->session->userdata['group_id'] == 1) ? TRUE : FALSE,\t// for conditional use in view files\n\t\t);\n\n\t\t// global table data\n\t\tee()->session->set_cache('table', 'cp_template', $cp_table_template);\n\t\tee()->session->set_cache('table', 'cp_pad_template', $cp_pad_table_template);\n\n\t\t// we need these paths again in my account, so we'll keep track of them\n\t\t// kind of hacky, but before it was accessing _ci_cache_vars, which is worse\n\n\t\tee()->session->set_cache('cp_sidebar', 'cp_avatar_path', $vars['cp_avatar_path'])\n\t\t\t->set_cache('cp_sidebar', 'cp_avatar_width', $vars['cp_avatar_width'])\n\t\t\t->set_cache('cp_sidebar', 'cp_avatar_height', $vars['cp_avatar_height']);\n\n\t\t// The base javascript variables that will be available globally through EE.varname\n\t\t// this really could be made easier - ideally it would show up right below the main\n\t\t// jQuery script tag - before the plugins, so that it has access to jQuery.\n\n\t\t// If you use it in your js, please uniquely identify your variables - or create\n\t\t// another object literal:\n\t\t// Bad: EE.test = \"foo\";\n\t\t// Good: EE.unique_foo = \"bar\"; EE.unique = { foo : \"bar\"};\n\n\t\t$js_lang_keys = array(\n\t\t\t'logout'\t\t\t\t=> lang('logout'),\n\t\t\t'search'\t\t\t\t=> lang('search'),\n\t\t\t'session_idle'\t\t\t=> lang('session_idle'),\n\t\t\t'btn_fix_errors'\t\t=> lang('btn_fix_errors'),\n\t\t\t'btn_fix_errors'\t\t=> lang('btn_fix_errors'),\n\t\t\t'check_all'\t\t\t\t=> lang('check_all'),\n\t\t\t'clear_all'\t\t\t\t=> lang('clear_all'),\n\t\t\t'keyword_search'\t\t=> lang('keyword_search'),\n\t\t\t'loading'\t\t\t\t=> lang('loading'),\n\t\t\t'searching'\t\t\t\t=> lang('searching')\n\t\t);\n\n\t\tee()->javascript->set_global(array(\n\t\t\t'BASE' => str_replace(AMP, '&', BASE),\n\t\t\t'XID' => CSRF_TOKEN,\n\t\t\t'CSRF_TOKEN' => CSRF_TOKEN,\n\t\t\t'PATH_CP_GBL_IMG' => PATH_CP_GBL_IMG,\n\t\t\t'CP_SIDEBAR_STATE' => ee()->session->userdata('show_sidebar'),\n\t\t\t'username' => ee()->session->userdata('username'),\n\t\t\t'router_class' => ee()->router->class, // advanced css\n\t\t\t'lang' => $js_lang_keys,\n\t\t\t'THEME_URL' => $this->cp_theme_url,\n\t\t\t'hasRememberMe' => (bool) ee()->remember->exists(),\n\t\t\t'cp.updateCheckURL' => ee('CP/URL', 'settings/general/version-check')->compile(),\n\t\t));\n\n\t\tif (ee()->session->flashdata('update:completed'))\n\t\t{\n\t\t\tee()->javascript->set_global('cp.updateCompleted', TRUE);\n\t\t}\n\n\t\t// Combo-load the javascript files we need for every request\n\n\t\t$js_scripts = array(\n\t\t\t'ui'\t\t=> array('core', 'widget', 'mouse', 'position', 'sortable', 'dialog', 'button'),\n\t\t\t'plugin'\t=> array('ee_interact.event', 'ee_broadcast.event', 'ee_notice', 'ee_txtarea', 'tablesorter', 'ee_toggle_all', 'nestable'),\n\t\t\t'file'\t\t=> array('react/react.min', 'react/react-dom.min', 'json2',\n\t\t\t'underscore', 'cp/global_start', 'cp/form_validation', 'cp/sort_helper', 'cp/form_group',\n\t\t\t'cp/modal_form', 'cp/confirm_remove', 'cp/fuzzy_filters',\n\t\t\t'components/no_results', 'components/loading', 'components/filters',\n\t\t\t'components/filterable', 'components/toggle', 'components/select_list',\n\t\t\t'fields/select/select', 'fields/select/mutable_select', 'fields/dropdown/dropdown')\n\t\t);\n\n\t\t$modal = ee('View')->make('ee:_shared/modal_confirm_remove')->render([\n\t\t\t'name'\t\t=> 'modal-default-confirm-remove',\n\t\t\t'form_url'\t=> '#',\n\t\t\t'hidden'\t=> [\n\t\t\t\t'bulk_action'\t=> 'remove',\n\t\t\t\t'content_id' => ''\n\t\t\t]\n\t\t]);\n\t\tee('CP/Modal')->addModal('default-remove', $modal);\n\n\t\t$this->add_js_script($js_scripts);\n\t\t$this->_seal_combo_loader();\n\n\t\tforeach ($vars as $key => $value)\n\t\t{\n\t\t\tee()->view->$key = $value;\n\t\t}\n\n\t\tee()->load->vars($vars);\n\t}", "protected function _init() {\n\t\t$this->user = SessionUser::user();\n\n\t\t// Might come in handy sometimes: direct access to the DBAL:\n\t\t$this->db = $GLOBALS['db'];\n\n\t\t// Initialize Output/Views (used in 90% of controller actions):\n\t\t$this->tpl = new Output($this);\n\t\t$this->tpl->viewLayout = '_layout';\n\t\t$this->tpl->assign('app', $this);\n\t}", "public function __construct() {\n parent::__construct();\n\t\tView::set_shared_data('require_js_main', '/' . CONTEXT_PATH . '/public/main');\n }", "public function init()\n\n { \n\n\t\ttry{\n\n\t\t\t$this->Request = $this->_request->getParams();\n\n\t\t\t$this->ModelObj = new Helpdesk_Model_HelpdeskManager();\n\n\t\t\t$this->ModelObj->getData = $this->Request;\n\n\t\t\t$this->view->ModelObj = $this->ModelObj;\n\n\t\t\t$this->view->Request = $this->Request;\n\n\t\t\t$this->_helper->layout->setLayout('main');\n\n\t }catch(Exception $e){\n\n\t echo $e->getMessage();\n\n\t }\n\n }", "public function __construct()\r\n {\r\n $this->view = new stdClass;\r\n $this->view->placeHolder = $this->placeHolder;\r\n $this->view->settingOptionName = $this->settingOptionName;\r\n }", "public function __construct()\n {\n $this->languages = Language::all();\n view()->share('languages', $this->languages);\n }", "public function init()\n {\n\t\t$this->user_model = new Application_Model_Users;\n\t\t$this->request_model = new Application_Model_Requests;\n\t\t$this->material_model = new Application_Model_Materials;\n\t\t$this->course_model = new Application_Model_Courses;\n\t\t$this->comment_model = new Application_Model_Comments;\n\t\t$this->category_model = new Application_Model_Categories;\n \t$this->assoc_rules_model = new Application_Model_Assocrules;\n }", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "public function __construct()\n {\n $this->model = new MainModel();\n $this->params[\"pagination\"][\"totalItemsPerPage\"] = 5;\n view()->share ('controllerName', $this->controllerName);//đặt controllerName cho all action\n }", "public function __construct()\n {\n view()->share('type', 'department');\n }", "function __construct()\n {\n // session()->put('basic', Basic::find(1));\n // view()->share($data);\n }", "public function init() {\n $authorization = Zend_Auth::getInstance();\n if ($authorization->hasIdentity()) {\n $this->view->user_id = Zend_Auth::getInstance()->getStorage()->read()->id;\n $this->view->is_admin=Zend_Auth::getInstance()->getStorage()->read()->is_Admin;\n }\n\n\n $this->_helper->layout->setLayout('admin');\n\n $this->model = new Application_Model_DbTable_MaterialContent();\n }", "public function getViewVars();", "public function getViewVars();", "public function boot()// все что в boot(), будет работать на всех стр\n {\n //для ДЗ\n $phone = Option::where('name', 'phone')->first();\n View::share('phone', $phone);\n\n\n //колво товаров в корзине для отображения около ссылки на корзину\n\n //View::share('totalCount', $sum);\n }", "public function init() {\n\t\t$this->_itemDao = new App_Dao_ItemDao ();\n\t\t$this->_itemTypeDao = new App_Dao_ItemTypeDao();\n\t\t$this->_itemBrandDao = new App_Dao_ItemBrandDao();\n\t\t$this->_itemSizeDao = new App_Dao_ItemSizeDao();\n\t\t$this->_itemColorDao = new App_Dao_ItemColorDao();\n\t\t$this->_itemOriginDao = new App_Dao_ItemOriginDao();\n\t\t\n\t\t$this->_itemUtils = new App_Util_ItemUtils();\n\t\t\n\t\t//echo date('H:i:s');\n\t\t/*\n\t\t$uri = \"$_SERVER[REQUEST_URI]\";\n\t\t$uriPathArray = explode('/', $uri );\n\t\t$this->ROOT_PATH = \"http://$_SERVER[HTTP_HOST]\" . '/' . $uriPathArray[1] . '/'; // http://localhost/zf/\n\t\t$this->view->rootPath = $this->ROOT_PATH . 'public/';*/\n\t\t\n\t\t$this->view->rootPath = $this->getFrontController()->getBaseUrl() . '/'; // /zf/public/\n\t}", "public function __construct()\n {\n $this->middleware('auth');\n\n $modules = Utils::getModules();\n\n # variables to share to all view\n View::share('modules', $modules);\n View::share('moduleName', $this->moduleName);\n View::share('modulePath', $this->modulePath);\n }", "public function data()\n {\n return view('site_preparation.data');\n }", "public function init()\r\r\n {\r\r\n // -------------------------\r\r\n $modelMetier = new Model_DbTable_Metiers();\r\r\n $metiers = $modelMetier->getDatas();\r\r\n $this->view->metiers = $metiers;\r\r\n \r\n // Get notre entreprise text\r\n // ----------------------\r\n $model = new Model_DbTable_Vitrine();\r\n $txtEntreprise = $model->getDatas('notre-entreprise');\r\n $this->view->txtEntreprise = $txtEntreprise;\r\r\n }", "protected function initView()\n {\n $view = $this->objectProviderService->get($this->resolveViewClassName());\n\n if (!$view instanceof ViewInterface) {\n throw new \\UnexpectedValueException(\n 'View \"' . get_class($view) . '\" does not implement Signature\\Mvc\\View\\ViewInterface.'\n );\n }\n\n $this->view = $view;\n\n // Assign basic view data\n $this->view->setViewData([\n 'moduleContext' => $this->getModuleContext(),\n 'config' => $this->configurationService->getConfig($this->getModuleContext()),\n 'resourceDir' => $this->getResourceDir(),\n 'templateDir' => $this->getTemplateDir(),\n ]);\n }", "public function initData()\r\n {\r\n $this->data['page_class'] = strtolower('page-' . $this->classname . '-' . $this->methodname) . ' ';\r\n $this->data['class_name'] = $this->classname;\r\n $this->data['method_name'] = $this->methodname;\r\n\r\n //default description and keyword\r\n $this->data['keywords'] = '';\r\n $this->data['description'] = '';\r\n \r\n $this->data['language'] = $this->session->userdata('language');\r\n\r\n if ($this->config->item('test_mode') == TRUE)\r\n {\r\n $this->output->enable_profiler('true');\r\n }\r\n \r\n //see any notifications to display\r\n if (!empty($this->session->flashdata('notification'))) {\r\n $this->data['notification'] = $this->session->flashdata('notification');\r\n $this->data['notification_type'] = $this->session->flashdata('notification_type');\r\n }\r\n\r\n // set csrf\r\n $this->data['csrf'] = array(\r\n 'token_name' => $this->security->get_csrf_token_name(),\r\n 'hash' => $this->security->get_csrf_hash(),\r\n 'cookie_name' => $this->config->item('csrf_cookie_name'),\r\n );\r\n }", "public function loadForView();", "protected function init()\n {\n \\ArminVieweg\\Dce\\Utility\\DatabaseUtility::getDatabaseConnection();\n\n $this->fluidTemplate = GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\View\\StandaloneView');\n $this->fluidTemplate->setLayoutRootPaths(\n [GeneralUtility::getFileAbsFileName(self::DEFAULT_DIRECTORY_LAYOUTS)]\n );\n $this->fluidTemplate->setPartialRootPaths(\n [GeneralUtility::getFileAbsFileName(self::DEFAULT_DIRECTORY_PARTIALS)]\n );\n }", "public function initialize()\n {\n $this->belongsTo(\n 'companies_id',\n 'Canvas\\Models\\Companies',\n 'id',\n ['alias' => 'company']\n );\n\n $this->belongsTo(\n 'apps_id',\n 'Canvas\\Models\\Apps',\n 'id',\n ['alias' => 'app']\n );\n\n $this->belongsTo(\n 'users_id',\n 'Canvas\\Models\\Users',\n 'id',\n ['alias' => 'user']\n );\n\n $this->belongsTo(\n 'system_modules_id',\n 'Canvas\\Models\\SystemModules',\n 'id',\n ['alias' => 'systemModule']\n );\n\n $this->setSource('email_templates_variables');\n }", "public function init()\n {\n \t$arr_sitemap_nodes_main = CMS_Model_CMSSitemap::getSitemapByHandle('MAIN')->getSitemapNodes(6);\n \t\n \t$this->view->assign('arr_sitemap_nodes_main',$arr_sitemap_nodes_main);\n }", "public function getDatas()\n\t{\n\t\t$this->skeleton = $this->data[\"skeleton\"];\n\t\t$this->javascript = $this->data[\"javascript\"];\n\t\t$this->css = $this->data[\"css\"];\n\t\t$this->module = $this->data[\"module\"];\n\t\t$this->site = $this->data[\"site\"];\n\t}", "public function init() {\n $this->model = new Application_Model_Courses();\n # send loged in user data\n $this->user_model = new Application_Model_Users();\n $this->auth = Zend_Auth::getInstance()->getIdentity();\n $layout = $this->_helper->layout();\n if ($this->auth) {\n $this->user_model->id = $this->auth->id;\n $currunt_user = $this->user_model->getUser();\n if ($currunt_user[0]['is_active'] == 1)\n $layout->user = $currunt_user;\n else\n $this->redirect('user/login');\n }\n else\n $this->redirect('user/login');\n }", "protected function setupLayout() {\n\t\t$this->data['route'] = Route::getCurrentRoute()->getPath();\t\n\t\tif ( ! is_null($this->layout)) {\n\t\t\t$this->data['enrolledCourses'] = NULL;\n\t\t\t\n\t\t\tif (Auth::check() && in_array(Auth::user()->user_type, array(3, 5))) {\n\t\t\t\t$this->data['enrolledCourses'] = EnrolledCourses::getEnrolledCourses();\n\t\t\t\t$this->data['endedCourses'] = EnrolledCourses::getEndedCourses();\n\t\t\t\t$this->data['profiling'] = User::getRegProfile();\t\n\t\t\t\t$this->data['profiling_ctr'] = $this->data['profiling'];\t\t\t\t\n\t\t\t} else if (Auth::check() && Auth::user()->user_type == 2) {\n\t\t\t\t$this->data['assigned_courses'] = Courses::getAssignedCourses();\n\t\t\t}\n\n\t\t\t$this->layout = View::make($this->layout, $this->data);\n\t\t}\n\t}", "public function populateModels()\n {\n }", "public function init()\n {\n $this->_items = $this->getTable('Item');\n $this->_exhibits = $this->getTable('NeatlineExhibit');\n $this->_editions = $this->getTable('NeatlineEdition');\n\n // Get exhibit and document markup.\n $item = $this->_items->find($this->_request->id);\n $edition = $this->_editions->findByItem($item);\n $exhibit = $edition->getExhibit();\n $document = $edition->getDocumentMarkup();\n\n // Push records.\n $this->view->exhibit = $exhibit;\n $this->view->edition = $edition;\n $this->view->document = $document;\n }", "public static function setTemplateData()\n\t{\n\n\t\tself::$templateData = array();\n\n\t\t// Request values\n\t\tself::$templateData['get'] = $_GET;\n\t\tself::$templateData['post'] = $_POST;\n\n\t\t// Config values\n self::$templateData['config'] = array();\n foreach( get_class_vars( 'Kiki\\Config' ) as $configKey => $configValue )\n {\n\t\t\t// Lame security check, but better safe than sorry until a proper\n\t\t\t// audit has been done that in no way unauthorised user content get\n\t\t\t// parsed as template itself, through parsing recursion or otherwise. \n\t\t\t// Should mostly be careful about direct assignment of any of it to\n\t\t\t// 'content'.\n if ( !preg_match( '~(^db|pass|secret)~i', $configKey ) )\n self::$templateData['config'][$configKey] = $configValue;\n }\n\n if ( Config::$customCss )\n self::$templateData['stylesheets'] = array( Config::$customCss );\n\n\t\t// Is that all we want?\n self::$templateData['server'] = array(\n 'host' => $_SERVER['HTTP_HOST'] ?? null,\n 'name' => $_SERVER['SERVER_NAME'] ?? null,\n 'requestUri' => $_SERVER['REQUEST_URI'] ?? null,\n );\n\n self::$templateData['user'] = self::$user ? self::$user->templateData() : null;\n\n\t\t// Account service(s). Although multiple routing entries are technically\n\t\t// possible, templateData currently only populates one: the first found or else\n\t\t// the internal fallback in the Kiki controller.\n\t\t// FIXME: disabled for now, this shouldn't be db-populated anyway\n\t\t// $accountServices = array_values( Router::getBaseUris('account') );\n\t\t$baseUri = isset($accountServices[0]) ? $accountServices[0]->base_uri : Config::$kikiPrefix. \"/account\";\n\t\t$title = isset($accountServices[0]) ? $accountServices[0]->title : _(\"Account\");\n\t\tself::$templateData['accountService'] = array( 'url' => $baseUri, 'title' => $title );\n\t\t\n\t\t// Active connections. Only typing laziness explains why this isn't simply in {$user.connections}.\n self::$templateData['activeConnections'] = array();\n\n $connectedServices = array();\n if ( self::$user )\n {\n foreach( self::$user->connections() as $connection )\n {\n self::$templateData['activeConnections'][] = array(\n 'serviceName' => $connection->serviceName(),\n 'screenName' => $connection->screenName(),\n 'userName' => $connection->name(),\n 'pictureUrl' => $connection->picture()\n );\n\n $connectedServices[] = $connection->serviceName();\n }\n }\n\n // Log::debug( \"user cons: \". print_r(self::$user->connections(),true) );\n\n // Inactive connections. Might as well be in {$user) as well,\n // potentially in {$user.connections} with an {active} switch, although\n // the separation at this level is not the worst.\n\n // Log::debug( \"config: \". print_r(Config::$connectionServices, true) );\n // Log::debug( \"connected: \". print_r($connectedServices,true) );\n\n foreach( Config::$connectionServices as $name )\n {\n if ( !in_array( $name, $connectedServices ) )\n {\n $connection = ConnectionService\\Factory::getInstance($name);\n self::$templateData['inactiveConnections'][] = array( 'serviceName' => $connection->name(), 'loginUrl' => $connection->loginUrl() );\n }\n }\n\n // @todo Allow starttime and execution time from Log(::init) to be\n // queried and assign them. Just in case someone wants to output it in\n // a template.\n\n self::$templateData['now'] = time();\n }", "public function __construct(){\n\t\tparent::__construct();\t\t\n\t\t$this->data_view = parent::setupThemes();\n\t\t$this->destination_path = \"/public/document/library/own/\";\n\t\t$this->data_view['pipeline_index'] \t= $this->data_view['view_path'] . '.pipeline.index';\n\t\t$this->data_view['master_view'] \t= $this->data_view['view_path'] . '.dashboard.index';\n\t\t$this->pipeline_model = new \\CustomerOpportunities\\CustomerOpportunitiesEntity;\n\t}", "public function initAbstractContext()\r\n {\r\n if (!$this->getAutoSerialization()) {\r\n return;\r\n }\r\n \r\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\r\n $view = $viewRenderer->view;\r\n if ($view instanceof Zend_View_Interface) {\r\n $viewRenderer->setNoRender(true);\r\n }\r\n }", "public function __construct()\n {\n\t\tparent::__construct();\n\t\t//$this->pageData = new \\stdClass();\n $this->middleware('guest');\n }", "public function __construct()\n {\n View::share([\n 'current_menu' => 'tips',\n 'sub_title' => trans_choice('dashboard.tips.tips', 2),\n ]);\n }", "public function getdataAction()\n {\n $aa = $this->getServiceLocator()->get('Monappli\\Model\\Doc')->resultatAjax();\n $viewModel = new ViewModel();\n $viewModel->setVariables(array('key' => 'value'))\n ->setTerminal(true);\n return $viewModel;\n }", "public function homePageData() {\n\t\t$data[\"title\"] = \"Home\";\n\t\t$data[\"is_home\"] = 1;\n\t\t$key = 'homeContent';\n\t\t$data[\"sliders\"] = SM::getCache( 'homeSlider', function () {\n\t\t\treturn Slider::where( \"status\", 1 )->get();\n\t\t} );\n\n\t\t$data[\"cases\"] = SM::getCache( 'homeCases', function () {\n\t\t\t$case_show = SM::smGetThemeOption( \"case_show\", 3 );\n\n\t\t\treturn Cases::where( \"status\", 1 )\n\t\t\t ->orderBy( \"id\", \"desc\" )\n\t\t\t ->limit( $case_show )\n\t\t\t ->get();\n\t\t} );\n\t\t$data[\"blogs\"] = SM::getCache( 'homeBlogs', function () {\n\t\t\t$blog_show = SM::smGetThemeOption( \"blog_show\", 6 );\n\n\t\t\treturn Blog::with( \"user\" )\n\t\t\t ->where( \"status\", 1 )\n\t\t\t ->orderBy( \"id\", \"desc\" )\n\t\t\t ->limit( $blog_show )\n\t\t\t ->get();\n\t\t} );\n\t\t$data['homeContent'] = \\View::make( 'partials.home', $data )->render();\n\n\t\treturn $data;\n\t}", "public function getViewData()\n {\n return $this->modelVar;\n }", "public function __construct()\n {\n $this->view = new \\stdClass();\n $this->auth = new AuthUser();\n\n // Variável que recebe as configurações padrões da aplicação\n $this->config = self::findDataSettings();\n\n // Inicializando flash mensagem da aplicação\n\n // Mensagem padrão para operações de sucesso\n if (Session::getSession('success')) {\n $this->success = Session::getSession('success');\n Session::destroySession('success');\n }//end if\n // Mensagem padrão para operações de erros\n if (Session::getSession('errors')) {\n $this->errors = Session::getSession('errors');\n Session::destroySession('errors');\n }//end if\n // Mensagem padrão para operações de info\n if (Session::getSession('info')) {\n $this->info = Session::getSession('info');\n Session::destroySession('info');\n }//end if\n // Captura padrão de dados inseridos nos campos dos formulários\n if (Session::getSession('inputs')) {\n $this->inputs = Session::getSession('inputs');\n Session::destroySession('inputs');\n }//endif\n }", "public function __construct() {\n $opms = Opm::orderBy('opm_sigla', 'asc')->where('cpr_id', '=','12')->get();\n \n view()->share(compact('opms'));\n }", "function run() {\r\n $this->view->data=$this->model->run();\r\n }", "public function __construct()\n {\n $this->middleware('auth:admin');\n $this->admin = auth('admin');\n $notifications = $this->getLastFiveUnreadNotifications('admin','App\\Models\\Admin');\n $unread_notifications_count =$this->getUnreadNotificationsCount('admin','App\\Models\\Admin');\n view()->share(['admin' => $this->admin,'unread_notifications' => $notifications,'unread_notifications_count' =>$unread_notifications_count]);\n }", "function init()\r\n\t{\r\n\t\t$projet = unserialize($_SESSION['session']->projet);\r\n\t\t$this->view->nom_complet = $projet->nom_complet;\r\n\t\t$this->view->desc_projet = $projet->description_projet;\r\n\t\t$this->view->employe = unserialize($_SESSION['session']->account)->account_lid;\r\n\t}", "protected function setData()\n {\n $user = Auth::getUser();\n $cart = Cart::byUser($user);\n if ( ! $cart->payment_method_id) {\n $cart->setPaymentMethod(PaymentMethod::getDefault());\n }\n $this->setVar('cart', $cart);\n $this->setVar('paymentMethod', PaymentMethod::find($cart->payment_method_id) ?? PaymentMethod::getDefault());\n $this->setVar('step', $this->property('step'));\n $this->setVar('accountPage', GeneralSettings::get('account_page'));\n\n if ($orderId = request()->get('order')) {\n $orderId = $this->decode($orderId);\n $this->setVar('order', Order::byCustomer($user->customer)->find($orderId));\n }\n }", "public function getData()\n {\n // {\n // $data = $this->model->getUsername;\n // $this->buffer->addData('home', $data);\n // } else {\n // $data = \"signin\";\n // $this->buffer->addData('home', $data);\n // }\n $this->data['action'] = \"Sorry\";\n $this->data['entity'] = \"This page does not exist\";\n $this->data['home'] = \"signin\";\n\n $this->data['scripts'] = [];\n }", "public function setDatas()\n\t{\n\t\t$this->data[\"skeleton\"] = $this->getSkeleton();\n\t\t$this->data[\"css\"] = $this->getCss();\n\t\t$this->data[\"javascript\"] = $this->getJavascript();\n\t\t$this->data[\"module\"] = $this->getModule();\n\t\t$this->data[\"site\"] = $this->getSite();\n\t\t\t\t\t\t\n\t\t$this->_nodeName = $this->getNodeName();\n\t\t$this->_value = $this->getNodeValue();\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t\t$this->middleware('admin',['only' => array('indexAdmin','showEmployees','editEmployee','updateEmployee','destroy')]);\n\t\t$this->middleware('director',['only' => array('indexDirector')]);\n\t\t$this->middleware('manager',['only' => array('indexManager','showMembers')]);\n\t\t$this->middleware('member',['only' => array('indexMember')]);\n\t\t/*\n\t\t$this->manager = User::find(Auth::id());\n\t\tView::share('manager', $this->manager);\n\n\t\t$this->team = Team::find(Auth::user()->team->id);\n View::share('team', $this->team);\n */\n\n //not displaying the \n //$this->notif_user = User::all()->where('created_at', new DateTime('today'));\n //View::share('notif_user', $this->notif_user);\n\n //working!\n View::share('managerview', Auth::id());\n View::share('teamview', Auth::user()->team->id);\n View::share('adminteams', Team::all());\n View::share('emp', User::all());\n View::share('dirleaves', Leave::all()->where('status','pending'));\n View::share('username', Auth::user()->username);\n }", "public function initialize()\n {\n //$this->view->setTemplateBefore('public');\n }", "public function indexAction()\n {\n\n if ($this->layoutParams['config']->siteOffline) {\n return $this->_getOfflineMsg();\n }\n //\n // $this->layoutParams['data'] = $this->_getContent(1); \n $this->layout()->template = $this->layoutParams['template']; \n\t$this->layout()->company = $this->company;\n return new ViewModel(array( 'data' => $this->_getContent(1)));\n }", "function __contruct()\n {\n $this->load->model('Inbound_message_model');\n $this->load->model('Psychic_model');\n $data['title'] = 'Bulletin board';\n\t\t$data['user'] = Auth::me();\n\n\t\t\n }", "public function __construct()\n\t{\n\t\t//$this->middleware('auth');\n\t\tView::share(['user' => Auth::user()]);\n\t}", "public function __construct() {\n parent::__construct();\n $this->middleware('guest', ['except' => 'logout']);\n \\View::share('settings', SiteSetting::getSettingObject());\n }", "public function __construct()\n {\n $this->addCSS('dance/style.css');\n $this->addJs('dance/dance.js');\n $this->addCSS('cart-popup.css');\n $this->addJs('partial/cart-popup.js');\n // Load the models for the current page\n $this->contentModel = $this->model('ContentModel');\n $this->eventModel = $this->model('EventModel');\n $this->programModel = $this->model('ProgramModel', 'dance');\n $this->ticketModel = $this->model('TicketModel', 'dance');\n $this->lineupModel = $this->model('LineupModel', 'dance');\n }", "function preDispatch() {\n\t\t$this->_viewHelper = new \\App\\Helper\\View();\n\t}", "protected function loadDefaultViewParameters()\n {\n # Load Hook component\n $this->oHook = new Hook();\n $this->aView['aHooks'] = array();\n\n $this->aView['aSession'] = $this->oSession->get();\n // @todo provisoire\n if (isset($this->aView['aSession']['auth'])) {\n $aUserSession = $this->aView['aSession']['auth'];\n $this->aView['sGravatarSrc16'] = Gravatar::getGravatar($aUserSession['mail'], 16);\n $this->aView['sGravatarSrc32'] = Gravatar::getGravatar($aUserSession['mail'], 32);\n $this->aView['sGravatarSrc64'] = Gravatar::getGravatar($aUserSession['mail'], 64);\n $this->aView['sGravatarSrc128'] = Gravatar::getGravatar($aUserSession['mail'], 128);\n }\n\n // Views common couch\n $this->aView[\"appLayout\"] = '../../../app/Views/layout.tpl'; // @todo degager ca ou computer\n $this->aView[\"helpers\"] = '../../../app/Views/helpers/';\n\n // Bootstrap\n $oBundles = new Bundles();\n $this->aView[\"aAppBundles\"] = $oBundles->get();\n $this->aView[\"sAppName\"] = $this->aConfig['app']['name'];\n $this->aView[\"sAppSupportName\"] = $this->aConfig['support']['name'];\n $this->aView[\"sAppSupportMail\"] = $this->aConfig['support']['email'];\n $this->aView[\"sAppIcon\"] = '/lib/bundles/' . $this->sBundleName . '/img/icon.png';\n\n // MVC infos\n $this->aView['sLocale'] = $this->sLang;\n $this->aView['sBundle'] = $this->sBundleName;\n $this->aView[\"sController\"] = $this->sController;\n $this->aView[\"sControllerName\"] = substr($this->sController, 0, strlen($this->sController) - strlen('controller'));\n $this->aView[\"sAction\"] = $this->sAction;\n $this->aView[\"sActionName\"] = substr($this->sAction, 0, strlen($this->sAction) - strlen('action'));\n\n // debug\n $this->aView[\"sEnv\"] = ENV;\n $this->aView[\"sDeBugHelper\"] = '../../../app/Views/helpers/debug.tpl';\n $this->aView[\"bIsXhr\"] = $this->isXHR();\n\n // Benchmark\n $this->aView['framework_started'] = FRAMEWORK_STARTED;\n $this->aView['current_timestamp'] = time();\n }", "public function __construct()\n {\n // $this->middleware('role:admin');\n $this->middleware('auth');\n $pages = Page::all();\n View::share('pages', $pages);\n }", "public function setup() { \n\t\t$this->auth_realm = CMS::$admin_realm;\n\t\treturn parent::setup()->use_views_from('../app/views'); \n\t}", "function __construct() {\r\n $this->view = new View();\r\n $this->deviceType = View::getInstance();\r\n }", "public function __construct()\n {\n view()->composer('layouts.layout', function ($view) {\n $view->with('section', 'wallet');\n });\n $this->api_ids = [];\n }", "public function init()\n {\n //$this->_helper->acl->allow(null);\n $this->_application = new Zend_Session_Namespace('PHPReview');\n $usuario = new Application_Model_UsuarioMapper();\n $this->view->totalUsuarios = $usuario->getQuantidade();\n }", "public function load() {\n\t\t$this->init();\n\t\t$action = $this->action;\n\t\t$view = $this->$action();\n\n\t\tif ($view instanceof View && !$this->app->isErrorPage()):\n\t\t\t$this->app->view = $view;\n\t\tendif;\n\n\t\t$this->app->view->mergeData($this->data);\n\t\t$this->app->view->validate();\n\t}", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}", "function __construct()\n {\n $this->view = TemplatesFactory::templates();\n Sesion::init();\n }" ]
[ "0.6096046", "0.6082561", "0.60815376", "0.6061246", "0.6057159", "0.6035722", "0.5986987", "0.59405184", "0.59213686", "0.5908973", "0.584889", "0.58116674", "0.5791383", "0.5791383", "0.57855886", "0.5781217", "0.5704285", "0.56600296", "0.5655404", "0.56357574", "0.5629549", "0.5589551", "0.5586592", "0.5579998", "0.55745804", "0.5554627", "0.55482197", "0.5542332", "0.55186236", "0.5496466", "0.5493769", "0.5486965", "0.5439832", "0.54223764", "0.5415386", "0.5415351", "0.5403719", "0.5378852", "0.53778607", "0.53762275", "0.5361951", "0.53604615", "0.5357663", "0.5356096", "0.5348766", "0.5347478", "0.53474706", "0.53436524", "0.5342564", "0.53417283", "0.53417283", "0.53369415", "0.5335273", "0.5333394", "0.5324159", "0.53224814", "0.5320705", "0.5319122", "0.5315383", "0.530651", "0.5306484", "0.5305974", "0.52993715", "0.52842265", "0.5283759", "0.5276629", "0.5274113", "0.52696306", "0.52655125", "0.52630234", "0.5258654", "0.5253496", "0.52407813", "0.5238704", "0.522275", "0.5216243", "0.52126", "0.5212041", "0.5211635", "0.5203387", "0.52004266", "0.5197537", "0.5194579", "0.51934224", "0.51924217", "0.5188715", "0.5186726", "0.5184301", "0.5184009", "0.5182115", "0.5180559", "0.51773113", "0.51749015", "0.51723886", "0.51642317", "0.51619184", "0.51610124", "0.51504546", "0.51479363", "0.51433045" ]
0.725214
0
Upload a new image to sandbox
public function uploadImageAction(Request $request) { /** @var UploadedFile $uploadedFile */ $uploadedFile = $request->files->get('file'); $file = new TemporaryFile($uploadedFile); /** @var EventDispatcher $eventDispatcher */ $eventDispatcher = $this->get('event_dispatcher'); $eventDispatcher->dispatch(Events::TEMPORARY_FILE_RECEIVED_EVENT, new TemporaryFileEvent($file)); /** @var ConstraintViolationListInterface $violations */ $violations = $this->get('netinfluence_upload.temporary_file_validator')->validateImage($file); if (count($violations)) { $messages = $this->serializeViolations($violations); return new JsonResponse(array( 'error' => implode(' - ', $messages), 'raw_errors' => $messages, ), 400); } try { // On this event, a listener will store file // It is allowed to throw exceptions, relative to FS issues $eventDispatcher->dispatch(Events::TEMPORARY_FILE_VALIDATED_EVENT, new TemporaryFileEvent($file)); } catch (\Exception $e) { return new JsonResponse(array( 'errors' => $e->getMessage(), ), 400); } return new JsonResponse(array( 'path' => $file->getTargetPath(), 'temporary' => true, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function upload(): void\n {\n // check if we have an old image\n if ($this->oldFileName !== null) {\n $this->removeOldFile();\n }\n\n if (!$this->hasFile()) {\n return;\n }\n\n $this->writeFileToDisk();\n\n $this->file = null;\n }", "public function StaticImageUpload(){\n $design_id = $_POST['new_filename'];\n $uid = $_POST['uid'];\n $uid = empty($uid) ? 0 : $uid;\n $exp = explode(\".\", $_FILES[\"file\"][\"name\"])[1];\n $filename = $design_id.'.'.$exp;\n $new_file = 'public://files/'.$uid.'/kmds/images/static_image/' . $filename;\n $uploaded_image = file_get_contents($_FILES[\"file\"][\"tmp_name\"]);\n file_put_contents($new_file, $uploaded_image);\n $source_original = array(\"src\" => file_create_url($new_file));\n return new JsonResponse($source_original);\n }", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function upload64() {\n $post = json_decode(file_get_contents('php://input'), true);\n\n $access = $this->_checkAccess($post['auth'],'shortLiveToken');\n\n if(!isset($access['shortLiveToken'])) {\n $result['err'] = 'Permission Denied';\n echo json_encode($result, true);\n die();\n }\n\n $imgName = md5('avatar.'.$access['shortLiveToken']);\n\n $options = array(\n 'path' => 'uploader/tmpImgStore/',\n 'width' => 300,\n 'height' => 300\n );\n\n require_once('photoProcess.php');\n $photo = new photoProcess();\n $photo->set($options);\n\n $upload = $photo->photo64($post['source'], $imgName);\n\n echo json_encode($upload, true);\n }", "public function uploadImage()\n {\n if (null === $this->fileimage) {\n return;\n }\n\n $upload = new Upload();\n $this->image = $upload->createName(\n $this->fileimage->getClientOriginalName(),\n $this->getUploadRootDir().'/',\n array('tmp/','miniature/')\n );\n\n $imagine = new Imagine();\n\n /* Tmp */\n $size = new Box(1920,1080);\n $imagine->open($this->fileimage)\n ->thumbnail($size, 'inset')\n ->save($this->getUploadRootDir().'tmp/'.$this->image);\n\n /* Miniature */\n $size = new Box(300,300);\n $imagine->open($this->fileimage)\n ->thumbnail($size, 'outbound')\n ->save($this->getUploadRootDir().'miniature/'.$this->image);\n\n }", "public function testPutImage()\n {\n }", "public function upload_foto_file()\n\t{\n\t\tif (!$this->is_allowed('m_ads_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'm_ads',\n\t\t]);\n\t}", "public function upload()\n {\n if (null === $this->getImg()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getImg()->move(\n self::SERVER_PATH_TO_PRESS_IMAGE_FOLDER,\n $this->getImg()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->imageUrl = $this->getImg()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setImg(null);\n }", "public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }", "public function uploadImage(){\n\n $fileExt = explode('.', $this->fileName);\n $fileActualExt = strtolower(end($fileExt));\n $allowedExt = array('jpg', 'jpeg');\n\n if($this->fileError !== 0 && $this->fileSize > 8000 && !in_array($fileActualExt, $allowedExt)){\n return false;\n }\n $fileId = uniqid('', false).'.'.$fileActualExt;\n $fileDestination = '../api/image_entity/'.$fileId;\n\n $transfertDone = move_uploaded_file($this->fileTmp, $fileDestination);\n\n if($transfertDone){\n $app = App::getInstance();\n $systemManager = $app->getManager('System');\n $imageId = $systemManager->addImage($fileId);\n\n return $imageId;\n }\n\n }", "public function upload();", "public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }", "public function add_image_post() {\n $itemId = $this->input->post('item_id');\n $uploadResult= $this->upload();\n if ($uploadResult['upload'] === 'ok') {\n $fileData = $uploadResult['fileData'];\n $updatePayload = array(\n 'photo' => $fileData['file_name']\n );\n $res = $this->model->update($itemId, $updatePayload);\n return $this->response(\n array(\n \"status\" => \"ok\",\n \"result\" => $res\n ),\n parent::HTTP_ACCEPTED\n );\n\n }else{\n return $this->response(\n array( 'status' => 'UPLOADING FAILED', \n 'code' => '200', \n 'message' => $uploadResult['err']), \n parent::HTTP_BAD_GATEWAY );\n }\n }", "function m_uploadImage()\n\t{\n\t\t$fileUpload = new FileUpload();\n\t\t$name=$this->request['img'];\n\t\tif($this->libFunc->checkImageUpload(\"image\"))\n\t\t{\n\t\t\t\t$fileUpload->source = $_FILES[\"image\"][\"tmp_name\"];\n\t\t\t\t$fileUpload->target = $this->imagePath.\"giftwrap/\".$_FILES[\"image\"][\"name\"];\n\t\t\t\t$newName1 = $fileUpload->upload();\n\t\t\t\t$this->obDb->query=\"UPDATE \".GIFTWRAPS.\" set\n\t\t\t\t $name='$newName1' where iGiftwrapid_PK='\".$this->request['id'].\"'\";\n\t\t\t\t$this->obDb->updateQuery();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->libFunc->m_mosRedirect(SITE_URL.\"sales/adminindex.php?action=promotions.giftwrap.uploadForm&msg=2&img=\".$this->request['img'].\"&id=\".$this->request['id']);\n\t\t}\n\t\t$this->libFunc->m_mosRedirect(SITE_URL.\"sales/adminindex.php?action=promotions.giftwrap.uploadForm&msg=1&img=\".$this->request['img'].\"&id=\".$this->request['id']);\n\t}", "public function upload_postAction() {\r\n\t\t$ret = Common::upload('img', 'ad');\r\n\t\t$imgId = $this->getPost('imgId');\r\n\t\t$this->assign('code' , $ret['data']);\r\n\t\t$this->assign('msg' , $ret['msg']);\r\n\t\t$this->assign('data', $ret['data']);\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t//create webp image\r\n\t\tif ($ret['code'] == 0) {\r\n\t\t\t$attachPath = Common::getConfig('siteConfig', 'attachPath');\r\n\t\t\t$file = realpath($attachPath.$ret['data']);\r\n\t\t\timage2webp($file, $file.'.webp');\r\n\t\t}\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n }", "public function testSuccessUploadImage()\n {\n $file = UploadedFile::fake()->image('avatar.png');\n\n $response = $this->post(route('upload.image'), [\n 'file' => $file,\n ]);\n\n $response->assertStatus(200);\n }", "public function uploadImage() \n {\n if (is_null($this->image)) {\n return;\n }\n \n // move image from temp directory to destination one\n $this->image->move(\n $this->getUploadRootDir(),\n $this->image->getClientOriginalName()\n );\n\n $this->path = $this->image->getClientOriginalName();\n $this->image = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n $this->picture = file_get_contents($this->getFile());\n\n if (isset($this->temp)) {\n $this->temp = null;\n }\n\n $this->file = null;\n }", "public function uploadImage($formname) {\n if ($formname['size'] > 10240000) {\n redirect ('error');\n } \n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t$image = base64_encode(file_get_contents($formname['tmp_name']));\n\n $options = array('http'=>array(\n 'method'=>\"POST\",\n 'header'=>\"Authorization: Bearer fbec2d0f2c259944907341aeedb0a387f85fae12\\n\".\n \"Content-Type: application/x-www-form-urlencoded\",\n 'content'=>$image\n ));\n\n $context = stream_context_create($options);\n\n $imgurURL = \"https://api.imgur.com/3/image\";\n\n \n\n $response = file_get_contents($imgurURL, false, $context);\n\t\t\t\tif($response === false)\n\t\t\t\t{\t\n\t\t\t\t\t//echo \"<script type='text/javascript'>alert('Connection Error');</script>\";\n\t\t\t\t\tredirect ('error');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n $response = json_decode($response);\t\n\t\t\t\t$link=$response->data->link;\n\t\t\t\treturn $link;\n\t\t\t\t}\n\t\t\t\t}\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'img' => 'required',\n ]);\n $file = $request->file('img');\n // $file = $request->file('img')->store('public/files');\n $img = Image::make($file)->fit(1096,1096);\n \n // paste another image \n $frame = Frame::latest()->value('frame');\n\n $theFrame = Storage::get($frame);\n \n $img->insert($theFrame);\n return $img->response('jpg');\n \n \n }", "public function store(){\n $url_path = 'assets/imgs/' . $_FILES['file']['name'];\n move_uploaded_file($_FILES['file']['tmp_name'], $url_path);\n $_POST['url_image'] = $url_path;\n echo parent::register($_POST) ? header('location: ?controller=admin') : 'Error en el registro';\n }", "public function actionUpload()\n\t{\n\n\t\t$input = craft()->request->getPost();\n\n\t\t$file = UploadedFile::getInstanceByName('file');\n\n\t\t$folder = craft()->assets->findFolder(array(\n\t\t 'id' => $input['id']\n\t\t));\n\n\t\tif ($folder) {\n\t\t\t$folderId = $input['id'];\n\t\t}\n\n\t\tcraft()->assets->insertFileByLocalPath(\n\t\t $file->getTempName(),\n\t\t $file->getName(),\n\t\t $folderId,\n\t\t AssetConflictResolution::KeepBoth);\n\n\t\tcraft()->end();\n\t}", "public function uploadImage()\n {\n /* Getting current user's data */\n $user = Auth::getUser();\n\n /* Checking if user is online */\n if ($user) {\n\n /* Checking if image was upload */\n if (is_uploaded_file($_FILES['image']['tmp_name'])) {\n\n /* Creating new Upload's object */\n $upload = new Upload([\n 'subfolder' => 'answers/',\n 'name' => $_FILES['image']['name'],\n 'type' => $_FILES['image']['type'],\n 'tmp_name' => $_FILES['image']['tmp_name'],\n 'error' => $_FILES['image']['error'],\n 'size' => $_FILES['image']['size'],\n ]);\n\n /* Setting new random title for image */\n $upload->name = $upload->getRandomFilename(pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION));\n\n /* Uploading image */\n if ($upload->upload()) {\n\n /* Return response */\n header('Content-Type: application/json');\n echo json_encode('/media/images/answers/'.$upload->name);\n }\n }\n }\n\n return false;\n }", "public function upload()\n {\n if(!Csrf::checkToken($this->_request->getInput('_CSRF')))\n {\n $response = [\n 'status' => 'error',\n 'message' => 'csrf'\n ];\n return $this->_response->returnJson($response);\n }\n\n $file = $this->_request->getUploadedFile('img');\n $uploader = new ImageUpload(new Imagick($file['tmp_name']));\n $uploadResult = $uploader->upload($file);\n\n return $this->_response->returnJson($uploadResult);\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'Recsite');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n }", "public function upload()\n {\n if (null === $this->image) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the target filename to move to\n $this->file->move($this->getUploadRootDir(), $this->image->getClientOriginalName());\n\n // set the path property to the filename where you'ved saved the file\n $this->path = $this->image->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "function quota_new_image($image) {\n\tglobal $_zp_current_admin_obj;\n\tif (is_object($_zp_current_admin_obj)) {\n\t\t$image->set('owner',$_zp_current_admin_obj->getUser());\n\t}\n\t$image->set('filesize',filesize($image->localpath));\n\t$image->save();\n\treturn $image;\n}", "public function invtZoneImgUplaod_post()\n {\n $data = $this->post();\n //print_r($data);\n //echo $data['kp_InventoryZoneID'];\n $inventoryZoneID = $data['kp_InventoryZoneID'];\n\n if(!empty($_FILES['file']['name']))\n {\n //echo \"not empty\";\n $msg = $this->inventoryzonemodel->doInvtZoneCustomUpload($inventoryZoneID);\n\n if($msg)\n {\n $this->response($msg, 200); // 200 being the HTTP response code\n }\n else\n {\n $this->response($msg, 404);\n }\n\n }\n\n\n\n }", "public function test_images_are_stored_in_remote_storage_service()\n {\n $image_file = UploadedFile::fake()->image('selfie.png');\n \n $image_storage = $this->app->make(ImageStoreService::class);\n\n $response = $image_storage->store($image_file);\n\n $this->assertArrayHasKey('status', $response->json());\n $this->assertEquals('success', $response->json()['status']);\n $this->assertArrayHasKey('message', $response->json());\n $this->assertEquals('Image saved successfully.', $response->json()['message']);\n $this->assertArrayHasKey('url', $response->json());\n }", "public function testUploadCertificateImage()\n {\n }", "public function upload(){\n if( NULL === $this->getFile()){\n return;\n }\n $filename= $this->getFile()->getClientOriginalName();\n\n // Move to the target directory\n \n $this->getFile()->move(\n $this->getAbsolutePath(), \n $filename);\n\n //Set the logo\n $this->setFilename($filename);\n\n $this->setFile();\n\n }", "public function uploadimage()\n\t{\n\t\t$user = User::find($_POST['user_id']);\n\n\t\t$userprofile = Input::file( 'user_profile_image' );\n\n\t\tif( !empty( $userprofile ) )\n\t\t{\n\t\t\t$file_in = $userprofile->getRealPath();\n\n\t\t\t$file_out = 'profile/' . $_POST['user_id'] . \"-\" . str_random( 12 ) . \".jpg\";\n\n\t\t\t$img = Image::make( $file_in );\n\n\t\t\t$img->resize( 200, 200 );\n\n\t\t\t$img->save( Config::get('app.home') . '/public/' . $file_out, 80 );\n\n\t\t\t$handle = fopen( Config::get('app.home') . '/public/' . $file_out, \"r\" );\n\n\t\t\tFlysystem::connection( 'awss3' )->put( $file_out,\n\t\t\t\t\t\t\t\t\t\t\t\t fread( $handle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t filesize( Config::get('app.home') . '/public/' . $file_out ) ) );\n\n\t\t\t$user->user_profile_image = $file_out;\n\t\t}\n\n\t\t$usercoverprofile = Input::file( 'user_cover_image' );\n\n\t\tif( !empty( $usercoverprofile ) )\n\t\t{\n\t\t\t$file_in = $usercoverprofile->getRealPath();\n\t\t\t$file_out = 'profile/' . $_POST['user_id'] . \"-\" . str_random( 12 ) . \".jpg\";\n\n\t\t\t$img = Image::make( $file_in );\n\n\t\t\t$img->resize( 200, 200 );\n\n\t\t\t$img->save( Config::get('app.home') . '/public/' . $file_out, 80 );\n\n\t\t\t$handle = fopen( Config::get('app.home') . '/public/' . $file_out, \"r\" );\n\n\t\t\tFlysystem::connection( 'awss3' )->put( $file_out,\n\t\t\t\t\t\t\t\t\t\t\t\t fread( $handle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t filesize( Config::get('app.home') . '/public/' . $file_out ) ) );\n\n\t\t\t$user->user_cover_image = $file_out;\n\t\t}\n\t\t$user->save();\n\t\theader(\"Location:http://\".Config::get('app.url_admin').\"/user/\".$_POST['user_id']);\n\t\texit();\n\t\t/*end of code for upload user profile and cover image*/\n\t}", "function upload_image()\n {\n $file = $this->request->getFile('image');\n $fileName = $file->getRandomName();\n $file->move('./assets/img/beranda/post/inside', $fileName);\n echo base_url('assets/img/beranda/post/inside') . '/' . $fileName;\n }", "public function testPostImage()\n {\n }", "public function Uploadpicture()\r\n\t\t{\r\n\t\t}", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'Goods');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'bestj');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "function upload() {\n $this->autoRender = false;\n if (!$this->request->is('post')) {\n $this->response->statusCode(405);\n echo json_encode(array('status' => 'Failure', \"message\" => 'Get Not Allowed'));\n return;\n }\n\n try {\n $result = $this->Image->save_to_redis($this->request);\n } catch (Exception $e) {\n $this->response->statusCode($e->getCode());\n $result = array('status' => 'Failure', 'message' => $e->getMessage());\n }\n\n echo json_encode($result);\n }", "public function upload()\n\t{\n\t}", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'ad');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n }", "public function saveimageAction()\n {\n $response = $this->getResponse();\n\n $userid= $this->params()->fromPost('userid');\n $createdTime= $this->params()->fromPost('createdtime');\n $imageType = $this->params()->fromPost('imagetype');\n $imageType = substr($imageType, -3, 3);\n $AVAorCOV = $this->params()->fromPost('albumtype');\n\n $documentService = $this->getDocumentService();\n\n $successModel = new SuccessModel();\n $result = $successModel->saveNewImageAvatar($userid, $createdTime,$documentService, $imageType, $AVAorCOV );\n\n if($result)\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 1,\n )));\n }\n else\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 0,\n )));\n }\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // if there is an error when moving the file, an exception will\n // be automatically thrown by move(). This will properly prevent\n // the entity from being persisted to the database on error\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n\n // check if we have an old image\n if (isset($this->temp)) {\n // delete the old image\n unlink($this->getUploadRootDir().'/'.$this->temp);\n // clear the temp image path\n $this->temp = null;\n }\n $this->file = null;\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'gou_brand');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "private function _imgSave(){\r\n\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $img = getimagesize($sourcePath);\r\n $new_name = uniqid();\r\n\r\n switch($img['mime']){\r\n case 'image/png':\r\n $new_name .= '.png';\r\n break;\r\n case 'image/jpeg':\r\n $new_name .= '.jpg';\r\n break;\r\n case 'image/gif':\r\n $new_name .= '.gif';\r\n break;\r\n default:\r\n echo \"Only PNG, JPEG or GIF images are allowed!\";\r\n exit;\r\n }\r\n\r\n $targetPath = ROOT.'/site/files/'.$new_name;\r\n $webPath = WEBROOT.'/site/files/'.$new_name;\r\n\r\n if(rename($sourcePath, $targetPath)){\r\n $result->url = $webPath;\r\n $result->size = [$img[0],$img[1]];\r\n $result->alt = 'an image';\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }", "function media_upload_image()\n {\n }", "public function uploadProfilePicture()\n {\n // nécessaire de le nettoyer pour éviter les problèmes de sécurité\n\n // move copie le fichier présent chez le client dans le répertoire indiqué.\n $this->file->move($this->getUploadRootDir(), $this->file->getClientOriginalName());\n\n // On sauvegarde le nom de fichier\n $this->nomImage = $this->file->getClientOriginalName();\n\n // La propriété file ne servira plus\n $this->file = null;\n }", "private function uploadImagePost(Request $request){\n\t\t// Handles data\n\t\t$target = explode('.',$request->target);\n\t\t$class = '\\App\\\\'.ucwords($target[0]);\n\t\t$object = $class::find($request->id);\n\n\t\t// Handles image\n\t\t$image = \\Gumlet\\ImageResize::createFromString(base64_decode($request->data));\n\t\t$image->quality_jpg = 50;\n\n\t\t// Saving image\n\t\t$object->image = (string) $image;\n\t\t$object->save();\n\t}", "function upload_file() {\n upload_file_to_temp();\n }", "public function addImage()\n {\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\n\t\t\t$image = new ImageModel();\n\t\t\t$this->saveImageModel($image, $user);\n\t\t\treturn $this->sendResponse('Your image has been successfully uploaded');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to add an image');\n }", "public function uploadImageAction() {\r\n //GET SLIDESHOW ID\r\n $advancedslideshow_id = (int) $this->_getParam('advancedslideshow_id');\r\n\r\n //GET VIEWER INFORMATION\r\n if (!$this->_helper->requireUser()->checkRequire()) {\r\n $this->view->status = false;\r\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Max file size limit exceeded (probably).');\r\n return;\r\n }\r\n \r\n if (!$this->getRequest()->isPost()) {\r\n $this->view->status = false;\r\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid request method');\r\n return;\r\n }\r\n\r\n $values = $this->getRequest()->getPost();\r\n if (empty($values['Filename'])) {\r\n $this->view->status = false;\r\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('No file');\r\n return;\r\n }\r\n\r\n if (!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES['Filedata']['tmp_name'])) {\r\n $this->view->status = false;\r\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid Upload');\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getDbtable('images', 'advancedslideshow')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n $params = array(\r\n 'advancedslideshow_id' => $advancedslideshow_id,\r\n 'user_id' => 1,\r\n );\r\n $this->view->status = true;\r\n include_once APPLICATION_PATH . '/application/modules/Advancedslideshow/controllers/license/license3.php';\r\n\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n $this->view->status = false;\r\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('An error occurred.');\r\n return;\r\n }\r\n }", "function uploadDemandDraftImage(UploadTicketRequest $request){\n $extension = $request->file('demand_draft')->getClientOriginalExtension();\n $filename = 'demand_draft_' . Auth::user()->id . '.' . $extension;\n $payment = Auth::user()->payment;\n $request->file('demand_draft')->move('uploads/Event/demand_draft', $filename);\n $payment->file_name = $filename;\n $payment->status='nack';\n $payment->mode_of_payment='dd';\n $payment->payment_status='notpaid';\n $payment->amount=Auth::User()->getTotalAmount();\n $payment->user_id=Auth::User()->id;\n \n $payment->save();\n // Auth::user()->doPaymentDD($filename);\n Session::flash('success', 'Your demand draft was uploaded');\n return redirect()->route('user_pages.dashboard');\n }", "public function upload_signed_copy(Request $request)\n {\n //\n\n try {\n //code...\n $image = $request->file('file');\n\n $newname = rand(233,9000).'.'.$image->getClientOriginalExtension();\n \n $image->move(public_path('remedial_signed_copy'), $newname);\n \n return $newname;\n } catch (\\Throwable $th) {\n //throw $th;\n\n return $th;\n }\n\n \n\n\n }", "public function createTouristSpot(){\n \t$filename = $_FILES['image']['name'];\n \tif(strlen($filename) > 4){\n $image_name = $this->_imageUpload();\n }else{\n \t$image_name = NULL;\n }\n\n $this->adminModel->createTouristSpot($image_name);\n redirect('admin/tourist-spot');\n }", "public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}", "public function saveAction()\n {\n $data = $this->getRequest()->getPost();\n if ($data) {\n try {\n if (isset($data['image']['delete'])) {\n $data['image'] = '';\n } else {\n unset($data['image']);\n\n if (isset($_FILES)) {\n if ($_FILES['image']['name']) {\n if ($this->getRequest()->getParam('id')) {\n $model = Mage::getModel('pugnet_uploader/images')->load($this->getRequest()->getParam('id'));\n if ($model->getData('image')) {\n $io = new Varien_Io_File();\n $io->rm(Mage::getBaseDir('media') . DS . implode(DS, explode('/', $model->getData('image'))));\n }\n }\n $path = Mage::getBaseDir('media') . DS . 'uploader' . DS . 'images' . DS;\n $uploader = new Varien_File_Uploader('image');\n $uploader->setAllowedExtensions(['jpg', 'png', 'gif']);\n $uploader->setAllowRenameFiles(false);\n $uploader->setFilesDispersion(false);\n $destFile = $path . $_FILES['image']['name'];\n $filename = $uploader->getNewFileName($destFile);\n $uploader->save($path, $filename);\n\n $data['image'] = 'uploader/images/' . $filename;\n }\n }\n }\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $this->_redirectReferer();\n }\n\n try {\n $model = Mage::getModel('pugnet_uploader/images')\n ->addData($data)\n ->setId($this->getRequest()->getParam('id'))\n ->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image was successfully saved'));\n Mage::getSingleton('adminhtml/session')->setItemsData(false);\n $this->_redirectReferer();\n\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setItemsData($this->getRequest()->getPost());\n $this->_redirectReferer();\n }\n }\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image has not been saved'));\n $this->_redirectReferer();\n }", "public function upload(): void\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "function uploadImage($upload, $imgName, $category, $title, $description){\n\t\tglobal $image;\n\t\t\t\n\t\t$title .= imgName.rand(srand((double)microtime()*1000000),100);\n\t\t$description .= $imgName;\n\t\t$credit = $imgName;\n\t\t\t\n\t\t$image->setTitle($title);\n\t\t$image->setDescription($description);\n\t\t$image->setCredit($credit);\t\t\t\t\t\t\t\t\n\t\t$name = $image->generateName();\n\t\tif (!$name) {\n\t\t\t$feedback['message'][] = 'An image with that name already exists in the library';\n\t\t\t$feedback[0] = 'error';\n\t\t}\t\n\t\telse {\n\t\t\n\t\t\t$image->setCategory($category);\n\t\t\t$categoryOK = true;\n\t\t\t\n\t\t\t\n\t\t\t// Now -- take the image that's been uploaded, check it's there, set the original name, filesize and mime\t\t\t\t\t\t\n\t\t\tif (!$upload) {\n\t\t\t\t$feedback['message'] = 'There was a problem uploading your image. It may be too large.';\n\t\t\t\t$feedback[0] = 'error';\n\t\t\t}\n\t\t\telse if ($error = $image->getUploadError($upload['error'])) {\n\t\t\t\t$feedback['message'] = $error; \n\t\t\t\t$feedback[0] = 'error';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\t// We now set the image dimensions, size and type\n\t\t\t\t// Do we need to check the filesize here, or is that covered in the preceding clauses?\n\t\t\t\n\t\t\t\tif (!$image->loadFromPost($upload)) {\n\t\t\t\t\t$feedback['message'][] = 'Your image is either not a GIF, JPEG or PNG, or it\\'s dimensions are too large.';\n\t\t\t\t\t$feedback['message'][] = 'The maximum length or width should be 800 pixels.';\n\t\t\t\t\t$feedback[0] = 'error';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$writeOK = true;\n\t\t\t\t\t\n\t\t\t\t\t//// save the original image\n\t\t\t\t\t$image->resize('');\n\t\t\t\t\t// Save the image to disc\n\t\t\t\t\tif (!$writeOK = $image->write()) {\n\t\t\t\t\t\t$feedback[0] = 'error';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$image->create();\n\t\t\t\t\t$imgGUID = $image->getGUID();\n\t\t\t\t\n\t\t\t\t\tforeach ($image->sizes as $size) {\n\t\t\t\t\t\t//echo $size;\n\t\t\t\t\t\t$image->resize($size);\n\t\t\t\t\t\t// Save the image to disc\n\t\t\t\t\t\tif (!$writeOK = $image->write()) {\n\t\t\t\t\t\t\t$feedback[0] = 'error';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Creates a new record in the database, with the original image as the parent.\n\t\t\t\t\t\t$image->create($imgGUID);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// create the thumbnail for the imagepicker\n\t\t\t\t\t$image->resize('100x100');\n\t\t\t\t\tif (!$writeOK = $image->write()) {\n\t\t\t\t\t\t$feedback[0] = 'error';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tif (!$writeOK) {\n\t\t\t\t\t\t$feedback[0] = 'error';\n\t\t\t\t\t\t$feedback['message'] = 'Image cannot be saved to disk';\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$image->close();\n\t\t\t\t\t\t$feedback[0] = 'success';\n\t\t\t\t\t\t$feedback['message'] = '';\n\t\t\t\t\t\t$feedback['guid'] = $imgGUID;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $feedback;\n\t}", "public function setProfileImageAction( $header_data, $post_data ){ \n if( empty($post_data['image']) && empty($_FILES[\"images\"]) ) {\n Library::logging('alert',\"API : setProfileImage : \".ERROR_INPUT.\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_INPUT, null);\n } else {\n try {\n if( !empty($_FILES[\"images\"]['name']) && !empty($_FILES[\"images\"]['tmp_name']) && empty($_FILES[\"images\"]['error']) ){\n $imgName = rand().$_FILES[\"images\"]['name'];\n $uploadFile= $_FILES[\"images\"]['tmp_name'];\n \n }elseif( !empty($post_data['image']) ){\n $uploadFile = $post_data['image'];\n $img = explode(\"/\", $uploadFile);\n $imgName = end($img);\n }else{\n Library::logging('alert',\"API : setProfileImage : \".ERROR_INPUT.\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_INPUT, null);\n }\n \n $amazon = new AmazonsController();\n $amazonSign = $amazon->createsignatureAction($header_data,10);\n $url = $amazonSign['form_action'];\n $headers = array(\"Content-Type:multipart/form-data\"); // cURL headers for file uploading\n $ext = explode(\".\", $imgName);\n $extension = trim(end($ext));\n if( !in_array($extension, array(\"jpeg\", \"png\", \"gif\"))){\n $extension = \"jpeg\";\n }\n $postfields = array(\n \"key\" => \"profiles/\".$imgName,//$amazonSign[\"key\"],\n \"AWSAccessKeyId\" => $amazonSign[\"AWSAccessKeyId\"],\n \"acl\" => $amazonSign[\"acl\"],\n \"success_action_redirect\" => $amazonSign[\"success_action_redirect\"],\n \"policy\" => $amazonSign[\"policy\"],\n \"signature\" => $amazonSign[\"signature\"],\n \"Content-Type\" => \"image/$extension\",\n \"file\" => file_get_contents($uploadFile)\n );\n $ch = curl_init();\n $options = array(\n CURLOPT_URL => $url,\n //CURLOPT_HEADER => true,\n CURLOPT_POST => 1,\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_POSTFIELDS => $postfields,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true\n ); // cURL options\n curl_setopt_array($ch, $options);\n $imageName = curl_exec($ch);\n $result['image'] = FORM_ACTION.$imageName;\n curl_close($ch);\n if(is_string ( $imageName )){\n $user = Users::findById($header_data['id']);\n $user->profile_image = $imageName;\n if ($user->save() == false) {\n foreach ($user->getMessages() as $message) {\n $errors[] = $message->getMessage();\n }\n Library::logging('error',\"API : setProfileImage amazon controller : \".$errors.\" : user_id : \".$header_data['id']);\n Library::output(false, '0', $errors, null);\n } else {\n Library::output(true, '1', USER_PROFILE_IMAGE, $result );\n }\n }else{\n Library::logging('error',\"API : setProfileImage : \".ERROR_REQUEST.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n \n } catch (Exception $e) {\n Library::logging('error',\"API : setProfileImage : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n } \n }\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function postProjectImageUpload()\n\t{\n\t\t#Get project id\n\t\t$id = Input::get( \"id\" );\n\t\t$type = Input::get( \"type\" );\n\n\t\t#Move upload file\n\t\t$file = Input::file( 'file' );\n\t\t$file_name = $file->getClientOriginalName();\n\t\t$file_name = preg_replace( '/\\s+/', '', $file_name );\n\t\t$file->move( 'uploads/project_' . $this->_getTypeName( $type ), $file_name );\n\n\t\t//Store image to session\n\t\t$images_arr = Session::has( \"image[{$type}]\" ) ? Session::get( \"image[{$type}]\" ) : array();\n\t\t$image_item = array( 'image' => $file_name );\n\t\tarray_push( $images_arr, $image_item );\n\t\tSession::set( \"image[{$type}]\", $images_arr );\n\n\t\treturn $file_name;\n\t}", "private function home_marketplace_upload_attach(Request $request, $id) {\n Session::put('menu_item_parent', 'home');\n Session::put('menu_item_child', 'home_marketplace');\n Session::put('menu_item_child_child', '');\n $getfiles = $request->file('uploadedFileImage'); \n \n $fileName = $id.'.jpg'; \n \n SiteHelper::resizeAndUploadImage($getfiles,'HOMEMARKETPLACE',$fileName,[]);\n HomeMarketplace::find($id)->update(['image' => $fileName]);\n return \"true\";\n }", "function submitImage($userId){\n $target_dir = \"uploads/$userId/\"; //String interpolation is available this way in PHP, but not suggested\n createDirIfNeeded($target_dir);\n $target_file = $target_dir . basename($_FILES[\"fileToUpload\"][\"name\"]);\n $uploadOk = 1;\n $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));\n // Check if image file is a actual image or fake image\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n echo \"File is not an image.\";\n $uploadOk = 0;\n }\n }\n if ($uploadOk == 0) {\n echo \"Sorry, your file was not uploaded.\";\n // if everything is ok, try to upload file\n } else {\n if (move_uploaded_file($_FILES[\"fileToUpload\"][\"tmp_name\"], $target_file)) {\n echo \"The file \". basename( $_FILES[\"fileToUpload\"][\"name\"]). \" has been uploaded.\";\n } else {\n echo \"Sorry, there was an error uploading your file.\";\n }\n }\n }", "public function upload()\n{\n if(null === $this->getFile())\n {\n return;\n }\n\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n $this->filename =$this->getFile()->getClientOriginalName();\n\n $this->setFile(null);\n}", "function upload_image($img_name, $img_size, $tmp) {\n\n if ($img_size < 1024*1024*2) // size < 2MB\n {\n // emrit i shtohet nje nr random qe mos ngaterrohet\n $img_new_name = rand(00, 9999).strtolower(str_replace(' ', '-', $img_name));\n\n if (move_uploaded_file($tmp, SERVER_URL.'uploads/'.$img_new_name)) {\n chmod(SERVER_URL.'uploads/'.$img_new_name, 0666);\n echo '<p>The image was updated successfully</p>';\n\n return $img_new_name;\n }\n else {\n echo '<p>There was a problem during upload. Please try again.</p>';\n\n }\n }\n }", "public function make_a_photo()\n {\n $product = factory(Product::class, 1)->create();\n\n $file = new UploadedFile(\n 'C:\\Users\\Admin\\Projects\\whimsical\\storage\\test\\test_file.jpg',\n 'test_file.jpg',\n 'jpg',\n 'null',\n 'null',\n true\n );\n\n $this->assertTrue(file_exists($file->path()), 'Test file does not exist');\n\n $product->addPhoto($product, $file);\n\n }", "public function uploads() {\n $this->Authorization->authorize($this->Settings->newEmptyEntity(), 'create');\n if ($this->request->is(\"Ajax\")) {\n $is_dest = \"img/tmp/\";\n if (!file_exists($is_dest)) {\n //mkdir($is_dest, 0777, true);\n $dir = new Folder(WWW_ROOT . 'img/tmp/', true, 0755);\n $is_dest = $dir->path;\n }\n $fileData = $this->request->getData('file');\n if (strlen($fileData->getClientFilename()) > 1) {\n $ext = pathinfo($fileData->getClientFilename(), PATHINFO_EXTENSION);\n $allowedExt = array('gif', 'jpeg', 'png', 'jpg', 'tif', 'bmp', 'ico');\n if ($this->request->getData('allow_ext')) {\n $allowedExt = explode(\",\", $this->request->getData('allow_ext'));\n }\n if (in_array(strtolower($ext), $allowedExt)) {\n $upload_img = $fileData->getClientFilename();\n $ran = time();\n $upload_img = $ran . \"_\" . $fileData->getClientFilename();\n if (strlen($upload_img) > 100) {\n $upload_img = $ran . \"_\" . rand() . \".\" . $ext;\n }\n $upload_img = str_replace(' ', '_', $upload_img);\n $fileData->moveTo($is_dest . $upload_img);\n $data['filename'] = $upload_img;\n $data['image_path'] = $this->request->getAttribute(\"webroot\") . \"img/tmp/\" . $upload_img;\n $data['success'] = true;\n $data['message'] = \"file successfully uploaded!\";\n } else {\n $data['success'] = false;\n $data['message'] = \"invalid file type!\";\n }\n } else {\n $data['success'] = false;\n $data['message'] = \"invalid file!\";\n }\n }\n $this->set($data);\n $this->viewBuilder()->setOption('serialize', ['filename', 'image_path','success', 'message']);\n }", "public static function addImg($myId){\n if ($_FILES[\"pic\"][\"error\"] > 0) {\n echo \"Return Code: \" . $_FILES[\"pic\"][\"error\"] . \"<br>\";\n } else {\n$conn = init_db();\n$url = uniqid();\n$sql='insert into images (u_id, url, ups) values ('.$myId.', \\''.$url.'.jpg\\', 0)';\n$res = mysqli_query($conn,$sql) or die(mysqli_error($conn).'failed query:'.__LINE__);\n$dest = __DIR__.\"/../img/usr/\" . $url.'.jpg';\necho 'moved to '.$dest;\nmove_uploaded_file($_FILES[\"pic\"][\"tmp_name\"],\n $dest);\n}\n}", "abstract protected function doUpload();", "public function uploadImageSave($file_image) {\n if (!empty($file_image)) {\n $upload_folder = WWW_ROOT . \"files\" . DS . \"slide-app\";\n $upload_folder_specific = $upload_folder . DS;\n if (!is_dir($upload_folder)) {\n mkdir($upload_folder, 0755, true);\n }\n if (!is_dir($upload_folder_specific)) {\n mkdir($upload_folder_specific, 0755, true);\n }\n $tmp_file = WWW_ROOT . \"tmp\" . DS . $file_image;\n if (file_exists($tmp_file)) {\n $image = new File($tmp_file, true, 0755);\n $file_name = md5(time() + rand(0, 1000));\n $ext = $image->ext();\n $mime_type = $image->mime();\n $size = $image->size();\n $aft_file = $upload_folder_specific . DS . $file_name . \".\" . $ext;\n $image->copy($aft_file);\n array_map('unlink', glob(WWW_ROOT . \"tmp\" . DS . '*'));\n }\n }\n return $file_name . \".\" . $ext;\n }", "public function saveImageToUser($image, $user);", "public function store(ImageRequest $request)\n {\n $destination = 'images/';\n $image = $request->file('image');\n $file_name = time() . $image->getClientOriginalName();\n $image->move($destination, $file_name);\n Image::create([\n 'seller_id' => auth()->guard('seller')->user()->id,\n 'image' => $destination . $file_name\n ]);\n $request->session()->flash('message', 'image added successfully');\n return back();\n }", "public function save()\n {\n $this->validate();\n $this->validate(['image' => 'required|image']);\n\n // try to upload image and resize by ImageSaverController config\n try {\n $imageSaver = new ImageSaverController();\n $this->imagePath = $imageSaver->loadImage($this->image->getRealPath())->saveAllSizes();\n }catch (\\RuntimeException $exception){\n dd($exception);\n }\n\n $this->PostSaver();\n\n $this->resetAll();\n $this->ChangeCreatedMode();\n $this->swAlert([\n 'title' => 'Good job',\n 'text' => 'successfully added',\n 'icon' => 'success'\n ]);\n $this->render();\n }", "public function upload(UploadableInterface $image);", "public function store(UploadRequest $request)\n {\n $file = $request->file('image');\n $path = \"{$request->user()->id}/{$file->getClientOriginalName()}\";\n\n Storage::disk('s3')->put(\n $path,\n file_get_contents($file->getRealPath())\n );\n\n $image = $request->user()->images()->create([\n 'path' => $path\n ]);\n\n return response()->json([\n 'image' => $image->id,\n 'url' => 'dwa'\n ]);\n }", "private function UploadImage() {\n switch ($this->File->type):\n case 'image/jpg':\n case 'image/jpeg':\n case 'image/pjpeg':\n $this->Image = imagecreatefromjpeg($this->File->tempName);\n break;\n case 'image/png':\n case 'image/x-png':\n $this->Image = imagecreatefrompng($this->File->tempName);\n break;\n endswitch;\n\n if (!$this->Image):\n $this->Result = false;\n $this->Error = 'Tipo de arquivo inválido, envie imagens JPG ou PNG!';\n else:\n $x = imagesx($this->Image);\n $y = imagesy($this->Image);\n $ImageX = ( $this->Width < $x ? $this->Width : $x );\n $ImageH = ($ImageX * $y) / $x;\n\n $NewImage = imagecreatetruecolor($ImageX, $ImageH);\n imagealphablending($NewImage, false);\n imagesavealpha($NewImage, true);\n imagecopyresampled($NewImage, $this->Image, 0, 0, 0, 0, $ImageX, $ImageH, $x, $y);\n\n switch ($this->File->type):\n case 'image/jpg':\n case 'image/jpeg':\n case 'image/pjpeg':\n imagejpeg($NewImage, self::$BaseDir . $this->Send . $this->Name);\n break;\n case 'image/png':\n case 'image/x-png':\n imagepng($NewImage, self::$BaseDir . $this->Send . $this->Name);\n break;\n endswitch;\n\n if (!$NewImage):\n $this->Result = false;\n $this->Error = 'Tipo de arquivo inválido, envie imagens JPG ou PNG!';\n else:\n $this->Result = $this->Send . $this->Name;\n $this->Error = null;\n endif;\n\n imagedestroy($this->Image);\n imagedestroy($NewImage);\n endif;\n }", "public function upload()\n {\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'qualification');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->assign('code', $ret['data']);\n\t\t$this->assign('msg', $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->backgroundImage = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function storeImage($request, $fileKey, $fileName, $path) {\n\n if($request->hasFile($fileKey)){\n\n //get the file from the profile_image request...\n $image = $request->file($fileKey);\n\n //move the file to correct location\n $image->move($path, $fileName);\n\n }\n\n else {\n return false;\n }\n\n\n\n }", "public function upfile()\n {\n $accepted_origins = array(\"http://localhost\", \"http://192.168.82.130\", \"\");\n\n // Images upload path\n $imageFolder = \"./upload/image/\";\n\n reset($_FILES);\n $temp = current($_FILES);\n if (is_uploaded_file($temp['tmp_name'])) {\n if (isset($_SERVER['HTTP_ORIGIN'])) {\n // Same-origin requests won't set an origin. If the origin is set, it must be valid.\n if (in_array($_SERVER['HTTP_ORIGIN'], $accepted_origins)) {\n header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);\n } else {\n header(\"HTTP/1.1 403 Origin Denied\");\n return;\n }\n }\n\n $temp['name'] = str_replace(' ','',$temp['name']);\n $temp['name'] = str_replace('(','',$temp['name']);\n $temp['name'] = str_replace(')','',$temp['name']);\n\n // Sanitize input\n if (preg_match(\"/([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\).])|([\\.]{2,})/\", $temp['name'])) {\n header(\"HTTP/1.1 400 Invalid file name.\");\n return;\n }\n\n // Verify extension\n if (!in_array(strtolower(pathinfo($temp['name'], PATHINFO_EXTENSION)), array(\"gif\", \"jpg\", \"png\"))) {\n header(\"HTTP/1.1 400 Invalid extension.\");\n return;\n }\n\n // Accept upload if there was no origin, or if it is an accepted origin\n $filetowrite = $imageFolder . $temp['name'];\n move_uploaded_file($temp['tmp_name'], $filetowrite);\n\n $link = base_url('upload/image/'.$temp['name']);\n // Respond to the successful upload with JSON.\n echo json_encode(array('location' => $link));\n } else {\n // Notify editor that the upload failed\n header(\"HTTP/1.1 500 Server Error\");\n }\n }", "function upload_image_to_server(&$data, $key) {\n $target_dir = \"../../dashboard/img/\";\n $target_file = $key . \"-\" . $data['username'] . \".\" . image_get_extension($data[$key]);\n $target_uri = $target_dir . $target_file;\n\n if(check_image_not_exists($target_uri) && upload_image($data[$key], $target_uri))\n $data[$key] = $target_file;\n else\n $data[$key] = null;\n}", "public function uploadNewImageAction(Request $request)\n {\n $id = (int)$request->attributes->get('id');\n $userAttrs = $this->user->getAttributes();\n $result = array('isError' => 1, 'message' => \"Vous n'avez pas le droit d'exécuter cette action\");\n $isTest = (int)$request->attributes->get('test');\n $testResult = (int)$request->attributes->get('result');\n if($isTest == 1 && $testResult == 0)\n {\n $userAttrs = array('id' => (int)$request->attributes->get('user'));\n }\n elseif($isTest == 1 && $testResult == 1)\n {\n $userAttrs = array('id' => (int)$request->attributes->get('elUser1'));\n }\n $offerData = $this->enMan->getRepository('CatalogueOffersBundle:Offers')->getOfferData($id, (int)$userAttrs['id']);\n if(isset($offerData['id_of']) && $offerData['id_of'] == $id)\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 1), 200);\n }\n $images = $this->enMan->getRepository('CatalogueImagesBundle:OffersImages')->getImagesByOfferAndUser($id, $userAttrs['id']);\n $newName = 1;\n foreach($images as $image)\n {\n $part = explode('.', $image['imageName']);\n $newNameTmp = (int)$part[0] + 1;\n if($newNameTmp > $newName)\n {\n $newName = $newNameTmp;\n }\n }\n if(count($images) >= $this->config['images']['configuration']['offer']['maxImages'])\n {\n return $this->render('::frontend_ajax_error.html.php', array(\"text\" => \"Vous avez dépassé le nombre d'images pour cette offre\", \"id\" => \"error\".time(), \"class\" => \"autoGenerated\"));\n }\n $frontendHelper = new FrontendHelper();\n $ext = $frontendHelper->getFileExtension($_FILES['imageField']['name'], 'jpg|gif|jpeg|png');\n $options = array('maxSize' => $this->config['images']['maxSize'], 'extensions' => $this->config['images']['extensions'], \n 'files' => array('imageField'),\n 'required' => array(false),\n 'isUploadify' => true,\n 'names' => array($newName.'.'.$ext));\n $imgClass = new Image($options, $frontendHelper);\n if($imgClass->hasErrors == true) \n {\n $values = array($this->config['images']['extensions'], Tools::convertSize('b', 'mb', $options['maxSize']).' mb');\n $result['message'] = $imgClass->errors[0]['type']; //str_replace($this->config['images']['variables'], $values, $this->config['images']['messages'][$imgClass->errors[0]['type']]);\n $result['isError'] = 1;\n }\n else\n {\n $fileOptions = array('directory' => $this->config['images']['offersDir'].$id.'/',\n 'alias' => $this->config['images']['configuration']['offer']['prefix'],\n 'dimensions' => $this->config['images']['configuration']['offer']['dims'],\n 'ratio' => $this->config['images']['configuration']['offer']['ratio'],\n 'thumbs' => true);\n try\n {\n $imgClass->uploadFiles($fileOptions);\n $offerRef = $this->enMan->getReference('Catalogue\\OffersBundle\\Entity\\Offers', (int)$id);\n $oimEnt = new OffersImages();\n $oimEnt->setData(array('imageOffer' => $offerRef, 'imageName' => $newName.'.'.$ext, 'imageDate' => ''));\n $this->enMan->persist($oimEnt);\n $this->enMan->flush();\n $result['isError'] = 0;\n $result['fileName'] = $oimEnt->getImageName();\n return $this->render('CatalogueImagesBundle:Images:uploadTemporary.html.php', array('file' => $oimEnt->getImageName(),\n 'ticket' => $this->sessionTicket, 'dir' => $this->config['view']['dirs']['offersImg'].$id, 'id' => $oimEnt->getIdOi(), 'route' => 'offersImagesDelete'));\n }\n catch(Exception $e)\n {\n $result['isError'] = 1;\n $result['message'] = $this->config['messages']['errorGeneral'];\n $logger->debug(sprintf('[IMGERROR] Error during image upload. Catched exception : %s', $e->getMessage()));\n }\n }\n }\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 0), 200);\n }\n if($result['isError'] == 1) \n {\n return $this->render('::frontend_ajax_error.html.php', array(\"text\" => $result['message'], \"id\" => \"error\".time(), \"class\" => \"autoGenerated\"));\n }\n }", "public function upload($oldUrl = null) {\n if (null === $this->file) {\n return;\n }\n\n if (null !== $oldUrl) unlink ($this->getUploadRootDir() . \"/../..\" . $oldUrl);\n\n $timestamp = time();\n\n // On récupère le nom original du fichier de l'internaute\n $name = $this->file->getClientOriginalName();\n\n // On déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move($this->getUploadRootDir(), $name);\n rename($this->getUploadRootDir().\"/\" . $name, $this->getUploadRootDir() . \"/\" . $timestamp . \"_\" . $name);\n\n // On sauvegarde le nom de fichier dans notre attribut $url\n $this->url = \"/\" . $this->getUploadDir() . \"/\" . $timestamp . \"_\" . $name;\n\n\n // On crée également le futur attribut alt de notre balise <img>\n $this->alt = $name;\n }", "public function storeimage(Request $request)\n {\n $this->authorize('isAdmin');\n if($request->file('file'))\n {\n $image = $request->file('file');\n $name = \"ortm_\".time().'.'.$image->getClientOriginalExtension();\n\n $thumbnailImage = Images::make($image)->resize(200, 200)->save(public_path('/img/ourteam/thumbs/' . $name));\n\n $watermark = Images::make(public_path('/img/watermark.png'));\n $Image = Images::make($image)->insert($watermark, 'bottom-right', 10, 10)->save(public_path('/img/ourteam/' . $name));\n\n //$image->move(public_path().'/img/social/', $name);\n }\n\n $image= new Image();\n $image->image_name = $name;\n $image->save();\n\n return response()->json([\n 'data' => $name\n ], 200);\n }", "public function images_upload()\n\t{\n\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\tif ( !array_key_exists( 'File', $args ) ) {\n\t\t\tthrow new PhpSmugException( 'No upload file specified.' );\n\t\t}\n\t\t\n\t\t// Set FileName, if one isn't provided in the method call\n\t\tif ( !array_key_exists( 'FileName', $args ) ) {\n\t\t\t$args['FileName'] = basename( $args['File'] );\n\t\t}\n\n\t\t// Ensure the FileName is phpSmug::urlencodeRFC3986 encoded - caters for stange chars and spaces\n\t\t$args['FileName'] = phpSmug::urlencodeRFC3986( $args['FileName'] );\n\n\t\t// OAuth Stuff\n\t\tif ( $this->OAuthSecret ) {\n\t\t\t$sig = $this->generate_signature( 'Upload', array( 'FileName' => $args['FileName'] ) );\n\t\t}\n\t\t\n\t\tif ( is_file( $args['File'] ) ) {\n\t\t\t$fp = fopen( $args['File'], 'r' );\n\t\t\t$data = fread( $fp, filesize( $args['File'] ) );\n\t\t\tfclose( $fp );\n\t\t} else {\n\t\t\tthrow new PhpSmugException( \"File doesn't exist: {$args['File']}\" );\n\t\t}\n\n\t\t// Create a new object as we still need the other request object\n\t\t$upload_req = new httpRequest();\n $upload_req->setMethod( 'PUT' );\n\t\t$upload_req->setConfig( array( 'follow_redirects' => TRUE, 'max_redirects' => 3, 'ssl_verify_peer' => FALSE, 'ssl_verify_host' => FALSE, 'connect_timeout' => 60 ) );\n\t\t$upload_req->setAdapter( $this->adapter );\n\t\t\n\t\t// Set the proxy if one has been set earlier\n\t\tif ( isset( $this->proxy ) && is_array( $this->proxy ) ) {\n\t\t\t$upload_req->setConfig(array('proxy_host' => $this->proxy['server'],\n\t\t\t\t\t\t\t 'proxy_port' => $this->proxy['port'],\n\t\t\t\t\t\t\t\t\t 'proxy_user' => $this->proxy['user'],\n\t\t\t\t\t\t\t\t\t 'proxy_password' => $this->proxy['password']));\n\t\t}\n\n\t\t$upload_req->setHeader( array( 'User-Agent' => \"{$this->AppName} using phpSmug/\" . phpSmug::$version,\n\t\t\t\t\t\t\t\t\t 'Content-MD5' => md5_file( $args['File'] ),\n\t\t\t\t\t\t\t\t\t 'Connection' => 'keep-alive') );\n\n\t\tif ( $this->loginType == 'authd' ) {\n\t\t\t$upload_req->setHeader( 'X-Smug-SessionID', $this->SessionID );\n\t\t} else {\n\t\t\t$upload_req->setHeader( 'Authorization', 'OAuth realm=\"http://api.smugmug.com/\",'\n\t\t\t\t.'oauth_consumer_key=\"'.$this->APIKey.'\",'\n\t\t\t\t.'oauth_token=\"'.$this->oauth_token.'\",'\n\t\t\t\t.'oauth_signature_method=\"'.$this->oauth_signature_method.'\",'\n\t\t\t\t.'oauth_signature=\"'.urlencode( $sig ).'\",'\n\t\t\t\t.'oauth_timestamp=\"'.$this->oauth_timestamp.'\",'\n\t\t\t\t.'oauth_version=\"1.0\",'\n\t\t\t\t.'oauth_nonce=\"'.$this->oauth_nonce.'\"' );\n\t\t}\n\t\t\t\n\t\t$upload_req->setHeader( array( 'X-Smug-Version' => $this->APIVer,\n\t\t\t\t\t\t\t\t\t 'X-Smug-ResponseType' => 'PHP',\n\t\t\t\t\t\t\t\t\t 'X-Smug-AlbumID' => $args['AlbumID'],\n\t\t\t\t\t\t\t\t\t 'X-Smug-Filename'=> basename($args['FileName'] ) ) ); // This is actually optional, but we may as well use what we're given\n\t\t\n\t\t/* Optional Headers */\n\t\tforeach( $args as $arg => $value ) {\n\t\t\tif ( $arg == 'File' ) continue;\n\t\t\t$upload_req->setHeader( 'X-Smug-' . $arg, $value );\n\t\t}\n\n\t\t//$proto = ( $this->oauth_signature_method == 'PLAINTEXT' || $this->secure ) ? 'https' : 'http';\t// No secure uploads at this time.\n\t\t//$upload_req->setURL( $proto . '://upload.smugmug.com/'.$args['FileName'] );\n\t\t$upload_req->setURL( 'http://upload.smugmug.com/'.$args['FileName'] );\n\t\t$upload_req->setBody( $data );\n\n //Send Requests \n\t\t$upload_req->execute();\n\t\t\n\t\t$this->response = $upload_req->getBody();\n\t\t\n\t\t// For some reason the return string is formatted with \\n and extra space chars. Remove these.\n\t\t$replace = array( '\\n', '\\t', ' ' );\n\t\t$this->response = str_replace( $replace, '', $this->response );\n\t\t$this->parsed_response = unserialize( trim( $this->response ) );\n\t\t\n\t\tif ( $this->parsed_response['stat'] == 'fail' ) {\n\t\t\t$this->error_code = $this->parsed_response['code'];\n $this->error_msg = $this->parsed_response['message'];\n\t\t\t$this->parsed_response = FALSE;\n\t\t\tthrow new PhpSmugException( \"SmugMug API Error for method image_upload: {$this->error_msg}\", $this->error_code );\n\t\t} else {\n\t\t\t$this->error_code = FALSE;\n $this->error_msg = FALSE;\n\t\t}\n\t\treturn $this->parsed_response ? $this->parsed_response['Image'] : FALSE;\n\t}", "public function step_2_manage_upload()\n {\n }", "function uploadAccomodationDemandDraftImage(UploadTicketRequest $request){\n if(!Auth::user()->needApproval()){\n Session::flash('success', 'Sorry! Your Payment will be done by one of your team leaders');\n return redirect()->route('user_pages.dashboard'); \n }\n $extension = $request->file('demand_draft')->getClientOriginalExtension();\n $filename = 'demand_draft_acc_' . Auth::user()->id . '.' . $extension;\n $payment = Auth::user()->accomodation;\n $request->file('demand_draft')->move('uploads/Accomodation/demand_draft', $filename);\n $payment->acc_file_name = $filename;\n $payment->acc_status='nack';\n $payment->acc_mode_of_payment='dd';\n $payment->acc_payment_status='notpaid';\n $payment->acc_amount=Payment::getAccomodationAmount();\n $payment->user_id=Auth::User()->id;\n \n $payment->save();\n //Auth::user()->doPaymentDD($filename);\n Session::flash('success', 'Your demand draft was uploaded');\n return redirect()->route('user_pages.hospitality');\n }", "public function upload()\n {\n\n if (null == $this->fichier)\n {\n return;\n }\n\n if ($this->oldFichier)\n {\n // suppression de l'ancienne image\n if (file_exists($this->getUploadRootDir() . '/' . $this->oldFichier))\n {\n unlink($this->getUploadRootDir() . '/' . $this->oldFichier);\n }\n\n\n // suppression des anciens thumbnails\n foreach ($this->thumbnails as $key => $thumbnail)\n {\n if (file_exists($this->getUploadRootDir() . '/' . $key . '-' . $this->oldFichier))\n {\n unlink($this->getUploadRootDir() . '/' . $key . '-' . $this->oldFichier);\n }\n\n }\n }\n\n //$date = new \\DateTime('now');\n\n //$nameImage = $date->format('YmdHis') . '-' . $this->fichier->getClientOriginalName();\n //$extension = $this->fichier->guessExtension();\n //$nameImage = str_replace(' ', '-', $this->alt) . uniqid();\n\n // move (param 1 chemin vers dossier, param 2 nom image)\n\n //$this->name = $nameImage . \".\" . $extension;\n\n $this->fichier->move(\n $this->getUploadRootDir(),\n $this->name\n //$nameImage . \".\" . $extension\n );\n\n //$imagine = new \\Imagine\\Gd\\Imagine();\n\n /*$imagine\n ->open($this->getAbsolutePath())\n ->thumbnail(new \\Imagine\\Image\\Box(350, 160))\n ->save(\n $this->getUploadRootDir().'/' .\n $nameImage . '-thumb-small.' . $extension);*/\n\n $imagine = new \\Imagine\\Gd\\Imagine();\n $imagineOpen = $imagine->open($this->getAbsolutePath());\n\n foreach ($this->thumbnails as $key => $thumbnail)\n {\n $size = new \\Imagine\\Image\\Box($thumbnail[0], $thumbnail[1]);\n $mode = \\Imagine\\Image\\ImageInterface::THUMBNAIL_INSET;\n \n $imagineOpen->thumbnail($size, $mode)\n ->save($this->getUploadRootDir() . '/' . $key . '-' . $this->name);\n }\n }", "public function store(Request $request)\n {\n\n $image = time().'.'.$request->img->extension();\n\n $request->img->move(public_path('images'), $image);\n\n\n Image::create([\n 'title'=>$request['title'],\n 'desc'=>$request['desc'],\n 'img'=>$image,\n\n\n ]);\n\n return redirect()->route('image.index')->with('success','successfully done');\n\n }", "public function upload_img()\r\n {\r\n if(!is_dir('./uploads/groups'))mkdir(('./uploads/groups')); \r\n if (!empty($_FILES)) \r\n { \r\n $tempFile = $_FILES['file']['tmp_name']; \r\n\r\n $file_info = explode('.',$_FILES['file']['name']);\r\n $file_ext = $file_info[1];\r\n\r\n $targetPath = './uploads/groups'; \r\n\r\n $newFile = time().'.'.$file_ext;\r\n \r\n $targetFile = $targetPath.$newFile; \r\n \r\n move_uploaded_file($tempFile,$targetFile); \r\n\r\n $this->output->set_output(json_encode($newFile));\r\n }\r\n }", "public function uploadImage()\n {\n if ((isset($_FILES['image']['name']))\n && (!empty($_FILES['image']['name']))\n ) {\n try {\n $uploader = new Varien_File_Uploader('image');\n $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));\n $uploader->setAllowRenameFiles(FALSE);\n $uploader->setFilesDispersion(FALSE);\n $path = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'slidermanager';\n $uploader->save($path, $_FILES['image']['name']);\n\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')\n ->addError($e->getMessage());\n }\n\n return $_FILES['image']['name'];\n }\n\n return '';\n }", "public function imageUploadPost(Request $request)\n {\n \n $id = $request['id'];\n $imageName = time().'.'.$request->image->extension(); \n $request->image->move(public_path('images'), $imageName);\n $new_photo = \"/images/\".$imageName;\n $new_image = Blog::find($id);\n $new_image->img = $new_photo;\n $new_image->save();\n \n return redirect()->back()->withSuccess('Фото акции успешно добавлено');\n\n }", "public function uploadImage()\n {\n if($this->thumbnail){\n //hashing name of image by md5\n $name = md5(time().$this->thumbnail->baseName);\n $this->thumbnail->saveAs('upload/post/'.$name.'.'.$this->thumbnail->extension);\n $this->thumbnail = $name.'.'.$this->thumbnail->extension;\n return true;\n }else{\n return false;\n }\n }", "function media_bynder_submit_mob(&$form, &$form_state) {\n $id = media_bynder_parameter($_POST, 'id');\n $idHash = media_bynder_parameter($_POST, 'idHash');\n\n $redirect = 'media_bynder_add';\n\n $result = media_bynder_save_image($id, $idHash, $form);\n if(!$result['success']){\n echo '{\"success\": 0, \"type\": \"error\", \"message\": \"' . $result['message'] . '\"}';\n }else{\n echo '{\"success\": 1, \"type\": \"success\", \"message\": \"' . t($result['message']) . '\"}';\n }\n exit;\n}" ]
[ "0.6708627", "0.6414703", "0.63920164", "0.63920164", "0.63920164", "0.63920164", "0.63920164", "0.63920164", "0.6367539", "0.6367539", "0.6361794", "0.6354018", "0.6335886", "0.6326576", "0.6317613", "0.6305418", "0.6300573", "0.62887806", "0.62669593", "0.62623256", "0.6249463", "0.6187828", "0.6170274", "0.61654884", "0.6131347", "0.61070436", "0.6087645", "0.60861033", "0.6062923", "0.6053883", "0.60124373", "0.601072", "0.59986824", "0.599755", "0.59965086", "0.5989937", "0.59828466", "0.5966271", "0.59649825", "0.5959638", "0.5954748", "0.59467906", "0.5945338", "0.5941882", "0.5921706", "0.59206444", "0.5913029", "0.5908953", "0.59088814", "0.59021044", "0.5895796", "0.5886314", "0.58854735", "0.5883934", "0.5883463", "0.5881304", "0.5877817", "0.58770794", "0.5874863", "0.58735484", "0.5869049", "0.58683264", "0.58628607", "0.586233", "0.58611447", "0.58575857", "0.5851831", "0.5849273", "0.5837711", "0.5834746", "0.5829182", "0.5827821", "0.5815668", "0.5813524", "0.5813221", "0.5812815", "0.58081186", "0.5803961", "0.5799629", "0.5795248", "0.5789444", "0.5785383", "0.5776215", "0.577478", "0.5773637", "0.57732886", "0.57726353", "0.57571614", "0.5749807", "0.57354134", "0.57337695", "0.5721664", "0.5720504", "0.57201743", "0.5712329", "0.5709281", "0.57065254", "0.57010746", "0.5700722", "0.569762", "0.5697251" ]
0.0
-1
Delete a temporary file from sandbox and only sandbox
public function deleteAction(Request $request) { $path = $request->query->get('path'); try { $this->get('event_dispatcher')->dispatch(Events::TEMPORARY_FILE_DELETED_EVENT, new TemporaryFileDeletedEvent($path)); } catch (\Exception $e) { return new JsonResponse(array( 'errors' => $e->getMessage(), ), 400); } return new JsonResponse(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function deleteTempFile() {\n if ($this->datastreamInfo['content']['type'] == 'file' && $this->copied == TRUE) {\n unlink($this->datastreamInfo['content']['content']);\n }\n }", "private function deleteTemporaryFiles()\n {\n foreach ($this->temp as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n\n $this->temp = [];\n }", "public function unlinkTempFiles() {}", "public function unlinkTempFiles() {}", "function cleanTmpfile($tempfile) {\n\t\tif (file_exists($tempfile)) {\n\t\t\tunlink($tempfile);\n\t\t}\n\t}", "function deleteTemp () : void {\n\tforeach(glob(_ROOT_PATH.'temp/*') as $file){\n\t\tunlink($file);\n\t}\n}", "public static function _removeTmpFiles()\n {\n if (count($GLOBALS['_System_temp_files'])) {\n $delete = $GLOBALS['_System_temp_files'];\n array_unshift($delete, '-r');\n System::rm($delete);\n $GLOBALS['_System_temp_files'] = array();\n }\n }", "public function removeTemporaryFiles()\n {\n foreach ($this->temporaryFiles as $file) {\n $this->unlink($file);\n }\n }", "public function delete_local_file()\n\t{\n\t\tif(file_exists($this->local_file)) {\n\t\t\t$this->upload_local_file();\n\t\t\tunlink($this->local_file);\n\t\t}\n\t\t$this->local_file = null;\n\t}", "public function actionCleartemp()\n {\n $uploadPath = '../web/web_mat/temp/';\n $file = scandir($uploadPath);\n foreach ($file as $key => $value) {\n if ($key >= 2) {\n unlink($uploadPath . $value);\n }\n }\n }", "function cleanTemporaryDirectory($tmpTopdir, $tmpdir, $tmpfile)\n{\n global $tmpCreated;\n $deletedir = NULL;\n\n /* if this script created tmp directory, delete tmp directory */\n if ($tmpCreated) {\n $deleteDir = $tmpTopdir;\n } else {\n $deleteDir = $tmpdir;\n unlink($tmpfile);\n }\n\n deleteDirectory($deleteDir);\n}", "public function deleteTemp()\n {\n $list=collect(Storage::disk(config('lopsoft.temp_disk'))->listContents(config('lopsoft.temp_dir'), true))\n\t ->each(function($file) {\n\t\t if ($file['type'] == 'file' && $file['timestamp'] < now()->subDays(config('lopsoft.garbagecollection_days'))->getTimestamp()) {\n\t\t\t Storage::disk(config('lopsoft.temp_disk'))->delete($file['path']);\n\t\t }\n });\n }", "public function testRemoveDummyTestFileAfterDoneTest()\n {\n unlink(TESTING_STORE);\n\n // boolean result must be === false\n $this->assertFalse(file_exists(TESTING_STORE));\n }", "function cache_classes_DestroyContentFile($content_file_path=NULL)\n{\n $filepath = POPS_SYSTEM_PATH.'tmp/'.session_id().'.tmp.php';\n if ( $content_file_path!==NULL ) {\n $filepath = $content_file_path;\n }\n // try to delete file\n if (file_exists($filepath) ) {\n unlink($filepath);\n }\n}", "function deleteFile() {\r\n\t\tif (file_exists($this->data[$this->alias]['path'])) {\r\n\t\t\tunlink($this->data[$this->alias]['path']);\r\n\t\t}\r\n\t}", "static function deleteFiles($pool) {\n $path = JPATH_COMPONENT.DS.\"data\".DS.$pool;\n system(\"rm -rf \".$path);\n $path = JPATH_COMPONENT.DS.\"private\".DS.$pool;\n system(\"rm -rf \".$path);\n }", "public function unlinkTempFiles()\n {\n $typo3temp = PATH_site . 'typo3temp/';\n foreach (glob($typo3temp . $this->tempFilePrefix . '*') as $tempFile) {\n @unlink($tempFile);\n }\n }", "public function removeTempFiles()\n {\n $this->removeDir($this->context['temp_dir']);\n }", "public function removeTemporary();", "public function testInvalidAccessReaction()\n {\n $this->createTestInstance()->removeTemporaryFile('nonexistent');\n }", "function DeleteTempQRCode($fileName){\r\n\treturn unlink($fileName);\r\n}", "function temporaryFile($name, $content)\n{\n $file = trim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) .\n DIRECTORY_SEPARATOR .\n ltrim($name, DIRECTORY_SEPARATOR);\n\n file_put_contents($file, $content);\n\n register_shutdown_function(function() use($file) {\n unlink($file);\n });\n\n return $file;\n}", "public function cleanTmpFolder() {\n\t\tarray_map('unlink', glob($this->settings->tmp_path . '/*'));\n\t}", "function eraseTempDir() {\n FileSystem::removeDirectory($this->getTestDir(), true);\n $this->testDir = null;\n }", "public function testDeleteRemovesStorages()\n {\n file_put_contents(self::$temp.DS.'file1.txt', 'Hello World');\n\n Storage::delete(self::$temp.DS.'file1.txt');\n $this->assertTrue(! is_file(self::$temp.DS.'file1.txt'));\n }", "private function clearTemporaryFiles($usertempdir)\n\t{\n\t\tif (file_exists($usertempdir))\n\t\t{\n\t\t\t$handle=opendir($usertempdir);\n\t\t\n\t\t\twhile (($file = readdir($handle))!==false)\n\t\t\t{\n\t\t\t\t@unlink($usertempdir.'/'.$file);\n\t\t\t}\n\t\t\n\t\t\tclosedir($handle);\n\t\t}\n\t}", "static public function delete_local_file() {\n\t\t$option_value = (int) get_option( 'azure_storage_keep_local_file', 0 );\n\n\t\treturn ( 0 === $option_value );\n\t}", "function deleteFile($hash);", "public function __destruct() {\n\t\tif(isset($this->tmpPath) && file_exists($this->tmpPath)) {\n\t\t\tunlink($this->tmpPath);\n\t\t}\n\t}", "public function cleanTempFiles()\n\t{\n\t\t$manifestData = $this->_getManifestData();\n\n\t\tforeach ($manifestData as $row)\n\t\t{\n\t\t\tif (UpdateHelper::isManifestVersionInfoLine($row))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$rowData = explode(';', $row);\n\n\t\t\t// Delete any files we backed up.\n\t\t\t$backupFilePath = IOHelper::normalizePathSeparators(blx()->path->getAppPath().$rowData[0].'.bak');\n\n\t\t\tif (($file = IOHelper::getFile($backupFilePath)) !== false)\n\t\t\t{\n\t\t\t\tBlocks::log('Deleting backup file: '.$file->getRealPath(), \\CLogger::LEVEL_INFO);\n\t\t\t\t$file->delete();\n\t\t\t}\n\t\t}\n\n\t\t// Delete the temp patch folder\n\t\tIOHelper::deleteFolder($this->_unzipFolder);\n\n\t\t// Delete the downloaded patch file.\n\t\tIOHelper::deleteFile($this->_downloadFilePath);\n\t}", "public function __destruct() {\n if (file_exists($this->tempFile)) {\n unlink($this->tempFile);\n }\n }", "public function file_delete($filename);", "private function clear()\n {\n unlink($this->getConfig()->read('tmp_dir') . Evaluator::FILENAME);\n rmdir($this->getConfig()->read('tmp_dir'));\n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "private function cleanTmp()\n {\n // cleanup files in tmp\n $dir = ELAB_ROOT . '/uploads/tmp';\n $di = new \\RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);\n $ri = new \\RecursiveIteratorIterator($di, \\RecursiveIteratorIterator::CHILD_FIRST);\n foreach ($ri as $file) {\n $file->isDir() ? rmdir($file) : unlink($file);\n }\n }", "private function createTemporaryFile()\n {\n return $this->temp[] = tempnam(sys_get_temp_dir(), 'sqon-');\n }", "function delete_file($file) {\n return @unlink($file);\n}", "function delete_file($file) {\n\treturn @unlink($file);\n}", "protected function createTempFile()\n {\n $tempFile = GeneralUtility::tempnam($this->tempFilePrefix);\n\n if (!$this->isRegisteredShutdownFunction) {\n register_shutdown_function([$this, 'unlinkTempFiles']);\n $this->isRegisteredShutdownFunction = true;\n }\n\n return $tempFile;\n }", "public function tearDown(): void\n {\n if (is_dir($this->tmpPath)) {\n if (file_exists($this->oldFile)) {\n unlink($this->oldFile);\n }\n if (file_exists($this->origFile)) {\n unlink($this->origFile);\n }\n if (file_exists($this->newFile)) {\n unlink($this->newFile);\n }\n if (is_dir($this->newDir)) {\n if (file_exists($this->newDirFile)) {\n unlink($this->newDirFile);\n }\n rmdir($this->newDir);\n }\n rmdir($this->tmpPath);\n }\n }", "public function testDeleteFile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function deleteRawFile() {\n if (!$this->rawfiledeleted && !is_null($this->config_dir)) {\n $file_name = config('app.' . $this->config_dir) . $this->name;\n if (file_exists($this->relativepath)) {\n unlink($this->relativepath);\n $this->rawfiledeleted = true;\n $this->save();\n }\n }\n }", "public function __destruct()\n {\n if (file_exists($this->filename)) {\n unlink($this->filename);\n }\n\n foreach ($this->tempFiles as $file) {\n $this->filesystem->remove($file);\n }\n }", "public function delete()\n {\n $filesystem = $this->localFilesystem(dirname($this->path));\n\n method_exists($filesystem, 'deleteDir')\n ? $filesystem->deleteDir(basename($this->path))\n : $filesystem->deleteDirectory(basename($this->path));\n }", "function unlink_rollback_file($server_cfg,$game_name,$pool_name){\n\t$fast_rollback_target = sprintf($server_cfg['config_directory'],$game_name);\n $fast_rollback_target = $fast_rollback_target . $pool_name.\"_rollback.sh\";\n\n\tif(file_exists($fast_rollback_target)){\n\t\tif(!unlink($fast_rollback_target))\n\t\t\tdie(\"Unable to clear the rollback script file $fast_rollback_target. Terminating.\\n\");\n\t}\n}", "public static function cleanTempStorage() {\n unset($_SESSION[self::$appSessionName][self::$storageName]);\n }", "public function delete($filename);", "function deleteFile($uuid) {\r\n $sql = '\r\n DELETE FROM\r\n files\r\n WHERE\r\n uuid = ?\r\n ';\r\n\r\n return $this->query_exec($sql, array($uuid));\r\n }", "public function delete_temp($local_temp){\r\n\t\tforeach(scandir($local_temp) as $old_file) {\r\n\t\t\tif ('.' === $old_file || '..' === $old_file) continue;\r\n\t\t\tif (is_dir(\"$local_temp/$old_file\")) rmdir_recursive(\"$local_temp/$old_file\");\r\n\t\t\telse unlink(\"$local_temp/$old_file\");\r\n\t\t}\r\n\t\trmdir($local_temp);\r\n\t}", "static public function deleteFile($file = false) {\n\n if ($file)\n unlink($file);\n else\n unlink($this->filePath);\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public static function cleanupTempFolder(){\r\n\t\t$files = glob($_SERVER[\"DOCUMENT_ROOT\"] . \"/tmp/*\");\r\n\t\t$now = time();\r\n\r\n\t\tforeach($files as $file){\r\n\t\t\tif(is_file($file) && basename($file) != \".keep\"){\r\n\t\t\t\tif($now - filemtime($file) >= 60*60*24){\r\n\t\t\t\t\tunlink($file);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function delete_tmp_folder_content()\n{\n\t$baseDir = '../backups/tmp/';\n\t$files = scandir($baseDir);\n\tforeach ($files as $file) \n\t{\n\t\tif ( ($file != '.') && ($file != '..') && ($file != '.htaccess') ) \n\t\t{\n\t\t\tif ( is_dir($baseDir . $file) ) recursive_deletion($baseDir.$file.'/');\n\t\t\telse unlink('../backups/tmp/' . $file);\n\t\t}\n\t}\n}", "private function delete_file($file){\n\t\t$fileLink = fopen($file,'w');\n\t\tfclose($fileLink);\n\t\tunlink($file);\n\t}", "public function testUnlink()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n\n file_put_contents($filename, 'It works!');\n $this->assertTrue(file_exists($filename));\n\n $this->assertTrue(unlink($filename));\n\n clearstatcache();\n $this->assertFalse(file_exists($filename));\n }", "function remove_temp_files() {\n\t\n\tif(!class_exists(FilterIterator) && !class_exists(RecursiveDirectoryIterator)) return;\n\tclass TempFilesFilterIterator extends FilterIterator {\n\t\tpublic function accept() {\n\t\t\t$fileinfo = $this->getInnerIterator()->current();\n\t\t\tif(preg_match('/temp_.*/', $fileinfo)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\t$iterator = new RecursiveDirectoryIterator(__CHV_FOLDER_IMAGES__); // PHP > 5.3 flag: FilesystemIterator::SKIP_DOTS\n\t$iterator = new TempFilesFilterIterator($iterator);\n\tforeach ($iterator as $file) {\n\t\tunlink($file->getPathname());\n\t}\n}", "public function destroy()\n\t{\n\t\treturn @unlink($this->filename);\n\t}", "public function ClearTemp()\r\n\t{\r\n\t\treturn $this->RemovedOldFiles(\r\n\t\t\t\t\\Cmp3\\Cmp3::$TempPath,\r\n\t\t\t\tfalse,\r\n\t\t\t\t'temp');\r\n\t}", "public static function removeTempDir()\n {\n $tmpDir = self::getTempDir();\n\n array_map('unlink', glob(\"$tmpDir/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*/*/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*/*/*/*.*\"));\n array_map('rmdir', glob(\"$tmpDir/*/*/*/*\", GLOB_ONLYDIR));\n array_map('rmdir', glob(\"$tmpDir/*/*/*\", GLOB_ONLYDIR));\n array_map('rmdir', glob(\"$tmpDir/*/*\", GLOB_ONLYDIR));\n array_map('rmdir', glob(\"$tmpDir/*\", GLOB_ONLYDIR));\n is_dir($tmpDir) and rmdir($tmpDir);\n }", "private function removeTmpPermissions(): void\n {\n $phpVersion = getenv('PHP_VERSION');\n $phpVersion = $phpVersion === false ? '74' : str_replace('.', '', $phpVersion);\n\n $chmod = new Process([\n 'docker',\n 'run',\n '--rm',\n '-v',\n self::LOCAL_TMP_DIRECTORY . ':/tmp',\n '--entrypoint=bash',\n 'bref/php-' . $phpVersion,\n '-c',\n 'chmod -R 777 /tmp',\n ]);\n $chmod->mustRun();\n }", "public function unlink($file);", "public function __destruct()\n {\n if($this->_gc_temp_files === true && empty($this->_tmp_files) === false)\n {\n foreach ($this->_tmp_files as $path)\n {\n if(is_file($path) === true)\n {\n @unlink($path);\n }\n }\n }\n }", "public function delete() {\n $result = $this->getFileSystem()->delete($this->getLocalPath());\n if (!$result) {\n // Inform the user if the file could not be deleted\n //File xxx could not be deleted.\n }\n\n return $result;\n }", "public function testUnlinkNonExistingFile()\n {\n $this->assertFalse(unlink(static::$baseFile . '/fs/tmp.txt'));\n }", "public function __destruct()\n {\n if (file_exists($this->tempFilesFromFilename)) {\n unlink($this->tempFilesFromFilename);\n }\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 temporary(Storage_Model_File $model)\n {\n if( substr($model->storage_path, 0, strlen($this->_bucket)) == $this->_bucket ) {\n $path = $model->storage_path;\n } else {\n $path = $this->_bucket . '/' . $model->storage_path;\n }\n \n try {\n $rfh = fopen($this->_streamWrapperName . '://' . $path, 'r');\n } catch( Exception $e ) {\n throw $e;\n }\n \n $tmp_file = APPLICATION_PATH . '/public/temporary/' . basename($model['storage_path']);\n $fp = fopen($tmp_file, \"w\");\n stream_copy_to_stream($rfh, $fp);\n fclose($fp);\n @chmod($tmp_file, 0777);\n return $tmp_file;\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function teardown()\n {\n if ($this->csvFile) {\n unlink($this->csvFile);\n $this->csvFile = null;\n }\n\n if ($this->photoZip) {\n unlink($this->photoZip);\n $this->photoZip = null;\n }\n }", "function configurationDeleteFile($fileToDelete){\n\n\t\tif (file_exists($_SERVER['DOCUMENT_ROOT'].'/uploads/' . $fileToDelete))\n\t\t\t{\n\t\t\tunlink($_SERVER['DOCUMENT_ROOT'].'/uploads/' . $fileToDelete);\n\t\t\t}\t\t\t\t\n\t}", "protected function cleanup()\n {\n foreach ($this->temp_files as $file) {\n $this->filesystem->remove($file);\n }\n $this->temp_files = [];\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_file(){\n if($this->file_name != 'sample.jpg'){\n unlink($this->dir_location . $this->file_name);\n }\n }", "public function temp_gc()\n {\n $tmp = unslashify($this->config->get('temp_dir'));\n $expire = mktime() - 172800; // expire in 48 hours\n\n if ($dir = opendir($tmp)) {\n while (($fname = readdir($dir)) !== false) {\n if ($fname{0} == '.') {\n continue;\n }\n\n if (filemtime($tmp.'/'.$fname) < $expire) {\n @unlink($tmp.'/'.$fname);\n }\n }\n\n closedir($dir);\n }\n }", "function cleanupTmp() {\n // try to delete all the tmp files we know about.\n foreach($this->tmpFilesCreated as $file) {\n if(file_exists($file)) {\n $status = unlink($file);\n }\n }\n $this->tmpFilesCreated = array();\n // try to completely delete each directory we created.\n $dirs = array_reverse($this->tmpDirsCreated);\n foreach($dirs as $dir) {\n if(file_exists($dir)) {\n $this->recursiveRmdir($dir);\n }\n }\n $this->tmpDirsCreated = array();\n }", "public static function reset()\n {\n return \\File::delete(storage_path('app/public/nota/testNota.xml'));\n }", "public function removeTempFiles()\n {\n parent::removeTempFiles();\n $this->removeDir($this->cacheDir(\"upgrades/driver/\"));\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 }", "function removeLockFile($file=null){\n $lockFile = ($file!='') ? $file : LOCKFILE;\n if(file_exists($lockFile))\n unlink($lockFile);\n}", "public function __destruct()\n\t{\n\t\t$this->delete_local_file();\n\t}", "public function destroy(){\n\t\t\tif($this->delete()){\n\t\t\t\t//2.Remove the file\n\t\t\t\tif(!unlink($this->path()))\n\t\t\t\t{\n\t\t\t\t\t//$_SESSION[\"message\"]=$this->path();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function deleteDownloadFile()\r\n\t{\r\n\t\t@unlink($this->reference);\r\n\t}", "abstract function delete_file($filepath);", "protected function tearDown()\n {\n unlink($this->filename);\n }", "public function purgeTempFolder()\n\t{\n\t\t// Purge the folder\n\t\t$objFolder = new \\Folder('system/tmp');\n\t\t$objFolder->purge();\n\n\t\t// Restore the .gitignore file\n\t\t$objFile = new \\File('system/logs/.gitignore', true);\n\t\t$objFile->copyTo('system/tmp/.gitignore');\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the temp folder', __METHOD__, TL_CRON);\n\t}", "function wLogErase($path,$param) {\n \n $fp = unlink($path.\"/\".$param.\".log\");\n //fclose ($fp);\n \n}", "public function __destruct() {\n\t\t$filesystem = $this->filesystem;\n\t\t$this->tmpFiles->each(function($filePath) use($filesystem){\n\t\t\t$filesystem->delete($filePath);\n\t\t});\n\t}", "public function delete() {\n\t\treturn $this->wire('files')->unlink($this->logFilename, true);\n\t}", "public function testDeleteLowStockFile()\n {\n }", "public function delete($filepath);", "public function vaciar_temporales()\n\t{\n\t\t$directorio = $_SERVER['DOCUMENT_ROOT'].Yii::app()->request->baseUrl.\"/images/tmp/\"; \n\t\t/**\n\t\t*\tRecorre el directorio y borra los archivos que contiene\n\t\t*/\n\t\t$handle = opendir($directorio); \n\t\twhile ($file = readdir($handle)) { \n\t\t\tif (is_file($directorio.$file)) { \n\t\t\t\tunlink($directorio.$file); \n\t\t\t}\n\t\t}\n\t}", "protected function makeTemporaryFile(): string\n {\n return DIRECTORY_SEPARATOR . trim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) .\n DIRECTORY_SEPARATOR . ltrim(uniqid('epp', true), DIRECTORY_SEPARATOR);\n }", "public function testDeleteFile()\n {\n\n }", "function DeleteFile($id, $CheminU) {\r\n if (is_file($CheminU.\"/\".$id)) unlink($CheminU.\"/\".$id);\r\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 }", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function deleteAsset($path_to_file)\n\t{\n\t\t$path_to_file = rawurlencode(urldecode($path_to_file));\n\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI?action=filemgr&filemgraction=delete&filename=\".$path_to_file;\n\t\t$result = json_decode($this->curlObj->fetch_url($url),true);\n \n\t\treturn $result[\"MSG\"];\n\t}", "protected function tearDown(): void\n {\n unlink($this->test_file);\n }", "protected function removeTestFilePath()\n {\n $path = $this->getTestFilePath();\n FileHelper::removeDirectory($path);\n }", "function deleteFileFromPrivateStorage($path)\n{\n $exists = Storage::disk('local')->exists($path);\n if ($exists) {\n Storage::delete($path);\n }\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 }" ]
[ "0.7579932", "0.71778834", "0.7138377", "0.7137036", "0.696946", "0.6796721", "0.67330676", "0.6643069", "0.66374284", "0.657344", "0.6569541", "0.6506225", "0.6495539", "0.64552075", "0.6432344", "0.63925606", "0.6363795", "0.6350411", "0.6322465", "0.6297972", "0.6296432", "0.62753224", "0.6257955", "0.6226579", "0.6213362", "0.61841214", "0.6163365", "0.6162189", "0.6144358", "0.6127771", "0.6122118", "0.6114986", "0.6085402", "0.6084371", "0.608058", "0.6045018", "0.602715", "0.60151553", "0.6006291", "0.60049564", "0.60012233", "0.5974778", "0.5963069", "0.5961537", "0.5948226", "0.5943774", "0.59384584", "0.59235317", "0.59092075", "0.5899796", "0.58860666", "0.58782625", "0.5842936", "0.5840231", "0.58339405", "0.58303136", "0.5822089", "0.5816204", "0.581257", "0.58125216", "0.5805455", "0.5795151", "0.578584", "0.5784948", "0.57798016", "0.5777476", "0.57745755", "0.5774105", "0.57732004", "0.5770194", "0.576085", "0.5757387", "0.5754567", "0.5754072", "0.57484585", "0.5739421", "0.5730008", "0.57226336", "0.57188743", "0.57136333", "0.5708811", "0.56918263", "0.56910247", "0.56876004", "0.5682101", "0.5681317", "0.56782085", "0.5674819", "0.5669606", "0.5665039", "0.56522924", "0.56494516", "0.5641176", "0.5640335", "0.56269693", "0.5625876", "0.5597374", "0.5591789", "0.5583536", "0.5582702", "0.557856" ]
0.0
-1
Helper to have an array of all messages
protected function serializeViolations(ConstraintViolationListInterface $violations) { $messages = array(); foreach ($violations as $violation) { $messages[] = $violation->getMessage(); } return $messages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllMsg() : array\n {\n return $this->messages;\n }", "public function getMessages(): array;", "public function getMessages(): array;", "public function getMessages(): array;", "public function all(): array\n {\n return $this->messages;\n }", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public static function all(): array\n {\n return self::$messages;\n }", "public function getMessages() {}", "public function getMessages() {}", "public function all()\r\n {\r\n return $this->messages;\r\n }", "public function getMessages(): array\n {\n }", "public function getMessages(): array\n {\n return $this->messages;\n }", "public function getMessages(): array\n {\n return $this->messages;\n }", "public function getMessages(): array\n {\n return $this->messages;\n }", "public function getMessages(): array\n {\n return $this->messages;\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages()\n {\n return [];\n }", "public function messages(): array\n {\n return [];\n }", "public function getMessages() :array\r\n {\r\n return $this->messages;\r\n }", "public function getMessages() : array\n {\n return $this->messages;\n }", "public function messages(): array\n {\n return [\n //\n ];\n }", "private function _getAllMessages() {\r\n $_aMessages = array();\r\n foreach ( $this->aMessages as $_sLabel => $_sTranslation ) {\r\n $_aMessages[ $_sLabel ] = $this->get( $_sLabel );\r\n }\r\n return $_aMessages;\r\n }", "public function & getMessageArray() {\n\t\tif (null === $this->messages) {\n\t\t\t$this->getMessages();\n\t\t}\n\t\treturn $this->messages;\n\t}", "public function getMessages(): array\n {\n $result = [];\n foreach (array_keys($this->__data) as $key) {\n $result[$key] = $this->__data[$key]->message;\n }\n\n return $result;\n }", "public function getMessages() {\n\t\treturn isset($this->messages) ? $this->messages : [];\n\t}", "public function get_message_strings() {\n foreach($this->messages as $singleMessage) {\n \n }\n }", "public function getMessages(): Collection;", "public function getMessages(): Collection;", "public function getRedisMsgs()\n {\n return [[], [], [], 0, []];\n }", "public function getAll()\n\t{\n\t\t$msgs = Message::findByUser($this->getUser());\n\t\t$this->updateQueryTime();\n\t\treturn $msgs;\n\t}", "public function getMessages(){ }", "public function getReceivedMessages();", "public function getMessages(): array\n {\n if (empty($this->messages)) {\n $messageText = $this->event->get('body');\n $account_id = $this->event->get(static::ACCOUNT_ID);\n $room_id = $this->event->get('room_id');\n\n $this->messages = [new IncomingMessage($messageText, $account_id, $room_id, $this->event)];\n }\n\n return $this->messages;\n }", "public function get_messages() {\n\t\t$messages = $this->_read_messages();\n\t\t$this->clear_messages();\n\t\treturn apply_filters( 'tn_get_messages', $messages );\t\n\t}", "public function getMessages ()\n\t{\n\t\t$messages = array();\t//Prevent foreach loop error\n\t\t$Statement = $this->Database->prepare(\"SELECT messages.*, users.first_name, users.last_name, users.thumbnail FROM messages INNER JOIN users ON messages.sender_id = users.id WHERE reciever = ? ORDER BY id DESC LIMIT 30\");\n\t\t$Statement->execute(array($this->id));\n\t\t$messages = $Statement->fetchAll();\n\t\t\n\t\treturn $messages;\n\t}", "public function messages()\n {\n return [\n\n ];\n }", "public function getMessages(){\n\t\treturn $this->messages;\n\t}", "public function getMessages(){\n\t\treturn $this->messages;\n\t}", "public function messages()\n {\n return [\n ];\n }", "public function get_messages() {\n return $this->messages;\n }", "function messages()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->array_query( $message_array, \"SELECT ID, PostingTime FROM\r\n eZForum_Message\r\n WHERE ForumID='$this->ID' AND IsTemporary='0'\r\n ORDER BY PostingTime DESC\" );\r\n\r\n $ret = array();\r\n\r\n foreach ( $message_array as $message )\r\n {\r\n $ret[] = new eZForumMessage( $message[$db->fieldName( \"ID\" )] );\r\n }\r\n\r\n return $ret;\r\n }", "public static function getListMessage()\n\t{\n\t\tif (!isset($_SESSION[__CLASS__]))\n\t\t\t$_SESSION[__CLASS__] = array();\n\n\t\t// Prepare message list\n\t\t$list = array();\n\n\t\t// Retrieve message\n\t\tforeach ($_SESSION[__CLASS__] AS $message)\n\t\t\tarray_push($list, unserialize($message));\n\n\t\t// Clear the session from old message\n\t\t$_SESSION[__CLASS__] = array();\n\n\t\treturn $list;\n\t}", "public function getMessages () {\n return $this->messages;\n }", "public function getMessages()\r\n {\n return $this->fm->getMessages();\n }", "public function messages()\n {\n return Registry::get('core.mails', []);\n }", "public function getMessages() {\n if (isset($_SESSION['messages'])) {\n $messages = $_SESSION['messages'];\n unset($_SESSION['messages']);\n return $messages;\n } else {\n return array();\n }\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function getMessages()\n\t{\n\t\t$messages = Message::orderBy( 'created_at', 'asc' )->get();\n\t\treturn $messages;\n\t}", "public function getMessages()\n {\n return $this->messages;\n }", "public function getMessages()\n {\n return $this->messages;\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "public function getMessages()\n {\n return $this->_messages;\n }", "function GetMessages()\n\t{\n\t\t$trns = LiveChat::GetSessionsHeaders(array('sid' => $this->sid));\n\t\t$trns = $trns[0];\n\t\t\n\t\t$r = $this->db->q(\"\n\t\t\tSELECT *\n\t\t\tFROM #_PREF_lc_messages messages\n\t\t\t LEFT JOIN #_PREF_lc_users users ON messages.user_id = users.user_id\n\t\t\tWHERE messages.sid = \". $this->sid .\"\n\t\t\");\n\t\t\n\t\t$chat = array();\n\t\twhile ($item = $this->db->fetchAssoc()) {\n\t\t\t$chat[] = $item;\n\t\t}\n\t\t\n\t\t$trns['messages'] = $chat;\n\t\treturn $trns;\n\t}", "protected function defineMessages()\n {\n return [];\n }", "public function getMessages() {\n return $this->messages;\n }", "public function messages() {\n return [\n ];\n }", "public function messages() {\n return [\n ];\n }", "public static function returnMessages()\r\n {\r\n $result = array();\r\n \r\n // Process success messages\r\n if(isset($_SESSION['Success_messages']))\r\n {\r\n $Success_messages = $_SESSION['Success_messages'];\r\n unset($_SESSION['Success_messages']);\r\n\r\n foreach($Success_messages as $m)\r\n {\r\n $result[] = self::makeMessage($m, self::MESSAGE_TYPE_SUCCESS);\r\n }\r\n }\r\n \r\n // Process error messages\r\n if(isset($_SESSION['Error_messages']))\r\n {\r\n $Error_messages = $_SESSION['Error_messages'];\r\n unset($_SESSION['Error_messages']);\r\n\r\n foreach($Error_messages as $m)\r\n {\r\n $result[] = self::makeMessage($m, self::MESSAGE_TYPE_ERROR);\r\n }\r\n }\r\n \r\n // Process warning messages\r\n if(isset($_SESSION['Warning_messages']))\r\n {\r\n $Warning_messages = $_SESSION['Warning_messages'];\r\n unset($_SESSION['Warning_messages']);\r\n\r\n foreach($Warning_messages as $m)\r\n {\r\n $result[] = self::makeMessage($m, self::MESSAGE_TYPE_WARNING);\r\n }\r\n }\r\n \r\n return $result;\r\n }", "public function get_messages(){\n return $this->messages;\n }", "public function messages()\n {\n return [\n \n ];\n }", "static private function _getMsgs()\n\t{\n\t\t$msgs = Factory::getInstance( 'Session' )->get( self::$var_name );\n\n\t\tif ( $msgs )\n\t\t{\n\t\t\treturn $msgs;\n\t\t}\n\n\t\treturn array();\n\t}", "public function fetchMessages(){\n\t\t$sql = $this->dbh->query(\"SELECT * FROM `wsMessages`\");\n\t\t$msgs = $sql->fetchAll();\n\t\treturn $msgs;\n\t}", "public function messages();", "public function messages();", "public function messages();", "public function getAllMessage()\n {\n $messages = [];\n foreach (array_keys($this->errors) as $key) {\n $messages[$key] = $this->getMessage($key);\n }\n return $messages;\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages()\n {\n return [\n //\n ];\n }", "public function messages() {\n return $this->_messages;\n }", "public function readall() {\n\t\t$msgs = Core_Ipc_Messages::find(['stream' => md5($this->stream)], ['order' => 'msgid ASC']);\n\t\t$parsed = [];\n\n\t\tforeach($msgs AS $msg) {\n\t\t\t$parsed[] = $msg->instance;\n\t\t\t$msg->delete();\n\t\t}\n\n\t\treturn $parsed;\n\t}", "function get_messages($index = 0) {\n\t\tif ($this->get_multiple_values()) {\n\t\t\tif (!isset($this->messages[$index])) {\n\t\t\t\treturn Array();\n\t\t\t} else {\n\t\t\t\treturn $this->messages[$index];\n\t\t\t}\n\t\t} else {\n\t\t\t$this->messages;\n\t\t}\n\t}", "public function messages() {\n\t\treturn $this->master->call('account/messages');\n\t}", "public function messages()\n {\n return static::staticMessages();\n }", "public function getMessages()\n {\n return $this->_msg;\n }", "public function loadMessages() :array {\n $chatModel = new ChatModel();\n return $chatModel->getLastTenMessages();\n }", "public function fetchAllMessages()\n {\n return Chat::with('user')->get();\n }", "function getMessages(){\r\n return $this->messages;\r\n }", "protected function get_messages() {\n global $SESSION;\n\n $messages = array();\n if (!empty($SESSION->languagelesson_messages) && is_array($SESSION->languagelesson_messages) && array_key_exists($this->properties->id, $SESSION->languagelesson_messages)) {\n $messages = $SESSION->languagelesson_messages[$this->properties->id];\n unset($SESSION->languagelesson_messages[$this->properties->id]);\n }\n\n return $messages;\n }", "function getAllMessages(){\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\";\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}", "public function getMessages() {\r\n\t\t$messages = $this->session->messages;\r\n\t\t$this->session->unsetAll ();\r\n\t\treturn $messages;\r\n\t}", "private function _read_messages() {\n\n\t\tif( $this->messages ) {\n\t\t\treturn $this->messages;\n\t\t}\n\n\t\tif( !isset( $_COOKIE[ $this->cookie_handle ] ) || $_COOKIE[ $this->cookie_handle ] == \"null\" ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->parse_cookie( $_COOKIE[ $this->cookie_handle ] );\n\t}" ]
[ "0.8482941", "0.8469884", "0.8469884", "0.8469884", "0.83735514", "0.82345134", "0.82345134", "0.82345134", "0.82345134", "0.82345134", "0.82345134", "0.82345134", "0.8199286", "0.81387866", "0.81387866", "0.8055821", "0.8050517", "0.802687", "0.802687", "0.802687", "0.802687", "0.7970329", "0.7970329", "0.7970329", "0.7970329", "0.7970329", "0.7970329", "0.7970329", "0.79685235", "0.7940319", "0.78797144", "0.78686327", "0.78364223", "0.7781348", "0.77759385", "0.77520514", "0.77139395", "0.77003694", "0.77003694", "0.76717395", "0.7662848", "0.76587385", "0.7631598", "0.7604601", "0.7518697", "0.7500892", "0.7467386", "0.7456888", "0.7456888", "0.7454872", "0.74419737", "0.7440297", "0.7439472", "0.7433556", "0.74166787", "0.7414163", "0.740941", "0.7408494", "0.739298", "0.73860407", "0.73860407", "0.73606604", "0.73606604", "0.73606604", "0.73606604", "0.73606604", "0.7336874", "0.7334609", "0.73257816", "0.73066574", "0.73066574", "0.73059833", "0.7303976", "0.72905564", "0.7284225", "0.72728485", "0.7263115", "0.7263115", "0.7263115", "0.72600555", "0.72594434", "0.72594434", "0.72594434", "0.72594434", "0.72594434", "0.72594434", "0.72594434", "0.72594434", "0.72536427", "0.72381896", "0.72334135", "0.72278863", "0.7218279", "0.7211721", "0.7200034", "0.7199418", "0.71941584", "0.7184758", "0.7166615", "0.71523577", "0.7146367" ]
0.0
-1
Stored routine with designation type map must return an array.
public function test1() { $map = $this->dataLayer->tstTestMap1(100); $this->assertInternalType('array', $map); $this->assertCount(3, $map); $this->assertEquals(1, $map['c1']); $this->assertEquals(2, $map['c2']); $this->assertEquals(3, $map['c3']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypes(): array;", "public function getTypes(): array;", "#[Pure]\n\tpublic function getTypes()\n {\n }", "public function creataTypeArray()\n\t{\n\t\t$this->db->creataTypeArray();\n\t}", "public function __invoke() : array;", "public function __invoke() : array;", "public function maker(): array;", "abstract public function definition(): array;", "public function getDataWithTypeParameters() {}", "function FieldTypesArray() {}", "public function getDataWithTypeRegister() {}", "protected function getTypes() {}", "protected function getType() {\n\t\treturn new TypeArray( true );\n\t}", "protected static function _getDataTypes()\n {\n return [];\n }", "abstract protected function report_to_array_mapping();", "abstract public function getArray();", "public function getDefinition(): array;", "public function getTypeArr(){\n\t\treturn [\n\t\t\t'normal' =>'Normal',\n\t\t\t'ip'\t =>'IP',\n\t\t\t'iprange'=>'IP Bereich'\n\t\t];\n\t}", "function getDatatypesMapping() {\n return ['Protein' => ['pdb','swissprot','datacitesbgrid'],\n 'Phenotype' => ['clinvar','dbgap','mpd','datacitemorphobank'],\n 'Gene Expression' => ['geo', 'arrayexpress', 'gemma','nursadatasets','lsdb','genenetwork','gtexldacc'],\n 'Nucleotide Sequence' => ['sra','datacitebgi'],\n 'Morphology'=>['neuromorpho'],\n 'Clinical Trials'=>['clinicaltrials','ctn'],\n 'Proteomics Data'=>['peptideatlas','proteomexchange','yped'],\n 'Physiological Signals'=>['physiobank'],\n 'Epigenetic Data'=>['epigenomics'],\n 'Data from Papers'=>['datacitepeerj','ndarpapers'],\n\n 'Omics Data'=>['omicsdi'],\n 'Survey Data'=> ['datacitefdz'],\n 'Cell Signaling'=>['datacitesdscsg'],\n 'Imaging Data'=>['cvrg','neuromorpho','cia','openfmri','cil','bmrb','retina','emdb', 'nitrcir','neurovaultatlases','neurovaultcols','neurovaultnidm','datacitecxidb','datacitembf','datacitecandi'],\n 'Unspecified' => ['lincs','bioproject','dryad','dataverse','niddkcr','icpsr','gdc','rgd','vectorbase','datacitegnd','datacitezenodo',\n 'datacitecrcns','immport','datacitedatabrary','datacitelshtm','datacitejhu',\n 'simtk',\n 'datacitebils',\n 'dataciteada',\n 'dataciteukda',\n 'dataciteadaptive',\n 'datacitemit',\n 'datacitectsi',\n 'datacitenimh',\n 'nsrr','naturedata','datacitethieme','datacitefigshare','dataciteccdc','wormbase','metabolomics'],\n ];\n}", "public function build(): array;", "public function build(): array;", "public function getInternalArray() {}", "function getTipoParqueo()\n{\n return array(\n array('codigo' => 'MTO', 'valor' => 'Moto'),\n array('codigo' => 'CAR', 'valor' => 'Carro'),\n array('codigo' => 'TRK', 'valor' => 'Camion'),\n );\n}", "public static function getStandardTypes() : array\n {\n }", "public function get_types()\n {\n }", "public function get_desired_types();", "public function getDataWithTypeGetindpenv() {}", "public function typesProvider()\n {\n return [\n '1 Type' => ['Type1'],\n '2 Type' => [['Type1', 'Type2']],\n ];\n }", "public function typeProvider()\n {\n return array(\n array(true, false),\n array(12, false),\n array(24.50, false),\n array(new \\stdClass(), false),\n array('string', true),\n );\n }", "public function aArray() {}", "function getRTypesArray(){\n $STH = sqlSelect(\"SELECT * FROM types\");\n $returnArray = Array();\n while($row = $STH->fetch()) {\n $rtype = Array();\n $rType['type_id'] = $row['type_id'];\n $rType['type_name'] = $row['type_name'];\n $returnArray[] = $rType;\n }\n\n return $returnArray;\n}", "abstract protected function &container() : array ;", "#[ArrayShape(['label' => \"array|string\"])]\n public function definition(): array\n {\n $array = [\n 'label' => 'Check installation',\n 'menu_code' => 'my-space-installer',\n 'package' => 'my-space',\n 'route' => 'setup.installation.my-space',\n 'is_active' => true\n ];\n return $array;\n }", "public function getDataWithTypeLll() {}", "public function result() : array;", "function chartjs_array_typecaster($table){\r\n\t$table = chartjs_array_map_recursive('chartjs_typecaster', $table);\r\n\treturn $table;\r\n}", "public function get_data(): array;", "public function get_data(): array;", "function getArray();", "public function get_types()\n\t{\n\t\treturn array();\n\t}", "function document_types () {\n $type_array = array ();\n $documents_query_raw = \"\n select \n document_types_id,\n type_description\n from \n \" . TABLE_DOCUMENT_TYPES . \"\n where\n type_visible = 'True'\n order by \n sort_order\n \";\n\n $documents_query = tep_db_query ($documents_query_raw);\n while ($documents = tep_db_fetch_array ($documents_query) ) {\n $type_array[] = array ('id' => $documents['document_types_id'],\n 'text' => $documents['type_description']\n );\n } // while ($documents\n\n return $type_array;\n}", "public static function getTypes();", "public function getInfo():array;", "abstract public function getDataInstance($a_type = null);", "function acf_parse_types($array)\n{\n}", "abstract public function create(array $data): array;", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getDataWithTypePath() {}", "function getChildTypes() : array;", "function agilecrm_map_types($array)\n{\n $mapped = [];\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $mapped[] = $value;\n continue;\n }\n\n $type = in_array($key, TYPES['SYSTEM']) ? 'SYSTEM' : 'CUSTOM';\n\n $mapped[] = [\n 'type' => $type,\n 'name' => $key,\n 'value' => $value,\n ];\n }\n\n return $mapped;\n}", "public function toArray()\n {\n $type = $this->getType();\n $array = [\n 'type' => $type,\n ];\n if ('function' == $type) {\n $array['function'] = $this->getFunction();\n } else {\n $array['class'] = $this->getClass();\n $array['method'] = $this->getMethod();\n }\n return $array;\n }", "public function getDataWithTypeDebugRegister() {}", "static function getTypes(): array\n\t{\n return self::$types;\n }", "public abstract function toMap(): array;", "function get_pay_type_array() {\n $sql = \"SELECT id, name FROM \".TB_PREF.\"payroll_pay_type\";\n $result = db_query($sql, \"could not get pay rates\");\n $type_array = array();\n while($myrow = db_fetch($result)){\n\t$type_array[$myrow['id']] = $myrow['name'];\n }\n return $type_array;\n}", "public function getDataWithTypeField() {}", "public function getTypeMaintenace() {\n\t\ttry {\n\t\t\tglobal $con;\n\t\t\t/* Statement declaration */\n\t\t\t$sql = \t\"SELECT * FROM typemaintenance;\";\n\t\t\t/* Statement execution */\n\t\t\t$stmt = $con->query($sql);\n\t\t\t/* Statement result */\n\t\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t} catch(PDOException $e) {\n\t\t\treturn array(\"error\" => $e->getMessage());\n\t\t}\n }", "public function dataTypeMap()\n {\n return config('codegenerator.eloquent_type_to_method');\n }", "public function AsArray();", "function getInitiateTypes()\n{\n $database = eZDB::globalDatabase();\n $res_array = array();\n $qry_array = array();\n\n $query= \"SELECT ID FROM eZClassified_InitiateType\";\n $database->array_query( $qry_array, $query );\n foreach ( $qry_array as $qry_item )\n {\n $res_array[] = $qry_item[\"ID\"];\n }\n return $res_array;\n}", "abstract public function getFieldData(): array;", "public function generate(): array;", "public function getDataWithTypeDb() {}", "abstract public function type();", "abstract public function type();", "public function definition(): array\n {\n return [\n 'type' => Arr::random(array_keys(EntryFactoryClass::$entries)),\n ];\n }", "function getParametersType($parameters=array()){\n $result=getParametersTypeDataBase($parameters);\n $jTableResult = array();\n $jTableResult['Result'] = \"OK\";\n $jTableResult['Options'] = $result; \n return $jTableResult;\n}", "#[Pure]\n public function getType() {}", "#[Pure]\nfunction spl_classes(): array {}", "public function getDataTypes(){\n\t\t$this->_connect();\n\t\treturn $this->_getDataTypes();\n\t}", "public function getArray($aname){\n\t\tif(isset($this->id)){\n\t\t\t$this->name = $this->GetName();\n\t\t\t//5.3\n\t\t\t$module = call_user_func(array($this->name.\"ServerModule\",'getInstance'));\n\t\t\t//should be changed to direct call later (?)\n\t\t\tswitch($aname){\n\t\t\t\tcase 'Operate':\n\t\t\t\t\treturn $module->OperateRequirements();\n\t\t\t\tbreak;\n\t\t\t\tcase 'Create':\n\t\t\t\t\treturn $module->CreateOptions();\n\t\t\t\tbreak;\n\t\t\t\tcase 'Client':\n\t\t\t\t\treturn $module->ClientOptions();\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Unknown server module method\");\n\t\t\t}\n\t\t}\n\t}", "public function recordTypeProvider(): array\n {\n return [\n ['A'],\n ['AAAA'],\n ['CAA'],\n ['CDS'],\n ['CERT'],\n ['CERT'],\n ['CNAME'],\n ['DNSKEY'],\n ['DS'],\n ['HINFO'],\n ['LOC'],\n ['MX'],\n ['NAPTR'],\n ['NS'],\n ['PTR'],\n ['SOA'],\n ['SRV'],\n ['SSHFP'],\n ['TLSA'],\n ['TXT'],\n ];\n }", "public abstract function get_supported_datatypes();", "public function getDataWithTypeGlobal() {}", "public function getAsArray();", "private function get_type() {\n\n\t}", "public abstract function FetchArray();", "function PrimaryReturn($otype){\r\n}", "public function get_sitemap_type_data()\n {\n }", "protected abstract function getData(): array;", "public function getDataForGetMappingListMethod(): array\n {\n return [\n 0 => [\n 0 => [\n 'getMappingList' => [\n 0 => [\n 'apply' => 'ut',\n 'className' => 'Yoanm\\\\JsonRpcServer\\\\Domain\\\\JsonRpcMethodInterface',\n ],\n ],\n ],\n 1 => [\n 'getMappingList' => [\n 0 => [\n 'times' => 0,\n 'apply' => 0,\n 'className' => 'Yoanm\\\\JsonRpcServer\\\\Domain\\\\JsonRpcMethodInterface',\n ],\n ],\n ],\n ],\n 1 => [\n 0 => [\n 'getMappingList' => [\n 0 => [\n 'apply' => 'qui',\n 'className' => 'Yoanm\\\\JsonRpcServer\\\\Domain\\\\JsonRpcMethodInterface',\n ],\n ],\n ],\n 1 => [\n 'getMappingList' => [\n 0 => [\n 'times' => 0,\n 'apply' => 0,\n 'className' => 'Yoanm\\\\JsonRpcServer\\\\Domain\\\\JsonRpcMethodInterface',\n ],\n ],\n ],\n ],\n 2 => [\n 0 => [\n 'getMappingList' => [\n 0 => [\n 'apply' => 'aperiam',\n 'className' => 'Yoanm\\\\JsonRpcServer\\\\Domain\\\\JsonRpcMethodInterface',\n ],\n ],\n ],\n 1 => [\n 'getMappingList' => [\n 0 => [\n 'times' => 0,\n 'apply' => 0,\n 'className' => 'Yoanm\\\\JsonRpcServer\\\\Domain\\\\JsonRpcMethodInterface',\n ],\n ],\n ],\n ],\n ];\n }", "public function getTypeMap()\n {\n }", "public function dataProviderSchemaInterface(): array\n {\n return [\n ['object'],\n ['array'],\n ];\n }", "abstract public function values(): array;", "public function getDataType() {}", "public function getDataForEditTypes(): array\n {\n $subType = $this->getSubTypes();\n\n $records = (CamposFormato::findByAttributes([\n 'nombre' => PqrFormField::FIELD_NAME_SYS_TIPO,\n 'formato_idformato' => $this->getPqrForm()->fk_formato\n ]))->getCampoOpciones();\n\n $data = [];\n foreach ($records as $CampoOpciones) {\n if ($CampoOpciones->estado) {\n $data[] = [\n 'id' => $CampoOpciones->getPK(),\n 'text' => $CampoOpciones->valor\n ];\n }\n }\n\n return [\n 'dataType' => $data,\n 'dataSubType' => $subType ?? [],\n 'activeDependency' => (int)$this->dependencyExist()\n ];\n }", "public function fetchGroupTypes(): array;", "public function getDataWithTypeTsfe() {}", "public function register(): array;", "public function dataProvider(): array\n {\n return [\n [\n FruitType::NUT(),\n [\n Str::upper(FruitType::NUT) => FruitType::NUT(),\n ],\n ],\n [\n FruitType::BERRY(),\n [\n Str::upper(FruitType::NUT) => FruitType::NUT(),\n Str::upper(FruitType::BERRY) => FruitType::BERRY(),\n ],\n ],\n [\n FruitType::LEGUME(),\n [\n Str::upper(FruitType::NUT) => FruitType::NUT(),\n Str::upper(FruitType::BERRY) => FruitType::BERRY(),\n Str::upper(FruitType::LEGUME) => FruitType::LEGUME(),\n ],\n ],\n [\n FruitType::ACCESSORY_FRUIT(),\n [\n Str::upper(FruitType::NUT) => FruitType::NUT(),\n Str::upper(FruitType::BERRY) => FruitType::BERRY(),\n Str::upper(FruitType::LEGUME) => FruitType::LEGUME(),\n Str::upper(FruitType::ACCESSORY_FRUIT) => FruitType::ACCESSORY_FRUIT(),\n ],\n ],\n ];\n }", "#[LanguageLevelTypeAware([\"8.0\" => \"array\"], default: \"array|false\")]\nfunction spl_autoload_functions() {}", "public function getResult(): array;", "public function getResult(): array;", "protected function _getDataTypes(){\n\t\treturn ActiveRecordMetaData::getDataTypes($this->_source, $this->_schema);\n\t}", "public static function getTypeMap() {\n return [\n 'charge_id' => self::FIELD_INT,\n 'user_id' => self::FIELD_INT,\n 'amount' => self::FIELD_INT,\n 'description' => self::FIELD_STRING,\n 'charge_date' => self::FIELD_EPOCH,\n 'create_date' => self::FIELD_EPOCH,\n 'update_date' => self::FIELD_EPOCH,\n ];\n }", "public function getArray($create = false) {}", "public function getArray($create = false) {}", "abstract protected function getTestData() : array;" ]
[ "0.6544251", "0.6544251", "0.6448956", "0.6383722", "0.6184032", "0.6184032", "0.6164517", "0.6130299", "0.6116017", "0.60268736", "0.60176975", "0.6003087", "0.59171027", "0.5907994", "0.58354706", "0.57747835", "0.5758925", "0.57138205", "0.56934845", "0.56919014", "0.56919014", "0.5681326", "0.56554514", "0.56454927", "0.5641361", "0.56304854", "0.56033283", "0.5591183", "0.5589578", "0.55475265", "0.55456746", "0.55423987", "0.5528339", "0.5524989", "0.55213535", "0.5517687", "0.5496658", "0.5496658", "0.5494343", "0.5484773", "0.5483948", "0.548168", "0.54701394", "0.5463982", "0.545808", "0.54572237", "0.543489", "0.543489", "0.543489", "0.543489", "0.54202074", "0.5416697", "0.5413877", "0.5388932", "0.53837526", "0.53717643", "0.53713804", "0.5366135", "0.53653216", "0.5353196", "0.5348973", "0.5347943", "0.53353834", "0.533361", "0.533272", "0.53323656", "0.5327419", "0.5327419", "0.53113216", "0.5308108", "0.52965224", "0.5291943", "0.5288108", "0.5283184", "0.52792567", "0.52790374", "0.52759135", "0.52728", "0.5266889", "0.5266748", "0.5264929", "0.5261874", "0.5261172", "0.5259374", "0.52580166", "0.52558637", "0.52511555", "0.5248969", "0.52454287", "0.52426887", "0.5237968", "0.5232184", "0.523176", "0.52192557", "0.5218655", "0.5218655", "0.5218155", "0.52175224", "0.5203909", "0.52015746", "0.5197772" ]
0.0
-1
Stored routine with designation type map must return an empty array when no rows are selected.
public function test2() { $rows = $this->dataLayer->tstTestMap1(0); $this->assertInternalType('array', $rows); $this->assertCount(0, $rows); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function PgGetArraySelect(){\n if ($this->SQuery){\n if (pg_num_rows($this->SQuery)){\n return pg_fetch_all($this->SQuery); \n }else{\n return Array();\n }\n \n } else {\n die(\"NO Existe Consulta SELECT Valida!\");\n }\n }", "public function creataTypeArray()\n\t{\n\t\t$this->db->creataTypeArray();\n\t}", "function document_types () {\n $type_array = array ();\n $documents_query_raw = \"\n select \n document_types_id,\n type_description\n from \n \" . TABLE_DOCUMENT_TYPES . \"\n where\n type_visible = 'True'\n order by \n sort_order\n \";\n\n $documents_query = tep_db_query ($documents_query_raw);\n while ($documents = tep_db_fetch_array ($documents_query) ) {\n $type_array[] = array ('id' => $documents['document_types_id'],\n 'text' => $documents['type_description']\n );\n } // while ($documents\n\n return $type_array;\n}", "function getRTypesArray(){\n $STH = sqlSelect(\"SELECT * FROM types\");\n $returnArray = Array();\n while($row = $STH->fetch()) {\n $rtype = Array();\n $rType['type_id'] = $row['type_id'];\n $rType['type_name'] = $row['type_name'];\n $returnArray[] = $rType;\n }\n\n return $returnArray;\n}", "protected static function _getDataTypes()\n {\n return [];\n }", "public function getResults($type = null){\n //And combined two functions together\n //default is just to excute the code\n if(!@oci_execute($this->result)){\n echo \"Something wrong with the Query please check and try again!\";\n return false;\n }else{\n if($type == 'ARRAY'){\n while ($row = oci_fetch_assoc($this->result)) {\n $this->_array[] = $row;\n }\n return $this->_array;\n }else{\n return $this->result;\n }\n }\n\n }", "public function fetchGroupTypes(): array;", "public function getTypes(){\r\n \r\n $options[\"\"] = \"--Select--\";\r\n //Query all users(Lecturers) not assigned to other departments\r\n $types = $this->em->getRepository(\"\\Application\\Entity\\Assessmenttype\")->findBy(array(\"systemGenerated\"=>0));\r\n \r\n foreach($types as $type ){\r\n $options[$type->getPkAtid()] = $type->getTypeName();\r\n }\r\n \r\n return $options;\r\n }", "public function get_types() {\n\n $q = $this->db->query('SELECT DISTINCT `rgl_type` , `vtr_type` \n FROM `t_reglements` \n LEFT JOIN `v_types_reglements` ON `vtr_id` = `rgl_type` ');\n if ($q->num_rows() > 0) {\n $resultat = $q->result();\n return $resultat;\n }\n else {\n return array();\n }\n }", "function getProductTypes(){\n\t\t$id = $_GET['id'];\n\t\t$elem_id = $_GET['elem_id'];\n\t\t$wc = $this->getWc($id);\n\t\t$types = array();\n\t\tforeach ($wc as $k=>$v){\n\t\t\t$types[$v['ptid']] = true;\n\t\t}\n\t\tif ($elem_id){\n\t\t\t$elem = $this->getWc($id, $elem_id);\n\t\t\tunset($types[$elem['ptid']]);\n\t\t}\n\t\t$sql = \"SELECT id, name FROM product_types WHERE visible > 0 AND id NOT IN ('\".implode(\"', '\", array_keys($types)).\"')\";\n\t\t$rows = sql_getRows($sql, true);\n\t\treturn $rows;\n\t}", "public function iN_CreatorTypes() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_creators WHERE creator_status = '1'\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}", "function getParametersType($parameters=array()){\n $result=getParametersTypeDataBase($parameters);\n $jTableResult = array();\n $jTableResult['Result'] = \"OK\";\n $jTableResult['Options'] = $result; \n return $jTableResult;\n}", "function get_test_types(){\n\n\t$conn = connect();\n\t$sql = \"select test_type as T from radiology_record\";\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$count = 0;\n\twhile($row = oci_fetch_assoc($statement)){\n\t\t$ret[$count] = $row['T'];\n\t\t$count +=1;\n\t}\n\n\toci_close($conn);\n\toci_free_statement($statement);\n\n\treturn $ret;\n\n}", "abstract protected function getColumns(): array;", "function select($sql, $rettype = 1) {\n //RetType will return the type of rwo return\n // 1 for array, 2 for assoc, 3 for id\n $sql = trim($sql);\n\n $result = mysqli_query($this->link, $sql);\n if (!$result) {\n\n echo 'MySQL Error: ' . mysqli_error($this->link);\n exit;\n }\n switch ($rettype) {\n case 1:\n //return array\n while ($row = mysqli_fetch_array($result)) {\n foreach ($row as $key => $value) {\n $v[$key] = html_entity_decode(htmlspecialchars_decode(stripslashes($value)));\n }\n $data[] = $v;\n }\n break;\n case 2:\n //return assoc\n while ($row = mysqli_fetch_assoc($result)) {\n foreach ($row as $key => $value) {\n $v[$key] = html_entity_decode(htmlspecialchars_decode(stripslashes($value)));\n }\n $data[] = $v;\n }\n break;\n case 3:\n //return row\n while ($row = mysqli_fetch_row($result)) {\n foreach ($row as $key => $value) {\n $v[$key] = html_entity_decode(htmlspecialchars_decode(stripslashes($value)));\n }\n $data[] = $v;\n }\n break;\n default:\n //return array\n while ($row = mysqli_fetch_array($result)) {\n foreach ($row as $key => $value) {\n $v[$key] = html_entity_decode(htmlspecialchars_decode(stripslashes($value)));\n }\n $data[] = $v;\n }\n break;\n }\n mysqli_free_result($result);\n if (isset($data)) {\n return $data;\n }\n }", "function _getTypes()\n {\n $types = array(\n 0 => \"null\",\n 1 => \"bool\",\n 2 => \"int\",\n 3 => \"float\",\n 4 => \"varchar\",\n 5 => \"text\",\n 6 => \"blob\"\n );\n $tLeast = $this->table->count() < 2 ? 4 : 0;\n if ($this->GET('override')) {\n $types[1] = \"int\";\n $types[4] = \"text\";\n $types[6] = \"text\";\n }\n foreach ($this->table->fields as $field) {\n $t[$field] = strcasecmp($field, \"id\") ? $tLeast : 2;\n }\n while ($row = $this->table->each()) {\n foreach ($row as $field => $value) {\n if (preg_match('/[\\x00-\\x06\\x08\\x0B-\\x0C\\x0E-\\x13\\x16-\\x1F]/', $value))\n $t[$field] = 6;\n elseif (strlen($value) > 255 || strpos($value, \"\\n\"))\n $t[$field] = max($t[$field], 5);\n elseif (! empty($value) && ! is_numeric($value))\n $t[$field] = max($t[$field], 4);\n elseif (! preg_match('/^[+-]?\\d{0,10}$/s', $value))\n $t[$field] = max($t[$field], 3);\n elseif (! preg_match('/^[01]?$/s', $value))\n $t[$field] = max($t[$field], 2);\n elseif (strlen($value))\n $t[$field] = max($t[$field], 1);\n }\n }\n foreach ($this->table->fields as $field) {\n $this->types[$field] = $types[$t[$field]];\n }\n $this->table->reset();\n }", "function getTypesMenu(){\n\t\t$sql=\"SELECT gd.TenGD, ctgd.MaCTGD, ctgd.TenCTGD FROM giaidoan gd, chitietgiaidoan ctgd WHERE gd.MaGD = ctgd.MaGD\";\n\t\t$this->setQuery($sql);\n\t\treturn $this->loadAllRows();\n\t}", "public function getTypes(): array;", "public function getTypes(): array;", "public function select($query, $type='assoc') {\n\t\t$rows = array();\n\t\t$result = $this -> query($query);\n\t\tif($result === false) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($type=='assoc') {\n\t\t\twhile ($row = $result -> fetch_assoc()) {\n\t\t\t\t$rows[] = $row;\n\t\t\t}\n\t\t} else {\n\t\t\twhile ($row = $result -> fetch_array()) {\n\t\t\t\t$rows[] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $rows;\n\t}", "private function getSubTypes(): ?array\n {\n if (!$this->subTypeExist()) {\n return null;\n }\n\n $PqrFormField = $this->getPqrForm()->getRow('sys_subtipo');\n $records = $PqrFormField->getCamposFormato()->getCampoOpciones();\n\n $data = [];\n foreach ($records as $CampoOpciones) {\n if ($CampoOpciones->estado) {\n $data[] = [\n 'id' => $CampoOpciones->getPK(),\n 'text' => $CampoOpciones->valor\n ];\n }\n }\n\n return $data;\n }", "public function getTypes(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_types\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "function get_data_request_options()\r\n{\r\n\t//kijk wat het abstractie niveau is van de huidige opties\r\n\t$current_abstraction_level_query = 'select option_type from Requestable_data where option_name == \":current_selected_option\"';\r\n\t$current_abstraction_level = execute_sql_extract_data($current_abstraction_level_query);\r\n\t\r\n\t//haal de opties maar op uit de DB\r\n\t$requestable_data_descriptions = 'select option_name from Requestable_data where option_type = ' . $current_abstraction_level;\r\n\texecute_sql_extract_data($requestable_data_descriptions);\r\n}", "function select($sql = \"\", $smarty = false) {\n\t\t\t\t#echo \"<br>\".$sql.\"<br>\";\n\t\t\t$result = 0;\n\t\t\t$this->time_start();\n\t\t\t$r = $this->checkup(\"select\", $sql);\n\t\t\tif (!$r) { $this->error(\"error queriing, its not a select-query: \".$sql); return false; }\n\t\t\t\n\t\t\t$this->affected_rows = 0;\n\n\t\t\t// if there is an SHOW query, there is MYSQL_BOTH needed as mysql_fetch_array result type\n\t\t\tif (eregi(\"^show\", $sql)) {\n\t\t\t\t$temp_type = $this->SELECT_TYPE;\n\t\t\t\t$this->SELECT_TYPE = MYSQLI_BOTH;\n\t\t\t}\n\t\t\t$conn = $this->CONN;\n\n\t\t\t$results = mysqli_query($conn, $sql) or $this->error($sql);\n\t\t\tif ((!$results) or (empty ($results))) {\n\t\t\t\t//mysqli_free_result($conn); // nothing to free\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$count = 0;\n\t\t\t$data = array ();\n\n\t\t\t$this->affected_rows = mysqli_affected_rows($conn);\n\n\t\t\t// create a smarty readable array\n\t\t\tif ($smarty == true) {\n\t\t\t\twhile ($row = mysqli_fetch_array($results, $this->SELECT_TYPE)) {\n\t\t\t\t\t// if there's only one column and the script is allow to create,\n\t\t\t\t\t// create a 1-d array\n\t\t\t\t\tarray_push($data, $row);\n\t\t\t\t}\n\t\t\t\t// normal int associated array\n\t\t\t}\n\t\t\telseif (!ereg(\"INDEX_ASSOCIATION\", $sql)) {\n\t\t\t\t// normal results return (1-d, 2-d arrays)\n\t\t\t\t$anz_rows = mysqli_num_fields($results);\n\t\t\t\twhile ($row = mysqli_fetch_array($results, $this->SELECT_TYPE)) {\n\t\t\t\t\t// if there's only one column and the script is allowed to create,\n\t\t\t\t\t// create a 1-d array\n\t\t\t\t\tif ($anz_rows < 2 && $this->field_dimension == 1) {\n\t\t\t\t\t\t$data[$count] = $row[0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$data[$count] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t$count ++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// build index-assozitive 1-d/2-d array\n\t\t\t\t// entity named INDEX_ASSOCIATION would be the array-key\n\t\t\t\twhile ($row = mysqli_fetch_array($results)) {\n\t\t\t\t\t$count = $row['INDEX_ASSOCIATION'];\n\t\t\t\t\t// if theres only one entity left, build a 1-d array\n\t\t\t\t\tif (count($row) > 4) {\n\t\t\t\t\t\t// remove ASSOCIATIONs, not needed\n\t\t\t\t\t\t$data[$count] = $row;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($row[1] == $row['INDEX_ASSOCIATION']) {\n\t\t\t\t\t\t\t$data[$count] = $row[0];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$data[$count] = $row[1];\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\tif (eregi(\"^show\", $sql)) {\n\t\t\t\t$this->SELECT_TYPE = $temp_type;\n\t\t\t}\n\n\t\t\tmysqli_free_result($results);\n\t\t\t$this->commands[\"select\"]++;\n\t\t\t$this->commands[\"sum\"]++;\n\n\t\t\t$this->time_stop(\"select\");\n\n\t\t\treturn $data;\n\t\t}", "public function getDataWithTypeParameters() {}", "public function getTypes()\n\t{\n\t\t$keys = array_keys( ColumnHelper::getAvailableTypes() );\n\t\t$labels = Sort::pluck( ColumnHelper::getAvailableTypes(), 'name' );\n\n\t\t$response = [];\n\t\t$types = array_combine( $keys, $labels );\n\t\t$allowed = $this->section->allowedColumns;\n\t\t$allowed = apply_filters( 'chef_sections_default_allowed_columns', $allowed, $this, $this->section );\n\n\t\tforeach( $types as $key => $type ){\n\t\t\tif( in_array( $key, $allowed ) )\n\t\t\t\t$response[ $key ] = $type;\n\t\t}\n\n\t\treturn $response;\n\n\t}", "function getInitiateTypes()\n{\n $database = eZDB::globalDatabase();\n $res_array = array();\n $qry_array = array();\n\n $query= \"SELECT ID FROM eZClassified_InitiateType\";\n $database->array_query( $qry_array, $query );\n foreach ( $qry_array as $qry_item )\n {\n $res_array[] = $qry_item[\"ID\"];\n }\n return $res_array;\n}", "public function equipment_type(){\n\t\t\t$equip_type_qry = $this->db->prepare(\"SELECT * FROM truck_type WHERE status = '1'\");\n\t\t\t$equip_type_qry->execute();\n\t\t\t$fetch= array();\n\t\t\twhile($equip_type_row = $equip_type_qry->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$fetch[]=$equip_type_row;\n\t\t\t}\n\t\t\treturn $fetch;\n\t\t}", "public function getDataTypes(){\n\t\t$this->_connect();\n\t\treturn $this->_getDataTypes();\n\t}", "public function getDataWithTypeDb() {}", "function getfeaturetype()\n {\n $featuretypes = \"SELECT * from featuretypes\";\n $featuretypesresult = $this->ds->select($featuretypes); \n //print_r($featuretypesresult);\n return $featuretypesresult;\n }", "function get_select($parent = NULL, $nothing_value = NULL)\n\t{\n \t\t$data = array();\n\t\t\n\t\tif ( ! is_null($nothing_value))\n\t\t\t$data = array('' => $nothing_value);\n\n\t\tif ( ! is_null($parent))\n\t\t\t$this->{$this->db_group}->where('parent', $parent);\n\n \t\t$this->{$this->db_group}->order_by('ordering', 'ASC');\n\t\t\t\n\t\t$query = $this->{$this->db_group}->get($this->table);\n\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\t$result = $query->result_array();\n\t\t\t\n\t\t\tforeach($result as $item)\n\t\t\t{\n\t\t\t\t$data[$item['id_type']] = $item['title'];\n\t\t\t}\n\t\t}\t\t\t\n\n\t\treturn $data;\n\t}", "public function getTypeMaintenace() {\n\t\ttry {\n\t\t\tglobal $con;\n\t\t\t/* Statement declaration */\n\t\t\t$sql = \t\"SELECT * FROM typemaintenance;\";\n\t\t\t/* Statement execution */\n\t\t\t$stmt = $con->query($sql);\n\t\t\t/* Statement result */\n\t\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t} catch(PDOException $e) {\n\t\t\treturn array(\"error\" => $e->getMessage());\n\t\t}\n }", "abstract protected function columns(): array;", "function FieldTypesArray() {}", "public function getSelectDataFields();", "function select( $sql = \"\", $smarty = false )\n\t{\n\t\t#echo \"<br>\".$sql.\"<br>\";\n\t $result=0;\n\t\t$this->time_start();\n\t\t$this->checkup( \"select\", $sql ) or $this->error( \"error queriing, its not a select-query: \" . $sql );\n\t\t$this->affected_rows = 0;\n\t\t\n\t\t// if there is an SHOW query, there is MYSQL_BOTH needed as mysql_fetch_array result type\n\t\tif ( eregi( \"^show\", $sql ) ) {\n\t\t\t$temp_type = $this->SELECT_TYPE;\n\t\t\t$this->SELECT_TYPE = MYSQL_BOTH;\n\t\t}\n\t\t$conn = $this->CONN;\n\t\t$results = mysql_query( $sql, $conn ) or $this->error( $sql );\n\t\tif ( ( !$results ) or ( empty( $results ) ) ) {\n\t\t\t@mysql_free_result( $results );\n\t\t\treturn false;\n\t\t}\n\n\t\t$count = 0;\n\t\t$data = array();\n\t\t\n\t\t$this->affected_rows = mysql_affected_rows ( $conn );\n\t\t\n\t\t// create a smarty readable array\n\t\tif ( $smarty == true ) {\n\t\t\twhile ( $row = mysql_fetch_array( $results, $this->SELECT_TYPE ) ) {\n\t\t\t\t// if there's only one column and the script is allow to create,\n\t\t\t\t// create a 1-d array\n\t\t\t\tarray_push( $data, $row );\n\t\t\t}\n\t\t\t// normal int associated array\n\t\t} elseif ( !ereg( \"INDEX_ASSOCIATION\", $sql ) ) {\n\t\t\t// normal results return (1-d, 2-d arrays)\n\t\t\t$anz_rows = mysql_num_fields( $results );\n\t\t\twhile ( $row = mysql_fetch_array( $results, $this->SELECT_TYPE ) ) {\n\t\t\t\t// if there's only one column and the script is allowed to create,\n\t\t\t\t// create a 1-d array\n\t\t\t\tif ( $anz_rows < 2 && $this->field_dimension == 1 ) {\n\t\t\t\t\t$data[$count] = $row[0];\n\t\t\t\t} else {\n\t\t\t\t\t$data[$count] = $row;\n\t\t\t\t}\n\t\t\t\t$count++;\n\t\t\t}\n\t\t} else {\n\t\t\t// build index-assozitive 1-d/2-d array\n\t\t\t// entity named INDEX_ASSOCIATION would be the array-key\n\t\t\twhile ( $row = @mysql_fetch_array( $results ) ) {\n\t\t\t\t$count = $row['INDEX_ASSOCIATION'];\n\t\t\t\t// if theres only one entity left, build a 1-d array\n\t\t\t\tif ( count( $row ) > 4 ) {\n\t\t\t\t\t// remove ASSOCIATIONs, not needed\n\t\t\t\t\t$data[$count] = $row;\n\t\t\t\t} else {\n\t\t\t\t\tif ( array_key_exists(\"1\", $row) && $row[1] == $row['INDEX_ASSOCIATION'] ) {\n\t\t\t\t\t\t$data[$count] = $row[0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$data[$count] = array_key_exists(\"1\", $row) ? $row[1] : \"\" ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ( eregi( \"^show\", $sql ) ) {\n\t\t\t$this->SELECT_TYPE = $temp_type;\n\t\t}\n\n\t\t\n\t\t@mysql_free_result( $results );\n\t\t$this->commands[\"select\"]++; $this->commands[\"sum\"]++;\n\n\t\t$this->time_stop(\"select\");\n\n\t\treturn $data;\n\t}", "function select_many($sql, $type='{}',$key=null){\n $result = $this->execute($sql) or $this->error($sql);\n $recordset = array();\n //$key = trim($type,'[]{}<>()');\n switch($type[0]){\n case '[' : $type = '[]'; break;\n case '{' : $type = '{}'; break;\n case '<' : $type = '<>'; break;\n case '(' : $type = '()'; break;\n default: $type = $type;\n }\n while ($row = $this->next($result,$type)) {\n if(!empty($key)){\n $idx = is_object($row)?($row->$key):$row[$key];\n $recordset[$idx] = $row;\n } else {\n $recordset[] = $row;\n }\n }\n mysql_free_result($result);\n return $recordset;\n }", "public function get_desired_types();", "function get_pay_type_array() {\n $sql = \"SELECT id, name FROM \".TB_PREF.\"payroll_pay_type\";\n $result = db_query($sql, \"could not get pay rates\");\n $type_array = array();\n while($myrow = db_fetch($result)){\n\t$type_array[$myrow['id']] = $myrow['name'];\n }\n return $type_array;\n}", "abstract public function getTablesArray();", "protected function inputSelectionCriteria(): array\n {\n return [];\n }", "public function getColumnTypes();", "public function getDataWithTypeGetindpenv() {}", "protected function _getDataTypes(){\n\t\treturn ActiveRecordMetaData::getDataTypes($this->_source, $this->_schema);\n\t}", "protected function getTypes() {}", "public function get_data_array($type){\n\t\t\n\t\tglobal $DATABASE;\n\t\t\n\t\t$data = $DATABASE->fetch_assoc($type);\n\t\t\n\t\treturn $data;\n\t\t\n\t}", "function vendor_type_list($search=0) {\n // internal arrays are the rows selected \n if(is_array($search)) { \n //if(count($search) == 1) { \n // $search = $search[0]; \n //} else { \n foreach($search as $key => $val) { \n $search[$key] = \"id=$val\"; \n } \n $query = \"SELECT * FROM vendor_type \"; \n $query .= \"WHERE \" . implode(\" OR \",$search) . \" \"; \n $query .= \"ORDER BY id\"; \n //} \n } else if(is_numeric($search)) { \n if($search == \"34\") { \n $query = \"SELECT * FROM vendor_type \"; \n $query .= \"WHERE id=6 OR id=4 OR id=5 \"; \n $query .= \"ORDER BY id\"; \n } else { \n $query = \"SELECT * FROM vendor_type \"; \n $query .= \"WHERE id=1 OR id=3 OR id=2 OR id=4 OR id=5 \"; \n $query .= \"ORDER BY id\"; \n } \n } else { \n $query = \"SELECT * FROM vendor_type ORDER BY id\"; \n } \n \n $result = $this->db->getAll($query); \n \n if(count($result) > 1) \n $ret_stack[0] = array(\"id\" => 0, \"type_num\" => 0, \"name\" => \"All\", \"plural\" => \"All\"); \n /*\n while($row = $this->db->fetch_array($result)) { \n $ret_stack[$row['id']] = $row; \n } */ \n\n foreach($result as $obj) {\n $ret_stack[$obj['id']] = $obj;\n }\n\n unset($result);\n \n return($ret_stack); \n }", "public function fetchMPTypes() {\n\t\t\n\t\t$this->_productTypes = array();\n\t\t$sql = \"SELECT * FROM product_types WHERE parent_ptype_id IS NULL\"; \n\t\t$dbh = $this->_conn->query( $sql);\n\t\n\t\twhile ( $row = $dbh->fetch() )\t{\n\t\t\t\t$this->_productTypes[] = new ProductTypes( $row[\"ptype_id\"], $row[\"parent_ptype_id\"], $row[\"type_name\"] );\n\t\t }\t\n\t\t \n\t\treturn $this->_productTypes;\n\t}", "function get_all_types()\n {\n return $this->db->get('card_types')->result();\n }", "private function getData(){\n\t\tdb::getAdapter();\n\t\t\n\t\t$counter=0;\n\t\t$arrayFieldQuery=array();\n\t\tforeach($this->fields as $field){\n\t\t\t$arrayFieldQuery[$field]=$this->types[$counter];\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\t$counter=0;\n\t\t$arrayFilters=array();\n\t\tforeach($this->filters as $filter){\n\t\t\t$arrayFilters[$this->fields[$filter[0]]]=array(\"type\"=>$this->types[$filter[0]],\"value\"=>$filter[1]);\n\t\t}\n\t\t\n\t\tif(db::getFields($this->table,$arrayFieldQuery,$arrayFilters,$this->orderQuery,$this->limit,true)){\n\t\t\t$this->pages=ceil(((int)db::getCalculatedRows())/((int)$this->maxRowsPerPage));\n\t\t\t$this->maxRows=(int)db::getCalculatedRows();\n\t\t\twhile($row=db::fetch(db::$FETCH_TYPE_ASSOC)){\n\t\t\t\t$this->addRow($row);\n\t\t\t}\n\t\t}\n\t}", "public static function get_available_types()\n {\n $sql = \"SELECT IT_InstrumentTypeID_pk, IT_Name_ind FROM t_InstrumentType ORDER BY IT_Name_ind ASC\";\n $stmt = \\NMI::Db()->prepare($sql);\n $stmt->execute();\n $rows = $stmt->fetchAll();\n return \\Arr::assoc_to_keyval($rows, 'IT_InstrumentTypeID_pk', 'IT_Name_ind');\n }", "function get_all_array($db,$tblname,$options=NULL)\n{\n if (isset($options)) {\n foreach ($options as $key => $value) {\n switch ($key) {\n case 'columns':\n\tif (is_array($value)) {\n\t $columns = $value;\n\t} else {\n\t $columns[] = $value;\n\t}\n\tbreak;\n case 'sort':\n\tif (is_array($value)) {\n\t $orderparts = $value;\n\t} else {\n\t $orderparts[] = $value;\n\t}\n\tbreak;\n\t\n case 'where':\n\tif (is_array($value)) {\n\t $whereparts = $value;\n\t} else {\n\t $whereparts[] = $value;\n\t}\n\tbreak;\n\t\n default:\n\t# code...\n\t break;\n }\n }\n }\n \n $sql_a = Array(); /* initialize the sql query */\n $sql_a[] = \"SELECT\";\n $sql_a[] = (!empty($columns) ? join(\", \",$columns) : \"*\");\n $sql_a[] = \"FROM $tblname\";\n if (!empty($whereparts)) $sql_a[] = \" WHERE \".join(\" AND \",$whereparts);\n if (!empty($orderparts)) $sql_a[] = \" ORDER BY \".join(\",\",$orderparts);\n $sql_s = join(\" \",$sql_a);\n $result=$db->query($sql_s) or\n die(\"In \".__FILE__.\"@\".__LINE__.\" \".__FUNCTION__.\n\t\"Fatal error in query: $sql: (\".$db->errno.\") \".$db->error);\n $all_rows = Array();\n if ($result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) {\n $all_rows[] = $row;\n }\n }\n $result->free();\n return $all_rows;\n}", "private function _returnBaseData($query, $type): array {\n $answer = [];\n\n switch($type) {\n case 'resources':\n $imgClass = 'material';\n break;\n case 'factories':\n $imgClass = 'product';\n break;\n case 'loot':\n $imgClass = 'loot';\n break;\n case 'units':\n $imgClass = 'unit';\n break;\n case 'headquarter':\n $imgClass = 'hq';\n break;\n case 'buildings':\n $imgClass = 'building';\n break;\n case 'settings':\n $imgClass = 'settings';\n break;\n }\n\n $getData = $this->_conn->query($query);\n\n if($getData->num_rows > 0) {\n $image = $globalIndex = 0;\n\n while($data = $getData->fetch_assoc()) {\n /*\n DB stores arrays as comma-separated strings => convert them to array before appending\n */\n foreach($data as $index => $dataset) {\n if(strpos($dataset, ',') !== false) {\n $data[$index] = $this->_convertArrayStringToArray($dataset);\n }\n }\n\n if($imgClass !== 'hq' && $imgClass !== 'building' && $imgClass !== 'settings') {\n\n /*\n adds prices\n */\n foreach(self::PRICE_INTERVALS as $interval => $seconds) {\n $data['prices'][$interval] = $this->_prices[$type][$globalIndex][$interval];\n }\n\n /*\n globally adds warehouse subobject\n */\n foreach(self::WAREHOUSE_ARRAY as $array) {\n $data['warehouse'][$array] = 0;\n }\n\n /*\n adds special subobjects depending on type\n */\n switch($type) {\n case 'factories':\n $originArray = self::PRODUCT_ARRAY;\n break;\n case 'resources':\n $originArray = self::RESOURCE_ARRAY;\n break;\n default:\n $originArray = [];\n break;\n }\n\n foreach($originArray as $array) {\n $data[$array] = 0;\n }\n }\n\n /*\n links to corresponding image\n */\n if($imgClass !== 'settings') {\n $data['icon'] = 'resources-' . $imgClass . '-' . $image;\n }\n ++$image;\n\n $answer[] = $data;\n ++$globalIndex;\n }\n }\n\n return $answer;\n }", "function fetch_assoc($sql,$type){\n\t\tif ($this->conn) {\n\t\t\t$query = mysqli_query($this->conn,$sql);\n\t\t\tif($type==0){\n\t\t\t\twhile($row = mysqli_fetch_assoc($query)){\n\t\t\t\t\t$data[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\telse if ($type==1) {\n\t\t\t\t$data = mysqli_fetch_assoc($query);\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\t}", "public function getTypeList__600(){\n $query = new Query ( \"SELECT\" );\n\n $type = TypeBean::select ( $query );\n if (! $type) {\n return false;\n }\n return $type;\n }", "function master_view_query_result(): Array {\n\n $table = strtolower($this->controller);\n \n $model = $this->current_model;\n\n $select_columns = $this->toggle_master_view_select_columns(); \n\n $lookup_tables = $this->CI->grants->lookup_tables($table);\n \n $master_view_query_result = $this->CI->grants_model->run_master_view_query($table,$select_columns,$lookup_tables);\n \n return $this->CI->grants->update_query_result_for_fields_changed_to_select_type($this->controller,$master_view_query_result);\n \n }", "#[Pure]\n\tpublic function getTypes()\n {\n }", "public function getDataWithTypeFieldAndFieldIsMultiDimensional() {}", "public function getSelect();", "public function getSelect();", "function GetAllDataProductType($param = [])\n {\n if (isset($param['search_value']) && $param['search_value'] != '') {\n $this->db->group_start();\n $i = 0;\n foreach ($param['search_field'] as $row => $val) {\n if ($val['searchable'] == 'true') {\n if ($i == 0) {\n $this->db->like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n } else {\n $this->db->or_like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n }\n $i++;\n }\n }\n $this->db->group_end();\n }\n if (isset($param['row_from']) && isset($param['length'])) {\n $this->db->limit($param['length'], $param['row_from']);\n }\n if (isset($param['order_field'])) {\n if (isset($param['order_sort'])) {\n $this->db->order_by($param['order_field'], $param['order_sort']);\n } else {\n $this->db->order_by($param['order_field'], 'desc');\n }\n } else {\n $this->db->order_by('a.id', 'desc');\n }\n $data = $this->db\n ->select('*, a.id')\n ->where('a.is_delete', 0)\n ->get('t4_product_type a')\n ->result_array();\n\n return $data;\n }", "abstract public function get_rows();", "public function getVATypesDD() {\n if (!$options = $this->_cache->load('vatypedd')) {\n\t$select = $this->select()\n\t\t->from($this->_name, array('type', 'type'))\n\t\t->order('type');\n\t$options = $this->getAdapter()->fetchPairs($select);\n\t$this->_cache->save($options, 'vatypedd');\n\t}\n\treturn $options;\n }", "private function getFieldDefList(): array\n {\n $sql = <<<SQL\nWITH type_list AS\n(\n SELECT\n typname,\n typnamespace,\n typtype\n FROM\n pg_type\n),\nfieldlist_prelim AS\n(\n SELECT\n column_name,\n is_nullable,\n column_default,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale,\n udt_schema,\n udt_name\n FROM\n information_schema.columns\n WHERE\n table_schema = :schema\n AND\n table_name = :table\n),\nfieldlist AS\n(\n SELECT\n fp.column_name,\n fp.is_nullable,\n fp.column_default,\n CASE WHEN data_type = 'USER-DEFINED' THEN\n (\n SELECT\n CASE\n WHEN tp.typtype = 'b' THEN\n 'base'\n WHEN tp.typtype = 'c' THEN\n 'composite'\n WHEN tp.typtype = 'd' THEN\n 'domain'\n WHEN tp.typtype = 'e' THEN\n 'enum'\n WHEN tp.typtype = 'p' THEN\n 'psuedo'\n WHEN tp.typtype = 'r' THEN\n 'range'\n END\n FROM\n type_list tp\n WHERE\n tp.typname = fp.udt_name\n AND tp.typnamespace = (\n SELECT\n oid\n FROM\n pg_namespace ns\n WHERE\n ns.nspname = fp.udt_schema\n )\n )\n ELSE\n data_type\n END AS data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale,\n udt_schema,\n udt_name\n FROM\n fieldlist_prelim fp\n)\n\nSELECT * FROM fieldlist;\nSQL;\n\n $sth = $this->db->prepare($sql);\n $sth->execute(\n [\n ':table' => $this->table->getName(),\n ':schema' => $this->table->getSchema()\n ]);\n\n return $sth->fetchAll(PDO::FETCH_OBJ);\n }", "public function getDataWithTypeField() {}", "function getDatatypesMapping() {\n return ['Protein' => ['pdb','swissprot','datacitesbgrid'],\n 'Phenotype' => ['clinvar','dbgap','mpd','datacitemorphobank'],\n 'Gene Expression' => ['geo', 'arrayexpress', 'gemma','nursadatasets','lsdb','genenetwork','gtexldacc'],\n 'Nucleotide Sequence' => ['sra','datacitebgi'],\n 'Morphology'=>['neuromorpho'],\n 'Clinical Trials'=>['clinicaltrials','ctn'],\n 'Proteomics Data'=>['peptideatlas','proteomexchange','yped'],\n 'Physiological Signals'=>['physiobank'],\n 'Epigenetic Data'=>['epigenomics'],\n 'Data from Papers'=>['datacitepeerj','ndarpapers'],\n\n 'Omics Data'=>['omicsdi'],\n 'Survey Data'=> ['datacitefdz'],\n 'Cell Signaling'=>['datacitesdscsg'],\n 'Imaging Data'=>['cvrg','neuromorpho','cia','openfmri','cil','bmrb','retina','emdb', 'nitrcir','neurovaultatlases','neurovaultcols','neurovaultnidm','datacitecxidb','datacitembf','datacitecandi'],\n 'Unspecified' => ['lincs','bioproject','dryad','dataverse','niddkcr','icpsr','gdc','rgd','vectorbase','datacitegnd','datacitezenodo',\n 'datacitecrcns','immport','datacitedatabrary','datacitelshtm','datacitejhu',\n 'simtk',\n 'datacitebils',\n 'dataciteada',\n 'dataciteukda',\n 'dataciteadaptive',\n 'datacitemit',\n 'datacitectsi',\n 'datacitenimh',\n 'nsrr','naturedata','datacitethieme','datacitefigshare','dataciteccdc','wormbase','metabolomics'],\n ];\n}", "function cast_query_results($rs)\n{\n $fields = mysqli_fetch_fields($rs);\n $data = array();\n $types = array();\n foreach ($fields as $field) {\n switch ($field->type) {\n case 3:\n $types[$field->name] = 'int';\n break;\n case 4:\n $types[$field->name] = 'float';\n break;\n default:\n $types[$field->name] = 'string';\n break;\n }\n }\n while ($row = mysqli_fetch_assoc($rs)) {\n array_push($data, $row);\n }\n\n for ($i = 0; $i < count($data); $i++) {\n foreach ($types as $orgname => $type) {\n settype($data[$i][$orgname], $type);\n }\n }\n return $data;\n}", "private function getData($type) {\n switch($type) {\n case \"users\":\n return eF_getTableData($type, implode(\",\", $this -> types), \"archive = 0\");\n case \"users_to_courses\":\n return eF_getTableData(\"users_to_courses JOIN courses ON courses.id = users_to_courses.courses_ID\", implode(\",\", $this -> types), \"\");\n case \"users_to_groups\":\n return eF_getTableData(\"users_to_groups JOIN groups ON groups.id = users_to_groups.groups_ID\", implode(\",\", $this -> types), \"\");\n return eF_getTableData($type, implode(\",\", $this -> types), \"archive = 0\");\n }\n }", "function getAssocArray($sql = null)\n\t{\n\t\t$output = array();\n\t\t$result = $this->query($sql);\n\t\tif($result == true)\n\t\t{\n\t\t\tswitch($this->dbtype)\n\t\t\t{\n\t\t\t\tcase 'mysql':\n\t\t\t\t\t$numrows = @mysql_num_rows($this->resource);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mysqli':\n\t\t\t\t\t$numrows = @mysqli_num_rows($this->resource);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif($numrows > 0)\n\t\t\t{\n\t\t\t\tswitch($this->dbtype)\n\t\t\t\t{\n\t\t\t\t\tcase 'mysql':\n\t\t\t\t\t\twhile ($row = @mysql_fetch_assoc($this->resource))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output[] = $row;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'mysqli':\n\t\t\t\t\t\twhile ($row = @mysqli_fetch_assoc($this->resource))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output[] = $row;\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}\n\t\treturn $output;\n\t}", "abstract public function getRowAsArray();", "public function get_types()\n {\n }", "function rowType($type, $row) {\r\n switch ($row ? $type : false) {\r\n case false: return false;\r\n case PDO::FETCH_NUM: return array_values($row);\r\n case PDO::FETCH_BOTH: return array_merge($row, array_values($row));\r\n case PDO::FETCH_ASSOC: return $row;\r\n case PDO::FETCH_OBJECT: return (object)$row;\r\n }\r\n }", "function getConstructionInfo($conn, $buildingType){\n\tif($buildingType == \"custom\"){\n\t\t$sql = \"SELECT * FROM constructioninfo ORDER BY InfoType\";\n\t}\n\telse{\n\t\t$sql = \"SELECT * FROM constructioninfo WHERE BuildingType = :buildingType ORDER BY InfoType\";\n\t}\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':buildingType', $buildingType, PDO::PARAM_STR, 25);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n\n}", "function getAllByType($tipo) {\n global $dbh, $schema;\n try {\n // using prepared statements will help protect you from SQL injection\n $stmt = $dbh->prepare(\"SELECT * FROM $schema.ingrediente where tipo = :tipo\");\n $stmt->bindParam(':tipo', $tipo);\n\t $stmt->execute();\n // get array containing all of the result set rows \n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n return $result;\n }\n catch(PDOException $e) {\n $_SESSION[\"s_errors\"][\"generic\"][] = \"ERRO[18]: \".$e->getMessage();\n header(\"Location: ../../index.php\");\n die;\n }\n }", "function raw_db_fetch_array($result, $type = SQLITE_BOTH)\r\n{\r\n return sqlite_fetch_array($result, $type);\r\n}", "function get_requests_types(){ \n $query = $this->db->get('type_request');\n return($query->result());\n }", "public function getExttypes(){\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('distinct(type)');\n\t\t\t$query->from('#__extensions');\n\t\t\t$query->where('protected=0');\n\t\t\t$db->setQuery($query);\n\t\t\t$arrDatos = $db->loadRowList();\n\t\t\tif(!$arrDatos){\n\t\t\t\t$arrDatos= array();\n\t\t\t}\n\t\t\treturn $arrDatos;\n\t\t}", "function getSupportType() {\n try {\n $record = $this->db->get_where('tbl_ws_format')->result_array();\n\n $return = array();\n foreach ($record as $key => $val) {\n $return[$key]['formatId'] = (int) $val['iFormatID'];\n $return[$key]['formatName'] = $val['vFormatName'];\n }\n\n if (!empty($return)) {\n return array(\n 'RECORD' => $return,\n 'STATUS' => SUCCESS_STATUS,\n 'MSG' => REC_FOUND\n );\n } return array(\n 'STATUS' => FAIL_STATUS,\n 'MSG' => NO_RECORD\n );\n } catch (Exception $ex) {\n throw new Exception('Error in getSupportType function - ' . $ex);\n }\n }", "public static function getPartRowSetsByType($table = null) {\r\n\t\t$partRowSets = NULL;\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB ();\r\n\t\t\t//$query = \"SELECT * FROM :$table WHERE (\";//= :$id)\";\r\n\t\t\t//$query = \"SELECT * FROM harddrives WHERE (hdriveId = $id)\";\r\n\t\t\t//\"harddrives\", \"hdriveId\", \"1hdd05\"\r\n\t\r\n\t\t\t//if (strcmp($typeid, \"hdriveId\") == 0)\r\n\t\t\t//\t$query = $query.\"hdriveId\";\r\n\t\t\t\t\r\n\t\t\t//$query = $query.\" = :$id)\";\r\n\t\t\t\t\r\n\t\t\t//$query = \"SELECT * FROM harddrives WHERE (hdriveId = '1hdd05')\";\r\n\t\t\t$query = \"SELECT * FROM \".$table.\"\";\r\n\t\r\n\t\t\t$statement = $db->prepare($query);\r\n\t\t\t//$statement->bindParam(\":$table\", $table);\r\n\t\t\t//$statement->bindParam(\":$typeid\", $typeid);\r\n\t\t\t//$statement->bindParam(\":$id\", $id);\r\n\t\t\t$statement->execute ();\r\n\t\t\t\t\r\n\t\t\t$partRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor ();\r\n\t\t} catch (Exception $e) { // Not permanent error handling\r\n\t\t\techo \"<p>Error getting part rows by $type: \" . $e->getMessage () . \"</p>\";\r\n\t\t}\r\n\t\treturn $partRowSets;\r\n\t}", "function getArrDrawArea($draw_tmpl_id, &$rows){\r\n\t\t$bindArr = array();\t//Sequence for search condition\r\n\t\tarray_push($bindArr, $draw_tmpl_id);\r\n\t\t\r\n\t\t$queryStr = \"select \";\r\n\t\t$queryStr .= \"\tm_draw_area.draw_area_id, \";\r\n\t\t$queryStr .= \"\tm_draw_area.cts_type \";\r\n\t\t$queryStr .= \"from \";\r\n\t\t$queryStr .= \"\tm_draw_area \";\r\n\t\t$queryStr .= \"where \";\r\n\t\t$queryStr .= \"\tm_draw_area.draw_tmpl_id = ? and \";\r\n\t\t$queryStr .= \"\tm_draw_area.del_flag = 0 \";\r\n\t\t\r\n\t\treturn $this->selectRecords($queryStr, $bindArr, $rows);\r\n\t}", "function getAccommodationTypes(){\n\t\t$typesTable = $this->getTable(\"HotelAccommodationTypes\");\n\t\treturn $typesTable->getAccommodationTypes();\n\t}", "public function lead_type_list()\n {\n \n $result = $this->db->query(\"call lead_type_list()\")->result();\n \n save_query_in_log();\n return $result;\n }", "abstract protected function getRows();", "function get_all_todos($type,$conn){\n\t$arr_out = array();\n\tif ($type==2) {\n\t\t$stmt_get = \"SELECT `id`,`todo_text`,`completed_flag` FROM `tbl_todo_content` WHERE `completed_flag` IS NULL\";\n\t}elseif($type==3){\n\t\t$stmt_get = \"SELECT `id`,`todo_text`,`completed_flag` FROM `tbl_todo_content` WHERE `completed_flag`IS NOT NULL\";\n\t}elseif($type==1){\n\t\t$stmt_get = \"SELECT id, todo_text, completed_flag FROM tbl_todo_content \";\n\t}else{\n\n\t}\n\n\t$result = $conn->query($stmt_get);\n\n\tforeach ($result as $row) {\n\t\t$arr_out[] = $row;\n\t}\n\treturn $arr_out;\n}", "public function master_provider_type_get()\n{\n $database = Mysql_Database::getInstance(); \n $query = mysql_query(\"select p.product_type_id,p.product_type FROM adj_master_product_types p WHERE p.is_active=1\"); \n //print_r($query);\n $i=0;\n while($row=mysql_fetch_array($query)){\n $data[$i]['product_type_id'] = $row['product_type_id'];\n $data[$i]['product_type'] = $row['product_type'].$row['product_type'];\n \n $i++;\n }\n //print_r($data[0]);\n return $data;\n\n}", "function fn_fetch_array($table,$name){\r\n\t\t\t$query = $this->query(\"select $name from $table where 1 \");\r\n\t\t\t$row = $this->fetch_array($query);\r\n\t\t\treturn $row;\r\n\t\t}", "abstract public function GetRow($query, $type = DBA::ASSOC);", "public function get_all(){\n\t\t\t$query = $this->db->get_where('point_type', array('delete_flag' => 0));\n\n\t\t\t$table= $query->result();\t\t\n\t\t\treturn $table;\n\t\t}", "public function getDataWithTypeLll() {}", "public function getInputTable($type);", "public function generic_template_select($data) {\r\n try {\r\n if (!is_array($data) || empty($data) || count($data) === 0) {\r\n throw new Exception(\"List_model::generic_template_select::invalid array provided for select\", 1);\r\n } else {\r\n # array for returning the results\r\n $return_array = array();\r\n\r\n # set the where clause\r\n $this->db->where($data);\r\n\r\n # select all the fields from the table\r\n $this->db->select(\"*\");\r\n\r\n # get the result in query object\r\n $query = $this->db->get(\"template_master\");\r\n\r\n if ($query->num_rows() > 0) {\r\n foreach ($query->result_array() as $row) {\r\n $return_array[] = $row;\r\n }\r\n $query->free_result();\r\n }\r\n\r\n return $return_array;\r\n }\r\n } catch (Exception $e) {\r\n throw $e;\r\n }\r\n }", "public function getAllPackingType(){\n $this->db->select(\"kubun as type_code,komoku_name_2 as type_name\");\n $this->db->from(\"m_komoku\");\n $this->db->where(\"komoku_id\",\"KM0007\");\n $this->db->where(\"kubun <>\",\"000\");\n $this->db->where('del_flg', '0');\n $query = $this->db->get();\n return $query->result_array();\n }", "function get_rows($keys,$sql_select='*',$type='array',$db_table='') {\r\n $db_table = $db_table == '' ? $this->db_table : $GLOBALS['dbpre'].$db_table;\r\n $sql_where = '';\r\n if ($keys) {\r\n $sql_wheres = array();\r\n foreach ($keys as $key=>$val) {\r\n if (is_array($val)) { //multivalue, handle with sql \"in\" operator\r\n $val2 = array();\r\n foreach ($val as $v) {\r\n if (is_array($v)) die('getrows: array in array does not supported');\r\n $val2[] = \"'$v'\";\r\n }\r\n $val2 = join(',',$val2);\r\n $sql_wheres[] = \"`$key` in ($val2)\";\r\n }\r\n else {\r\n $sql_wheres[] = \"`$key`='$val'\";\r\n }\r\n }\r\n $sql_where = ' where '.join(' and ',$sql_wheres);\r\n }\r\n $sql = 'select '.$sql_select.' from '.$db_table.$sql_where;\r\n\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $rows = array();\r\n if ($type == 'array') {\r\n while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) {\r\n $rows[] = $row;\r\n }\r\n }\r\n else {\r\n while ($row = mysql_fetch_row($res)) {\r\n $rows[] = $row;\r\n }\r\n }\r\n return $rows;\r\n }", "public function getAllProtypes(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM protypes\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "function generateDefaultResult($conn){\n\t$asColumns = \"Total records\";\n\tfor ($i = 0; $i < count($_SESSION['arrCheckedVals']); $i++){\n\t\t$asColumns .= \",{$_SESSION['arrCheckedVals'][$i]}\";\n\t}\n\t\n\t$remainingCols = \"\";\n\tfor ($i = 0; $i < count($_SESSION['arrCheckedVals']); $i++){\n\t\t$remainingCols .= (!isNotFromTable($_SESSION['arrCheckedVals'][$i]))? \",count(*) -1 - sum(case when {$_SESSION['arrCheckedVals'][$i]} is null then 1 else 0 end) as {$_SESSION['arrCheckedVals'][$i]}\" : getQryFromOtherTable($_SESSION['arrCheckedVals'][$i]);\n\t}\n\n\t$query = sprintf(\"SELECT '{$asColumns}' as columns, count(*) - 1 as 'Total records' {$remainingCols} FROM {$_SESSION['table']} \");\n\t$result = $conn->query($query);\n\t$data = array();\n\tforeach ($result as $row) {\n\t\t$data[] = $row;\n\t}\n\t$data[] = (object) array('tableName' => $_SESSION['table']);\n\t$result->close();\n\t\n\treturn $data;\n}", "public function getDataWithTypePage() {}", "public function queryselect() {\r\n // we should load the database (autoload)\r\n $this->load->database();\r\n $query = $this->db->query('SELECT * FROM crud');\r\n return $query->result_array();\r\n //$result = $query->result_array();\r\n //return $result;\r\n }", "function get ()\n\t{\n\t\t$ ret = array ();\n\t\t\n\t\t// Loop por todos os registros no banco de dados\n\t\tfor ( $ x = 0 ; ( $ x < $ this -> num_records () && count ( $ ret ) < $ this -> _limit ); $ x ++)\n\t\t{\t\t\t\n\t\t\t$ row = $ this -> _px -> retrieve_record ( $ x );\n\t\t\t\n\t\t\tif ( $ this -> _test ( $ row ))\n\t\t\t{\n\t\t\t\tforeach ( $ row as $ key => $ val )\n\t\t\t\t{\n\t\t\t\t\t// Encontre todos os campos que não estão na matriz selecionada\n\t\t\t\t\tif (! in_array ( $ key , $ this -> _select ) &&! empty ( $ this -> _select )) unset ( $ row [ $ key ]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$ ret [] = $ linha ;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $ ret ;\n\t}", "abstract protected function report_to_array_mapping();", "function get_row($keys,$sql_select='*',$type='array',$db_table='') {\r\n $db_table = $db_table == '' ? $this->db_table : $GLOBALS['dbpre'].$db_table;\r\n $sql_where = '';\r\n if (is_array($keys) and count($keys) > 0) {\r\n $sql_wheres = array();\r\n foreach ($keys as $key=>$val) {\r\n if (is_array($val)) die('getrow: multi value does not supported');\r\n $sql_wheres[] = \"`$key`='$val'\";\r\n }\r\n $sql_where = ' where '.join(' and ',$sql_wheres);\r\n }\r\n elseif (is_string($keys) and $keys != '') {\r\n $sql_where = ' where '.$keys;\r\n }\r\n $sql = 'select '.$sql_select.' from '.$db_table.$sql_where.' limit 0,1';\r\n #~ echo '<br>'.$sql;\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n if ($type == 'array')\r\n return mysql_fetch_array($res,MYSQL_ASSOC);\r\n else\r\n return mysql_fetch_row($res);\r\n\r\n }" ]
[ "0.6189226", "0.61876917", "0.6186371", "0.61021084", "0.6071037", "0.59617054", "0.59109676", "0.58570224", "0.5828386", "0.5791816", "0.57838017", "0.5776742", "0.57688", "0.57433486", "0.5742774", "0.57050025", "0.5656355", "0.56465846", "0.56465846", "0.5638546", "0.562832", "0.56229645", "0.561526", "0.56032133", "0.5601802", "0.5587949", "0.55620074", "0.5555094", "0.55538213", "0.5545756", "0.55445653", "0.5541375", "0.55402744", "0.553024", "0.5519899", "0.55163836", "0.55132955", "0.55102825", "0.5499145", "0.54970795", "0.54924697", "0.54827595", "0.5482083", "0.54773915", "0.5476212", "0.5454617", "0.5448782", "0.54483044", "0.5436914", "0.5436873", "0.5419479", "0.541672", "0.54114515", "0.54066896", "0.5389148", "0.5387681", "0.53833884", "0.53654665", "0.5355865", "0.53548574", "0.53548574", "0.53502506", "0.53448474", "0.5344051", "0.5343107", "0.534302", "0.5333641", "0.5332238", "0.5329648", "0.5328696", "0.53226346", "0.53118575", "0.5307405", "0.5306459", "0.5294578", "0.52936584", "0.5293494", "0.52894497", "0.5289251", "0.5284801", "0.52818435", "0.5281719", "0.5281266", "0.5274431", "0.5273603", "0.5272127", "0.5271392", "0.5269566", "0.5268174", "0.5264961", "0.52560323", "0.52549976", "0.5251216", "0.5250799", "0.5250175", "0.52494454", "0.52477664", "0.5247284", "0.52453727", "0.52438724", "0.5231654" ]
0.0
-1
Verify the authentication for a user.
public function testAuth() { /** @var \Drupal\users_jwt\UsersJwtKeyRepositoryInterface $key_repository */ $key_repository = $this->container->get('users_jwt.key_repository'); /** @var \Drupal\Core\Extension\ExtensionPathResolver $path_resolver */ $path_resolver = $this->container->get('extension.path.resolver'); $module_path = $path_resolver->getPath('module', 'users_jwt'); $path = $module_path . '/tests/fixtures/users_jwt_rsa1-public.pem'; $public_key = file_get_contents($path); $key_repository->saveKey($this->testUser->id(), 'wxyz', 'RS256', $public_key); $variants = [ 'uid' => $this->testUser->id(), 'uuid' => $this->testUser->uuid(), 'name' => $this->testUser->getAccountName(), ]; foreach ($variants as $id_type => $id_value) { $this->dotestAuth($id_type, $id_value, $module_path); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function doVerification() {\n $this->validate ( $this->request, $this->getRules () );\n $user = $this->_user->where ( StringLiterals::EMAIL, $this->decodeParam ( $this->request->user ) )->where ( 'otp', $this->request->otp )->first ();\n if (count ( $user ) > 0) {\n Auth::loginUsingId ( $user->id );\n return true;\n } else {\n return false;\n }\n }", "public function checkAuthentication() {}", "public function authenticate(){\n $user = $_SERVER['PHP_AUTH_USER'];\n $pass = $_SERVER['PHP_AUTH_PW'];\n\n if(!empty($user) && $this->api_config['allowed_users'][$user] === $pass){\n return True;\n }\n return False;\n }", "private function _checkAuth()\n { if(!(isset($_SERVER['HTTP_X_USERNAME']) and isset($_SERVER['HTTP_X_PASSWORD']))) {\n // Error: Unauthorized\n $this->_sendResponse(401);\n }\n $username = $_SERVER['HTTP_X_USERNAME'];\n $password = $_SERVER['HTTP_X_PASSWORD'];\n // Find the user\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\n if($user===null) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Name is invalid');\n } else if(!$user->validatePassword($password)) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Password is invalid');\n }\n }", "private function verifyAccount()\n {\n $check = $this->db->query('SELECT users.password, users.id FROM users WHERE username = ?', $this->username)->fetchArray();\n //Check of de user in de database staat.\n if (isset($check['password'])) {\n //Check of de password matched\n if (password_verify($this->password, $check['password'])) {\n echo \"AUTH verify complete\";\n $this->setLoggedinUser($check['id']);\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "private function checkUserAuthenticated () {\n if (empty($this->userIdentifier)) {\n #yes 403 - 401 is not appropriate for X509 authentication\n $this->exceptionWithResponseCode(403,\n \"You need to be authenticated to access this resource. \" .\n \"Please provide a valid IGTF X509 Certificate\"\n );\n }\n }", "public function authenticate()\n {\n $credential = $this->getCredential();\n $identity = $this->getIdentity();\n $userObject = $this->getUserObject();\n\n $bcrypt = new Bcrypt();\n $bcrypt->setCost(14);\n\n if (!$bcrypt->verify($this->getCredential(),$userObject->getPassword())) {\n // Password does not match\n return false;\n }\n\n $this->updateIdentity($userObject);\n\n return $this->getAuthResult(AuthenticationResult::SUCCESS, $userObject->getEmail());\n }", "public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }", "function verifyUser ($username, $hash) {\r\n //TO-DO\r\n\r\n //if credentials match return true\r\n\r\n //else return false\r\n\r\n //dummy CODE\r\n return true;\r\n}", "function verifyAuth()\n\t{\n\t\tsanitizeRequest($_POST);\n\t\tsanitizeRequest($_GET);\n\t\t\n\t\t$currentUser = UserService::getInstance()->getCurrentUser();\n\t\tif (!$currentUser || !$currentUser->getSessionId()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$payload = JWT::decode($currentUser->getSessionId(), SERVER_KEY, array('HS256'));\n\t\t\t$sessionId = UserService::getInstance()->getSessionId($currentUser->getId());\n\t\t\tif ($sessionId === $currentUser->getSessionId() &&\n\t\t\t\t\t$currentUser->getId() === $payload->id &&\n\t\t\t\t\t$currentUser->getEmail() === $payload->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} catch (Exception $e) {\n\t\t\tif ($currentUser->isRemember() && $e->getMessage() === 'Expired token') {\n\t\t\t\t$currentUser->extendSession();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "private function authenticate()\n {\n $this->_validator->setCredentials($this->_user, $this->_pass);\n if ($this->_validator->authenticate()) {\n $this->_accepted = true;\n }\n }", "public function auth() {\n\t\t\t// Check if user has not a session\n\t\t\tif (!$this->session->has('user')) return false;\n\n\t\t\t// Get the user from session\n\t\t\t$user = $this->session->get('user');\n\t\t\t$field = array_keys($user)[1] ?? null;\n\t\t\t$value = array_values($user)[1] ?? null;\n\n\t\t\t// If user does not exists\n\t\t\tif (!$this->user->exists($field, $value)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\treturn true;\n\t\t}", "public static function checkUser()\n\t{\n\n\t\tif (!User::verifyLogin())\n\t\t{\n\n\t\t\theader(\"Location: /admin/login\");\n\t\t\texit;\n\n\t\t}\n\n\t}", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "public function checkAuth();", "public function checkAuth();", "public static function checkAuth() {\n if(session(\"auth_token\", null) == null){ return false; }\n \n $apiresponse = ApiController::doRequest(\"GET\", \"/users/me\", [\"bearer\" => session(\"auth_token\")], []);\n if($apiresponse->getStatusCode() == 200) {\n $apibodystr = (string)$apiresponse->getBody();\n $apibody = \\GuzzleHttp\\json_decode($apibodystr);\n session([\"auth_user\" => new User($apibody)]);\n return true; \n }\n \n return false;\n }", "public function isUserAuthenticated () : bool {\n return $this->mainController->isUserAuthenticated();\n }", "public function authenticate()\n {\n /* authenticate if the login credentials are correct */\n $db = Sweia::getInstance()->getDB();\n $args = array(\n \":email\" => $this->getEmail(),\n \":password\" => $this->password\n );\n $sql = \"SELECT email,uid FROM \" . SystemTables::DB_TBL_USER . \" WHERE email = ':email' AND password = ':password' AND status != 4 LIMIT 1\";\n $res = $db->query($sql, $args);\n if ($res && $db->resultNumRows($res) == 1)\n {\n $data = $db->fetchObject($res);\n $this->uid = 1;\n return true;\n }\n\n return false;\n }", "public function validateUser() {\n try {\n $st = $this->con->prepare('SELECT * FROM '.DB_USER_TBL.' WHERE user=?;');\n $st->bindParam(1, $this->username);\n $st->execute();\n \n if($st->rowCount() > 0) {\n $result = $st->fetch(PDO::FETCH_ASSOC);\n \n if( md5($this->password.$result['salt']) == ($result['hash']) ){\n $_SESSION['user_auth'] = true;\n return true;\n \n } else {\n //echo 'Password is incorrect';\n throw new Exception($this->alerts->PASSWORD_WRONG);\n } \n }else{\n //echo 'Username does not exist';\n throw new Exception($this->alerts->USER_DOESNT_EXIST);\n }\n } catch(PDOException $ex) {\n $this->logs->output($ex->getMessage(), $this->alerts->DB_USER_ERROR);\n }\n }", "public function verify_userinfo()\n\t{\n\t\t//load the user model\n\t\t$this->load->model('user');\n\t\t//call login function of user model\n\t\tif ($this->user->login())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse return false;\n\t}", "private function check_auth() {\n if (empty($this->user_id) || empty($this->privatekey)) {\n $this->send_error('AUTH_FAIL');\n exit;\n } elseif ($this->users_model->validate_privatekey($this->user_id, $this->privatekey)) {\n return true;\n }\n }", "public function verify() {\n // Compare session_id as a binary safe string.\n if (strcmp($this->session_id, '0') !== 0) {\n // Session id cookie is set, build the SQL to validate the session id.\n $sql = \"SELECT A.id FROM Users U INNER JOIN Administrators A ON U.id = A.id WHERE session_id = '$this->session_id'\";\n } else {\n // Session id cookie is not set, build the SQL to check the email and password.\n $sql = \"SELECT A.id FROM Users U INNER JOIN Administrators A ON U.id = A.id WHERE email = '$this->email' AND password = '$this->password'\";\n }\n\n // Query the database.\n $results = parent::queryDatabase($sql);\n\n // There should only be one result to the query. If there are any more,\n // something else has failed, default to to fail status - do not grant\n // user access.\n if ($results->num_rows === 1) {\n return True;\n } else {\n return False;\n }\n }", "public function authenticate()\n {\n // Retrieve the user's information (e.g. from a database)\n // and store the result in $row (e.g. associative array).\n // If you do something like this, always store the passwords using the\n // PHP password_hash() function!\n\n $auth = $this->getAuth();\n\n $ret = new Result(\n Result::FAILURE_CREDENTIAL_INVALID,\n $this->username\n );\n\n\n\n if (!isset($auth['verified'])) {\n return $ret;\n }\n if ($auth['verified'] !== true) {\n return $ret;\n }\n if (!empty($auth['password'])) {\n if (password_verify($this->password, $auth['password'])) {\n $ret = new Result(Result::SUCCESS, $auth);\n }\n }\n return $ret;\n }", "public function verify()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n $this->View->Render('verify/verify');\n }", "public function authenticate()\n\t{\n\t if ($this->isAuthenticated) return true;\n\t \n\t\t$username = strtolower($this->username);\n\t $user = User::model()->find('LOWER(username) = ?', array($username));\n\t\t\n\t\tif ($user === null)\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\telseif ($user->password != md5($this->password))\n\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\telse {\n\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t\t$this->_id = $user->id;\n\t\t\t$this->setUserStates($user);\n\t\t\t$user->afterLogin();\n\t\t}\n\t\treturn !$this->errorCode;\n\t}", "public function authenticate()\n\t{\n\n\t\t$username = strtolower($this->username);\n\t\t/** @var $user User */\n\t\t$user = User::model()->with('roles')->find('LOWER(use_username)=?', array($username));\n\t\tif ($user === null) {\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\t} else {\n\t\t\tif (!$user->validatePassword($this->password)) {\n\t\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\t\t} else {\n\t\t\t\t$this->_id = $user->use_id;\n\t\t\t\t$this->username = $user->use_fname;\n\t\t\t\t$this->_branchId = $user->use_branch;\n\t\t\t\t$this->_scope = $user->use_scope;\n\t\t\t\t$this->_roles = $user->roles;\n\n\t\t\t\t$this->userData = serialize($user);\n\n\t\t\t\tYii::app()->user->setState(\"fullname\", $user->getFullName());\n\n\t\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t\t\t$this->loadSessionForOldLogin($user);\n\t\t\t}\n\t\t}\n\t\tLoginLog::model()->log($this, $user);\n\t\treturn $this->errorCode == self::ERROR_NONE;\n\t}", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "public function verify_user() {\n try {\n //Retrieve user name and password from the form in the login form.\n if (filter_has_var(INPUT_POST, 'username') && filter_has_var(INPUT_POST, 'password')) {\n $username = trim(filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING));\n $password = trim(filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING));\n }\n\n if ($username == \"\" || $password == \"\") {\n throw new DataMissingException(\"Please fill in all fields.\");\n }\n\n\n //Get username and password from database.\n $sql = \"SELECT * FROM \" . $this->tblUser . \" WHERE username = '$username'\";\n\n\n $query = $this->dbConnection->query($sql);\n\n //If the query failed, return false. \n if (!$query) {\n throw new DatabaseException(\"There was an error verifying the user.\");\n }\n if ($query->num_rows == 0) {\n throw new InvalidAccountException(\"An account does not exist with that username or password.\");\n }\n\n //Create new user object.\n if ($query->num_rows == 1) {\n $obj = $query->fetch_object();\n\n $user = new User(stripslashes($obj->user_type), stripslashes($obj->firstname), stripslashes($obj->lastname), stripslashes($obj->username), stripslashes($obj->password));\n //set the id for the user.\n $user->setId($obj->id);\n }\n\n //Get user's username, password, firstname, and user type.\n $username_db = $user->getUsername();\n $password_db = $user->getPassword();\n $name = $user->getFirstname();\n $user_type = $user->getUser_type();\n $user_id = $user->getId();\n\n //Set to true if username and password are the pre-created admin/guest account.\n if (($username_db == \"admin\" && $password == \"password\") || ($username_db == \"guest\" && $password == \"password\")) {\n $verify_password = true;\n } else {\n $verify_password = password_verify($password, $password_db);\n }\n\n if ($username != $username_db || !$verify_password) {\n throw new InvalidAccountException(\"An invalid username or password was entered.\");\n }\n\n //If username and password match those in database, return true. Set session with user's first name and their user type.\n if ($username == $username_db && $verify_password) {\n //See if session exists already, if not start one.\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n $_SESSION['user_type'] = $user_type;\n $_SESSION['name'] = $name;\n $_SESSION['user_id'] = $user_id;\n return true;\n }\n } catch (DataMissingException $e) {\n return $e->getMessage();\n } catch (DatabaseException $e) {\n return $e->getMessage();\n } catch (InvalidAccountException $e) {\n return $e->getMessage();\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }", "protected function _checkAndRedirect() {\n $auth = $this->_checkAuthentication();\n if(true === $auth) { // authentication required, redirects to login page\n $user = $this->getCurrentUser();\n if(null === $user) { // user doesn't appear do be logged in\n $this->flashMessenger()->addErrorMessage(IControllerMessages::FATAL_ERROR_NOT_AUTHENTIFICATED);\n $this->redirect()->toRoute(IRouteStore::LOGIN); // break;\n return;\n }\n else {\n \treturn $user;\n }\n }\n else {\n \texit;\n \treturn false;\n }\n }", "public static function check()\n {\n return (new Authenticator(request()))->isAuthenticated();\n }", "public function validateUser()\n {\n if (!$this->session->has(\"user\") || $this->session->get(\"user\") === null) {\n return false;\n }\n\n if ($this->user === null) {\n $this->user = $this\n ->em\n ->getRepository(\"\\AppBundle\\Entity\\User\")\n ->findOneBy([\n \"name\" => $this->session->get(\"user\")\n ]);\n }\n\n if ($this->user === null\n || !hash_equals($this->user->getHash(), $this->session->get(\"user_token\"))\n ) {\n $this->logoutUser();\n return false;\n }\n\n return true;\n }", "private function checkAuth()\n {\n $this->isAuthenticated = false;\n $isLoggedIn = is_user_logged_in();\n\n if ($isLoggedIn) {\n $this->username = wp_get_current_user()->user_login;\n $id = wp_get_current_user()->ID;\n $meta = get_user_meta($id, 'wp_capabilities', false);\n foreach ($meta[0] as $key => $value) {\n $k = strtoupper($key);\n if (($k == $this->PluginRole) or\n ($k == $this->AdminRole)) {\n $this->isAuthenticated = true;\n }\n }\n }\n }", "function verifyAuth(){\n // on the config values. In this case we just check for user 0.\n $query = \"SELECT name FROM users WHERE user_id = 0\";\n try {\n $sth = $this->spdo->prepare($query);\n $sth->execute();\n }\n catch(PDOException $e) {\n endProcess(0,\"Could not get user information because \".pdoError($e));\n }\n if($this->spdo->query(\"SELECT FOUND_ROWS()\")->fetchColumn() != 1)\n return false;\n return true;\n }", "public function checkAuth ()\n {\n if ($this->storage->isAvailable()) {\n if ($this->storage->get(self::$prefix . 'userId') !== NULL) {\n return true;\n } else {\n $this->logout();\n return false;\n }\n }\n\n return false;\n }", "public function isAuthValid() {\n if (is_null($this->getUserId())) {\n return FALSE;\n } else {\n return TRUE;\n }\n }", "public function authenticate(){\n\t\t// also return typeOfUser???\n\n\t\t// if user is logged\n\t\tif($this->model->isUserLogged($this->view->getServerInfo())){\n\t\t\t\n\t\t\t/* Use Case 2 Logging out an authenticated user */\n\t\t\treturn $this->logoutUser();\n\t\t\t\n\t\t// if user wants to register\n\t\t} else if($this->view->userGoRegister()){\n\t\t\t\n\t\t\treturn $this->view->showRegisterPage();\n\t\t\n\t\t// if user tries to save new credentials\n\t\t} else if($this->view->userTryRegister()){\n\t\n\t\t\treturn $this->doRegister();\n\t\n\t\t// if user is out logged and...\n\t\t} else {\n\t\t\t\n\t\t\t// ...has stored credentials\n\t\t\tif($this->view->hasStoredCredentials()){\n\t\t\t\t\n\t\t\t\t/* Use Case 3 Authentication with saved credentials */\n\t\t\t\treturn $this->authCredUser();\n\t\t\t\t\n\t\t\t// ...does not have stored credentials\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t/* Use Case 1 Authenticate user */\n\t\t\t\treturn $this->authUser();\n\t\t\t}\n\t\t}\n\t}", "public function authenticate()\n {\n $query = $this->newQuery()->select('*')->where([\n 'username' => $this->username,\n 'disabled' => 0\n ]);\n\n $userRow = $query->execute()->fetch('assoc');\n\n if (empty($userRow)) {\n return new AuthenticationResult(AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND);\n }\n\n $user = new UserEntity($userRow);\n\n if (!$this->token->verifyHash($this->password, $user->password)) {\n return new AuthenticationResult(AuthenticationResult::FAILURE_CREDENTIAL_INVALID);\n }\n\n return new AuthenticationResult(AuthenticationResult::SUCCESS, $user);\n }", "public function checkAuth() {\n\n /*\n * Dummy stuff - just to test the authentication loop\n */\n if ($_SERVER['PHP_AUTH_USER'] === $this->config['general']['admin']['user'] && $_SERVER['PHP_AUTH_PW'] === $this->config['general']['admin']['password']) {\n return true;\n }\n\n return false;\n }", "public function authenticate() {\n $user = Zebu_User::createInstance($this->username);\n if($user && $this->passhash == $user->passhash){\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS,$this->username);\n }\n return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,$this->username);\n }", "public function authenticate() {\n $user = SysAdminUser::model()->find('LOWER(account)=?', array(strtolower($this->username)));\n if ($user === null){\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n }else if (!$user->validatePassword($this->password)){\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }else {\n $this->_uid = $user->id;\n $this->username = $user->name;\n $this->setUser($user);\n $roleArr = OBJTool::convertModelToArray($user->role);\n if ($roleArr) {\n $role = $roleArr[0]['id'];\n } else {\n $role = NULL;\n }\n $this->setState('__role', $role);\n $this->errorCode = self::ERROR_NONE;\n //Yii::app()->user->setState(\"isadmin\", true);\n }\n return $this->errorCode == self::ERROR_NONE;\n }", "public function authenticate()\n {\n $user = Proxy_users::get()->auth($this->username, $this->password);\n if (!$user) {\n return new Result(Result::FAILURE, null, array(\"The username or password you have entered is incorrect.\"));\n }\n return new Result(Result::SUCCESS, $user->user_id);\n }", "public function signInUser($db) {\n $sqlPassword = \"SELECT passwd FROM users WHERE username = :username\";\n $stmtPassword = $db->prepare($sqlPassword);\n $stmtPassword->bindValue(':username', $this->username, PDO::PARAM_STR);\n $stmtPassword->execute();\n $userData = $stmtPassword->fetch(PDO::FETCH_ASSOC);\n $resCount = count($userData);\n\n if ($resCount != 1) {\n return False;\n }\n \n $hashedPassword = password_verify($this->passwd, $userData['passwd']);\n if (!$hashedPassword) {\n return False;\n } \n\n return True;\n }", "public function verify()\n {\n $userName = $_POST['usuario'];\n $password = $_POST['password'];\n if(!empty($userName) && !empty($password)){\n $user = $this->model->getUser($userName);\n if((!empty($user)) && password_verify($password, $user[0]['password'])) {\n session_start();\n $_SESSION['usuario'] = $user[0]['nombre'];\n $_SESSION['LAST_ACTIVITY'] = time();\n $_SESSION['superAdmin']=$user[0]['superAdmin'];\n header('Location: '.HOME);\n die();\n // $this->controllerProduct->comparativa();\n }\n else{\n echo(\"User pass error\");\n }\n }\n }", "public function authenticate()\n {\n IF($this->strategy !== NULL) {\n RETURN $this->strategy->authenticate();\n }\n\n RETURN FALSE;\n }", "public function isUserValid() {\n $user = self::getUserFromDb($this->login, $this->password, $this->authKey);\n return $user != null;\n }", "protected function shouldAuthenticate($user)\n\t{\n\t\treturn true;\n\t}", "public function is_user_auth(){\n if($this->user_id==auth()->user()->id){\n return true;\n }else{\n return false;\n }\n }", "public function isAuthenticatedSuccessfully(): bool;", "public function verify(){\n \tif(is_null($this->session->userdata('username')) && is_null($this->session->userdata('password'))){\n\t\t\tredirect(base_url());\n\t\t}\n\t\telse{\n\t\t\tif($this->admin_model->verify_user($this->session->userdata('username'),$this->session->userdata('password'))==false){\n\t\t\t\tredirect(base_url());\n\t\t\t}\n\t\t}\n }", "private function checkUser()\n {\n $session = $this->di->get(\"session\");\n\n if (!$session->get(\"activeUser\") && !$session->get(\"username\")) {\n return $this->di->response->redirect(\"user/login\");\n }\n }", "public function AuthenticateUser($name, $password);", "public function authenticate()\n\t{\n\t\tif ($this->hasErrors())\n return; // There are errors already\n\t\t\n $identity = $this->getIdentity();\n if ($identity->ok)\n return; // Authenticate successfully\n \n if (!YII_DEBUG) {\n $this->addError('password','Incorrect email or password.');\n\n } else {\n switch ($identity->errorCode) {\n case UserIdentity::ERROR_USERNAME_INVALID:\n $this->addError('email', 'Invalid email.');\n break;\n\n case UserIdentity::ERROR_PASSWORD_INVALID:\n $this->addError('email', 'Invalid password.');\n break;\n\n default:\n $this->addError('password', 'Unknown UserIdenitity error.');\n break;\n }\n }\n\t}", "public function verifyBeforeLogin(Authenticatable $user): bool\n {\n return $this->verifyUser\n ? call_user_func($this->verifyUser, $user)\n : true;\n }", "public function authenticate( $user, $request, $response ) {\n\t\t// TODO: Implement authenticate() method.\n}", "public static function check()\n {\n if(isset($_SESSION['auth_user'])) {\n return true;\n }\n\n return false;\n }", "public function auth_in_user() {\r\n $user_info = $this->db->where('user', $this->input->post('user'))->get('user')->result();\r\n if($user_info) {\r\n $pswd_hash = $user_info[0]->password;\r\n if(password_verify($this->input->post('pswd'), $pswd_hash)) {\r\n //set session\r\n $this->session->set_userdata(array(\r\n 'id' => $user_info[0]->id,\r\n 'front_name' => $this->details->front_name,\r\n 'isLoggedIn' => true\r\n ));\r\n return true;\r\n }\r\n //wrong psw\r\n return false;\r\n }\r\n //no user\r\n return false;\r\n }", "public function authenticate()\n {\n $user = $this->em->getRepository('Auth\\Entity\\User')\n ->findByLoginAndPassword(\n new User(),\n $this->getStrEmailUser(),\n $this->getStrPasswordUser()\n );\n if ($user) {\n return new Result(Result::SUCCESS, $user, array());\n }\n return new Result(\n Result::FAILURE_CREDENTIAL_INVALID,\n null,\n array('Username ou senha inválidos')\n );\n }", "protected function verify_credentials() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token']\t= $this->conf->TwitterOAuthToken;\r\n\t\t$this->tmhOAuth->config['user_secret']\t= $this->conf->TwitterOAuthSecret;\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'GET', $this->tmhOAuth->url('1.1/account/verify_credentials')\r\n\t\t);\r\n\r\n\t\t// print_r($this->tmhOAuth->response);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$resp = json_decode($this->tmhOAuth->response['response']);\r\n\t\t\t$this->addMsg(\r\n\t\t\t\t'<p>Authourised as ' . $resp->screen_name . '</p>' .\r\n\t\t\t\t'<p>The access level of this token is: ' . $this->tmhOAuth->response['headers']['x-access-level'] . '</p>'\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "public function Authenticate()\n {\n try\n {\n // check if we're already authenticated\n if( !$this->IsAuthenticated() )\n {\n // check for cookie\n if( isset( $_COOKIE[ 'CUTOKENTNG' ] ) )\n {\n // check if the user is valid\n ini_set( 'soap.wsdl_cache_enabled', 0 );\n $oClient = new SoapClient( 'http://login.clemson.edu/authdotnet.php?wsdl' );\n $oResult = $oClient->verifyAuthToken( $_COOKIE[ 'CUTOKENTNG' ] );\n\n // if the user is not valid, redirect them\n if( !empty( $oResult->ERROR ) )\n {\n // redirect to login.clemson.edu\n $this->LoginRedirect();\n }\n else\n {\n // save the user id\n $this->SetUser( $oResult->USERID );\n }\n }\n else\n {\n // redirect to login.clemson.edu\n $this->LoginRedirect();\n }\n }\n }\n catch( Exception $oException )\n {\n throw cAnomaly::BubbleException( $oException );\n }\n }", "public function authenticate()\n\t{\n\t\t$this->record = User::model()->findByAttributes(\n\t\t\tarray(\"username\" => $this->username)\n\t\t);\n\t\t\n\t\t// controleer record\n\t\tif($this->record === null){\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\t}else if($this->record->password !== User::encrypt($this->password)){\n\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\t}else{\n\t\t\t$this->_id = $this->record->id;\n\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t}\n\t\t\n\t\treturn !$this->errorCode;\n\t}", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "private function verifyCookie()\n {\n if (isset($this->cookie['auth'])\n && isset($this->cookie['userid'])\n && !empty($this->cookie['auth'])\n && !empty($this->cookie['userid'])\n && ($this->cookie['userid'] > 0)\n ) {\n $this->db->prepare('SELECT `authSalt` FROM `' . $this->config['authTable'] . '` WHERE `' . $this->config['userColumn'] . '` = ?');\n $this->db->execute(array($this->cookie['userid']), 's');\n $result = $this->db->fetch();\n\n if (!$result) {\n return false;\n }\n\n $dbHash = hash('sha256', $result['authSalt'] . $this->cookie['userid']);\n\n if ($dbHash === $this->cookie['auth']) {\n return true;\n }\n }\n return false;\n }", "public function testAuthenticateUser ()\n {\n $result = $this->storage->authenticateUser($this->accessId1, $this->signature1, $this->stringToSign1);\n $this->assertEquals($this->accessId1, $result['access_key']);\n }", "public function test_if_an_user_can_receive_valid_credentials() {\n $user = $this->createFakerUser($this->credentials);\n \n $this->postJson('/api/v1/auth/login', $this->credentials);\n \n $this->assertAuthenticatedAs($user);\n }", "function authenticationNeeded()\n {\n\n // define all the global variables\n global $user;\n\n // check if user has 2-factor authentication enabled\n if (!$user->twoFactorEnabled()) {\n return false;\n }\n\n // check if secret key has been setup\n if ($user->get2FactorCode() == \"\") {\n return false;\n }\n\n // check if current session has been authenticated\n if (isset($_SESSION[\"authenticated\"])) {\n if ($_SESSION[\"authenticated\"] == true) {\n return false;\n }\n }\n\n // if no errors then ask for authentication\n return true;\n }", "public function validateCredentials(Authenticatable $user, array $credentials): bool;", "public function verifyLoggedUser(): bool\n {\n $sessionUsername = filter_var($this->session->get('log_in_username'), FILTER_SANITIZE_STRING);\n $sessionLogInTime = filter_var($this->session->get('log_in_time'), FILTER_SANITIZE_STRING);\n if (empty($sessionUsername) || empty($sessionLogInTime)) {\n return false;\n }\n\n $user = $this->userModel->getUserByUsernameAndHashedLogInDate($sessionUsername, $sessionLogInTime);\n\n if (empty($user)) {\n return false;\n }\n\n return true;\n }", "public function verify()\n {\n switch ($this->type) {\n default:\n case self::AUTH_BASIC:\n\n if ($authorization = input()->server('HTTP_AUTHORIZATION')) {\n $authentication = unserialize(base64_decode($authorization));\n if ($this->login($authentication[ 'username' ], $authentication[ 'password' ])) {\n return true;\n }\n } else {\n $authentication = $this->parseBasic();\n }\n\n if ($this->login($authentication[ 'username' ], $authentication[ 'password' ])) {\n\n header('Authorization: Basic ' . base64_encode(serialize($authentication)));\n\n return true;\n } else {\n unset($_SERVER[ 'PHP_AUTH_USER' ], $_SERVER[ 'PHP_AUTH_PW' ]);\n $this->protect();\n }\n\n break;\n case self::AUTH_DIGEST:\n if ($authorization = input()->server('HTTP_AUTHORIZATION')) {\n $authentication = $this->parseDigest($authorization);\n } elseif ($authorization = input()->server('PHP_AUTH_DIGEST')) {\n $authentication = $this->parseDigest($authorization);\n }\n\n if (isset($authentication) AND\n false !== ($password = $this->login($authentication[ 'username' ]))\n ) {\n $A1 = md5($authentication[ 'username' ] . ':' . $this->realm . ':' . $password);\n $A2 = md5($_SERVER[ 'REQUEST_METHOD' ] . ':' . $authentication[ 'uri' ]);\n $response = md5(\n $A1\n . ':'\n . $authentication[ 'nonce' ]\n . ':'\n . $authentication[ 'nc' ]\n . ':'\n . $authentication[ 'cnonce' ]\n . ':'\n . $authentication[ 'qop' ]\n . ':'\n . $A2\n );\n\n if ($authentication[ 'response' ] === $response) {\n header(\n sprintf(\n 'Authorization: Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", qop=%s, nc=%s, cnonce=\"%s\", response=\"%s\", opaque=\"%s\"',\n $authentication[ 'username' ],\n $this->realm,\n $authentication[ 'nonce' ],\n $authentication[ 'uri' ],\n $authentication[ 'qop' ],\n $authentication[ 'nc' ],\n $authentication[ 'cnonce' ],\n $response,\n $authentication[ 'opaque' ]\n )\n );\n\n return true;\n }\n }\n\n unset($_SERVER[ 'PHP_AUTH_DIGEST' ], $_SERVER[ 'HTTP_AUTHORIZATION' ]);\n $this->protect();\n\n break;\n }\n\n return false;\n }", "public function authenticate() {\n if ($this->email == null || $this->password == null) {\n return new Result(Result::FAILURE);\n }\n $UserMapper = $this->getServiceLocator()->get(\"Profond\\Mapper\\User\");\n $UserMapper->setServiceLocator($this->getServiceLocator());\n $User = $UserMapper->getOneUserByEmail($this->email);\n if ($User != null) {\n if ($this->password == $User->getPassword()) {\n return new Result(Result::SUCCESS, $User);\n } else {\n return new Result(Result::FAILURE_CREDENTIAL_INVALID, null);\n }\n } else {\n return new result(Result::FAILURE_IDENTITY_NOT_FOUND, null);\n }\n }", "public function verifyUser($user) {\n\t\tif ($user == \"\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn ($user == $_GET[\"userid\"]);\n\t}", "public function isAuthenticated(): bool {\n return $this->check('id');\n }", "public function checkPreAuth(UserInterface $user);", "public function testUserCanAuthenticate()\n {\n $password = 'test';\n\n $user = User::factory()->create([\n 'password' => bcrypt($password)\n ]);\n\n $response = $this->json('POST', '/api/v1/login', [\n 'email' => $user->email,\n 'password' => $password\n ]);\n\n $response->assertStatus(200);\n }", "function authenticateUser() {\n\t\tif(!isset($_SESSION[\"authenticated\"])) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\telse{\n\t\t\t//checking session variable has info \n\t\t\tif($_SESSION[\"authenticated\"] != true){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\n\t}", "public function check(): ?User\n {\n $session = \\Config\\Services::session();\n\n // If false, then the user isn't logged in\n if (!$session->get(service('settings')->get('RestFul.authSource')[$this->method])) {\n throw AuthenticationException::forInvalidCredentials();\n }\n\n return $this->checkLogin($session->get(service('settings')->get('RestFul.authSource')[$this->method]));\n }", "private function checkUser($_AdUser)\n {\n //get the user path from config\n $u = config('azureAdAuth.user_model');\n $theUser = $u::where('email', $_AdUser->userPrincipalName)->first();\n if($theUser == null){\n // create the user\n $usr = new $u();\n $usr->email = $_AdUser->userPrincipalName;\n $usr->name = $_AdUser->displayName;\n $usr->password = Hash::make($_AdUser->id);\n $usr->save();\n\n $theUser = $usr;\n }\n Auth::login($theUser);\n return Auth::check();\n }", "public function verify($user_name, $password)\n {\n $this->db->where('username', $user_name);\n $this->db->where('password', $password);\n $query = $this->db->get('administrators');\n\n if($query->result())\n {\n return true;\n }\n }", "public static function checkAuthentication() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::checkAuthentication();\t\t\n\t}", "public function validateUser(){\n\t\t$user = $this->auth->user();\n\t\tif(!$user) {\n\t\t\t$responseArray = [\n\t\t\t\t'message' => 'Not authorized. Please login again',\n\t\t\t\t'status' => false\n\t\t\t];\n\n\t\t\treturn response()->json($responseArray)->setStatusCode(403);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$responseArray = [\n\t\t\t'message' => 'User is authorized',\n\t\t\t'status' => true\n\t\t\t];\n\n\t\t\treturn response()->json($responseArray)->setStatusCode(200);\n\t\t}\n\t}", "public function authenticate() {}", "public function isAuthenticated()\n {\n return $this->getUser() !== null;\n }", "private function _getAuth()\n {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Sorry this action is not allowed for you';\n return false;\n } else {\n \n if ($_SERVER['PHP_AUTH_USER'] == 'testUser' && $_SERVER['PHP_AUTH_PW'] == 'testPassword') {\n return true;\n }\n \n return false;\n \n }\n }", "protected function verifyAccess($user){\n\t\treturn true; \n\t}", "function checkLogin () {\r\n //check is session has user\r\n if (isset($_SESSION['user'])) {\r\n //check if the credentials match\r\n if (verifyUser($_SESSION['user']['name'], $_SESSION['user']['hash'])) {\r\n return true;\r\n }\r\n }\r\n //returns false by default\r\n return false;\r\n}", "public function authenticate() {\n\t\t \n\t\t$db = db_connect();\n $query= \"SELECT * FROM users WHERE username=:username AND password=:password\";\n $statement=$db->prepare($query);\n $statement->execute(array(\n 'username' => $_POST['username'],'password' => $_POST['password']\n ));\n $count=$statement->rowCount();\n if($count>0){\n $_SESSION['username']=$_POST['username'];\n $_SESSION['is authenticated']= true;\n\t\t}\n }", "public function authenticate() {\n $users = Users::model()->findByAttributes(array('username' => $this->username));\n if ($users == null) {\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n } else if (!$users->validatePassword($this->password)) {\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } else {\n $this->_id = $users->id;\n $this->setState('role_id', $users->role_id);\n $this->setState('role_name', $users->rRole->role_name);\n $this->setState('agent_id', $users->getAgentId());\n $this->setState('agent_id_array', $users->getAgentIds());\n $this->saveParamToSession($users);\n $this->errorCode = self::ERROR_NONE;\n }\n return !$this->errorCode;\n }", "public function authenticate() {\n \n $user = UserMaster::model()->findByAttributes(array('user_name' => $this->username));\n if ($user === null) { // No user found!\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n } else if ($user->user_pass !== base64_encode($this->password)) { // Invalid password!\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } else {\n /**\n * @desc: Start the Session Here\n */\n $session = new CHttpSession;\n $session->open();\n /**\n * @desc: User Full Name\n */\n $session[\"fullname\"] = ucfirst($user->first_name);\n /**\n * @desc: User ID\n */\n $session[\"uid\"] = $user->u_id;\n /**\n * @desc: User Role Id for ACL Management\n */\n $session[\"rid\"] = $user->ur_id;\n /**\n * @desc : User name\n */\n $session[\"uname\"] = $user->first_name;\n $this->setState('id', $user->ur_id);\n $this->errorCode = self::ERROR_NONE;\n }\n return !$this->errorCode;\n }", "public function checkCredentials()\n\t{\n\t\t$user = $this->_getLoggedUser();\n\t\tif (null === $user) {\n\t\t\t$_SESSION['url'] = $_SERVER['REQUEST_URI'];\n\t\t\t$this->redirectTo();\n\t\t}\n\t\treturn $user;\n\t}", "function authenticate()\n {\n if(!$this->Session->check('User'))\n {\n $this->redirect(array('controller' => 'Users', 'action' => 'login_form'));\n exit();\n }\n }", "public function check()\n {\n // Use dummy user for auth while in debug mode, make sure to disable this in production\n if (env('APP_DEBUG') && env('USE_DEMO_USER')) {\n $this->setUser(new FirebaseUser('Test User', 'ABZ-TU', '[email protected]', ''));\n return true;\n }\n $publicKeyURL = 'https://www.googleapis.com/robot/v1/metadata/x509/[email protected]';\n $kids = json_decode(file_get_contents($publicKeyURL), true);\n\n $parser = new AuthHeaders();\n $token = $parser->parse($this->request);\n if ($token) {\n try {\n $decoded = JWT::decode($token, $kids, array('RS256'));\n\n if ($decoded->iss !== config('firebase.iss')) {\n throw new \\Exception;\n }\n $name = property_exists($decoded, 'name') ? $decoded->name : '';\n $email = property_exists($decoded, 'email') ? $decoded->email : '';\n $image = property_exists($decoded, 'picture') ? $decoded->picture : '';\n\n // fetch user associated with given firebase user in our database,\n // check if the user is blocked or not, if blocked return 417 error code\n $profile = UserProfile::where('user_id', $decoded->user_id)->first();\n if ($profile && $profile->is_blocked) {\n // handle blocked user, this exception will be catched by HttpException below\n abort(417);\n }\n\n $firebaseUser = new FirebaseUser($name, $decoded->user_id, $email, $image);\n $this->setUser($firebaseUser);\n return true;\n } catch (HttpException $ex) {\n // handle blocked user\n abort(417);\n } catch (\\Exception $ex) {\n throw new BadRequestHttpException('token_invalid');\n }\n }\n throw new BadRequestHttpException('token_not_provided');\n }", "public static function verify_user($username, $password){\n global $db;\n \n $username = $db->escape_string($username);\n $password = $db->escape_string($password);\n \n $query = \"SELECT * FROM \". self::$db_table .\" WHERE \";\n $query .= \"username = '$username'\";\n \n $user_found = User::makeQuery($query);\n \n $user = array_shift($user_found);\n \n if($user){\n \n // check if there is a password_hash\n if($user->password_hash !== \"\"){\n \n if(!password_verify($password, $user->password_hash))\n return false;\n }else{\n \n if($password !== $user->password)\n return false;\n \n // set a password hash if there is no one\n $user->password_hash = $user->set_password_hash($password);\n $user->save();\n }\n return $user;\n }\n return false;\n }", "protected function authenticated() {\n $user = \\Auth::user();\n\n $query = DB::table('client_users_rel as cur')\n ->select('c.client_key')\n ->join('clients as c', 'c.id', '=', 'cur.client_id')\n ->where('cur.user_id', '=', $user->id)\n ->first();\n\n if (!isset($query->client_key))\n return false;\n\n DBConnection::setSessionDBparams($query->client_key);\n DBConnection::setDBconnection();\n\n return $this->authUserInClientDB();\n }", "function authenticate() {}", "private function authenticate() {\n\t\t//we do not need a session, so we don't need to have unnused db-entries in session db\n\t\tsession_destroy();\n\n\t\t$token = FormUtil::getPassedValue('token', null, 'GETPOST');\n\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($token == $this->getVar('Authtoken') && $this->getVar('Authtoken') != null && ($addr == $this->getVar('AllowedHost') || $this->getVar('AllowedHost') == '*')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\techo 'You are a hacker, right?';\n\t\t\texit();\n\t\t}\n\t}", "public function authenticateUser(string $userName, string $password) : bool {\n $result = false;\n foreach ($this->users as $user => $value) {\n if ($userName == $value[self::$usernameVal] && $this->verifyHashedPassword($value[self::$passwordVal], $password)) {\n $result = true;\n }\n }\n return $result;\n }", "public function authenticate()\n {\n if (!$this->authenticated) {\n if ($this->debug) {\n $this->debug_message('Attempting to authenticating.');\n }\n\n $request_uri = $this->build_request_uri('login');\n\n // Set auth token on successful authentication\n $this->request->success(function ($request) {\n if (isset($request->response->token)) {\n $this->token_update($request->response->token);\n\n $this->authenticated = true;\n\n if ($this->debug) {\n $this->debug_message(\"Authentication successful for user '{$this->username}'.\");\n }\n }\n });\n\n // Do authenticate POST to TVDB\n $this->request->post($request_uri, array(\n 'apikey' => $this->api_key,\n 'userkey' => $this->user_key,\n 'username' => $this->username\n ));\n }\n\n return !!$this->authenticated;\n }", "public function authIsOk() {\n return $this->userID !== 0;\n }" ]
[ "0.74501073", "0.71702045", "0.7142579", "0.70298433", "0.69589067", "0.6958328", "0.69259673", "0.68833214", "0.6811452", "0.6781231", "0.67470074", "0.6729156", "0.67122096", "0.67099416", "0.66835546", "0.66835546", "0.6677922", "0.6642837", "0.66400105", "0.663029", "0.66223556", "0.6621171", "0.6617948", "0.6604386", "0.65998924", "0.65886456", "0.65766925", "0.6568931", "0.65645456", "0.65275", "0.65124667", "0.65053815", "0.649244", "0.648741", "0.64512616", "0.64294195", "0.6418062", "0.6407701", "0.63789135", "0.63752496", "0.6374386", "0.63707054", "0.63615704", "0.6352852", "0.6340347", "0.63321066", "0.6318548", "0.63178927", "0.6311303", "0.6309371", "0.63003737", "0.62995136", "0.62978286", "0.62914306", "0.62882125", "0.62854695", "0.6283217", "0.6274741", "0.62728333", "0.62649477", "0.6261488", "0.62591404", "0.62591404", "0.62591404", "0.62591404", "0.6233065", "0.6232475", "0.6216167", "0.62134415", "0.6200495", "0.61995757", "0.6191575", "0.6189155", "0.6186619", "0.61673", "0.61585087", "0.61541677", "0.6151586", "0.6149949", "0.614963", "0.6147501", "0.6141914", "0.6141142", "0.6139882", "0.6138891", "0.61388093", "0.61359036", "0.6130123", "0.6128043", "0.61273426", "0.61259925", "0.6118187", "0.6111216", "0.61093116", "0.61084765", "0.609793", "0.60972613", "0.60958713", "0.60916764", "0.6086321", "0.6085718" ]
0.0
-1
Test a combination of user ID type and value as the claim.
protected function dotestAuth(string $id_type, string $id_value, string $module_path) { $iat = \Drupal::time()->getRequestTime(); $good_payload = [ 'iat' => $iat, 'exp' => $iat + 1000, 'drupal' => [ $id_type => $id_value, ], ]; $path = $module_path . '/tests/fixtures/users_jwt_rsa1-private.pem'; $private_key = file_get_contents($path); /** @var \Drupal\Core\Authentication\AuthenticationProviderInterface $auth_service */ $auth_service = $this->container->get('users_jwt.authentication.jwt'); $other_account = $this->createUser(['access content']); foreach (['Authorization', 'JWT-Authorization'] as $header) { $token = JWT::encode($good_payload, $private_key, 'RS256', 'wxyz'); $this->assertNotEmpty($token); // Bearer token is ignored. $request = Request::create('/'); $request->headers->set($header, 'Bearer ' . $token); $this->assertFalse($auth_service->applies($request)); // Empty token is ignored. $this->assertFalse($auth_service->applies($this->createRequest($header, ''))); // Good token applies. $request = $this->createRequest($header, $token); $this->assertTrue($auth_service->applies($request)); $user = $auth_service->authenticate($request); $this->assertNotEmpty($user); $this->assertEquals($this->testUser->id(), $user->id()); // When blocked the account is no longer valid. $this->testUser->block()->save(); $this->assertNull($auth_service->authenticate($request)); $this->testUser->activate()->save(); // Payload with more claims is accepted. $extra_payload = $good_payload + ['iss' => 'test', 'hello' => 'world']; $token = JWT::encode($extra_payload, $private_key, 'RS256', 'wxyz'); $this->assertNotEmpty($auth_service->authenticate($this->createRequest($header, $token))); // JWT with a non-existent key ID is rejected. $token = JWT::encode($good_payload, $private_key, 'RS256', 'foo'); $this->assertNull($auth_service->authenticate($this->createRequest($header, $token))); // JWT with no key ID is rejected. $token = JWT::encode($good_payload, $private_key, 'RS256'); $this->assertNull($auth_service->authenticate($this->createRequest($header, $token))); // User ID that does not match the key's user ID is rejected. $payload = $good_payload; $payload['drupal']['uid'] = $other_account->id(); $token = JWT::encode($payload, $private_key, 'RS256', 'wxyz'); $this->assertNull($auth_service->authenticate($this->createRequest($header, $token))); // Payload missing iat is rejected. $payload = $good_payload; unset($payload['iat']); $token = JWT::encode($payload, $private_key, 'RS256', 'wxyz'); $this->assertNull($auth_service->authenticate($this->createRequest($header, $token))); // Payload missing exp is rejected. $payload = $good_payload; unset($payload['exp']); $token = JWT::encode($payload, $private_key, 'RS256', 'wxyz'); $this->assertNull($auth_service->authenticate($this->createRequest($header, $token))); // Payload with too large iat to exp is rejected. $payload = $good_payload; $payload['exp'] += 24 * 3600; $token = JWT::encode($payload, $private_key, 'RS256', 'wxyz'); $this->assertNull($auth_service->authenticate($this->createRequest($header, $token))); // JWT with HMAC algorithm is rejected. $token = JWT::encode($good_payload, $private_key, 'HS256', 'wxyz'); $this->assertNull($auth_service->authenticate($this->createRequest($header, $token))); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function val_user_identity($value) {\n $value = strtolower($this->input->prepare_user_identity_phone($value));\n if (empty($value)) return false;\n\n $this->load->model('user_model');\n if ($this->user_model->is($value) || $this->user_model->is_dod($value)) return false;\n \n return true;\n }", "function validateUser($currentUser, $currentUserType){\n return $currentUserType==\"applicant\";\n }", "function userType() {\n if (isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'doctor' ) {\n\t\treturn 2;\n\t}else if(isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'patient' ) {\n return 3;\n }else if(isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'guardian' ) {\n return 4;\n }\n}", "public static function getUserTypeIDValue($userType)\n {\n $conn = new MySqlConnect();\n $id;\n\n $userType = $conn -> sqlCleanup($userType);\n // query the db for the value comparison\n\n $result = $conn -> executeQueryResult(\"SELECT userTypeID FROM userTypes WHERE userTypeName = '{$userType}'\");\n // use mysql_fetch_array($result, MYSQL_ASSOC) to access the result object\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n // access the password value in the db\n $id = $row['userTypeID'];\n }\n $conn -> freeConnection();\n return $id;\n }", "public function handleVerifyIdentityCard($userId, $type)\n {\n switch ($type) {\n case StatusConstant::IDENTITY_ACCEPT_STATUS:\n $user = $this->userRepo->find($userId);\n if ($user->input_refferal_code) {\n $userRefferal = $this->userRepo->findWhere(['referral_code' => $user->input_refferal_code])->first();\n if ($userRefferal) {\n $this->handleBonusReferral($userId, StatusConstant::BONUS_TYPE_INPUT_REFFERAL, $userRefferal->id);\n $this->handleBonusReferral($userRefferal->id, StatusConstant::BONUS_TYPE_REFFERAL, $userId);\n }\n }\n $this->userRepo->updateIdentityStatus($userId, StatusConstant::IDENTITY_ACCEPT_STATUS);\n $this->noticesService->noticeVerifyIdentityCard(StatusConstant::IDENTITY_ACCEPT_STATUS, $userId);\n break;\n case StatusConstant::IDENTITY_REJECT_STATUS:\n $this->IDRepo->removeIdentityCard($userId);\n $this->userRepo->updateIdentityStatus($userId, StatusConstant::IDENTITY_REJECT_STATUS);\n $this->noticesService->noticeVerifyIdentityCard(StatusConstant::IDENTITY_REJECT_STATUS, $userId);\n break;\n default:\n break;\n }\n }", "public function getUserType();", "public function getUserType();", "function authUsers($userType, Request $request, Response $response) {\n $authHeader = $request->getHeader('Authorization');\n list($jwt) = sscanf($authHeader[0], 'Bearer %s');\n if ($jwt) {\n try {\n $data = getTokenData($request);\n if (in_array($data[Constants::USERS_FLD_USER_TYPE], $userType)) {\n return true;\n } else {\n return false;\n }\n } catch (Exception $e) {\n return false;\n }\n } else {\n return false;\n }\n return false;\n}", "public function typeOfUser($userId) {\n if(preg_match('/^[0-9]{6}$/',$userId)) {\n $type = 'student';\n } elseif (preg_match('/^[A-Za-z]{4}$/',$userId)) {\n $type = 'employee';\n } elseif (preg_match('/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/',$userId)) {\n $type = 'emailAddress';\n } elseif (preg_match('/\\w*assignment\\b/', $userId)) {\n $type = 'assignments';\n } else {\n $type = 'unknown';\n }\n return $type;\n }", "function hook_openid_connect_userinfo_claim_alter(&$claim_value, array $context) {\n // Alter only, when the claim comes from the 'generic' identiy provider and\n // the property is 'telephone'.\n if (\n $context['plugin_id'] != 'generic'\n || $context['property_name'] != 'telephone'\n ) {\n return;\n }\n\n // Replace international number indicator with double zero.\n str_replace('+', '00', $claim_value);\n}", "public function getUserType($user_type){\n\n $user_type = strtolower($user_type);\n\n $user = \"NONE\";\n\n if($user_type === 'individual'){\n\n $user = \"INDIVIDUAL\";\n\n }else if($user_type === 'agent'){\n\n $user = \"AGENT\";\n\n }else if($user_type === 'builder'){\n\n $user = \"AGENT\";\n\n }else if($user_type === 'owner'){\n\n $user = \"OWNER\";\n\n }\n\n return $user;\n\n }", "public function set_id_user($value = \"\")\n {\n $this->_id_user = \\helpers\\Validator::valInt('f_id_user', $value, TRUE);\n }", "public static function findByUserId($userId, $type, $checkExpiration = true)\n {\n return static::findUserToken(['user_id' => $userId, 'type' => $type], $checkExpiration);\n }", "function auth_user($type = 'general')\n\t{\n\t\tif($type != 'general' && isset($_SESSION['uid']))\n\t\t\tswitch($type)\n\t\t\t{\n\t\t\t\tcase 'webpagemanager': \n\t\t\t\t\t\tif($_SESSION['uType'] == 'webpagemanager' || $_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'dataentryoperator': \n\t\t\t\t\t\tif($_SESSION['uType'] == 'dataentryoperator' || $_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'salesmanager': \n\t\t\t\t\t\tif($_SESSION['uType'] == 'salesmanager' || $_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 'super':\n\t\t\t\t\t\tif($_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\n\t\t\t\tdefault: return false;\n\t\t\t}\n\t\t\n\t\tif(isset($_SESSION['uid'])) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function got_permission_value($user_id, $key)\n\t{\t\n\t}", "function user_type_check($user) {\n\n $user = User::find($user);\n\n if($user) {\n\n // User need subscripe the plan\n\n if(Setting::get('is_subscription')) {\n\n $user->user_type = 0;\n\n } else {\n // Enable the user as paid user\n $user->user_type = 1;\n }\n\n $user->save();\n\n }\n\n}", "public function validateType(GDT_Form $form, GDT $field, $value)\n\t{\n\t if ($user = GDO_User::getByLogin($value))\n\t {\n\t if (!$user->isMember())\n\t {\n \t return $field->error('err_user_type', [t('enum_member')]);\n\t }\n\t }\n\t return true;\n\t}", "function checkToken($type,$token,$userid){\n\tif(trim($type) == ''\n\t\t|| trim($token) == ''\n\t\t|| trim($userid) == ''\n\t){\n\t\treturn false;\n\t}\n\tif($type == DUDU_DRIVER){\n\t\t$table = API_TABLE_PRE.'driver_token';\n\t\t$conditionUseridColumn = 'did';\n\t}elseif ($type == DUDU_PASSENGER){\n\t\t$table = API_TABLE_PRE.'passenger_token';\n\t\t$conditionUseridColumn = 'pid';\n\t}else{\n\t\treturn false;\n\t}\n\t$sql = 'select token from '.$table.' where '.$conditionUseridColumn.' = '.$userid;\n\t$rs = myDoSqlQuery($sql);\n\t$tokenInfo = pg_fetch_assoc($rs);\n\tif($tokenInfo['token']==$token){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function setUserid($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_90'));\n\t\tif(!Validator::AccountId($value)) throw new Exception(lang('error_90'));\n\t\t\n\t\t$this->_userid = $value;\n\t}", "abstract protected function isSocialUser($type);", "function test_field_specific_search_on_user_id_field() {\n\n\t\t// Username. Three matching entries should be found.\n\t\t$search_string = 'admin';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// UserID number. Three matching entries should be found.\n\t\t$search_string = '1';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// UserID number. No matching entries should be found.\n\t\t$search_string = '7';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}", "public function testIdentifyUserWithOauthTokenTypeSetsUserIdForValidHeader()\n {\n $request = new Request($this->config, ['HTTPS' => 'on']);\n $mockOauth = $this->getMockBuilder(OAuthModel::class)->disableOriginalConstructor()->getMock();\n $mockOauth->expects($this->once())\n ->method('verifyAccessToken')\n ->with('authPart')\n ->willReturn('TheUserId');\n\n $request->setOauthModel($mockOauth);\n\n $request->identifyUser('oauth authPart');\n\n $this->assertEquals('TheUserId', $request->user_id);\n $this->assertEquals('TheUserId', $request->getUserId());\n }", "public function user_type_fun($type){\n\t\tif($type == 'R'){\n\t\t\t$st = 'Recruiter';\n\t\t}else if($type == 'AH'){\t\n\t \t\t$st = 'Account Holder';\n\t\t}else if($type == 'Recruiter'){\t\n\t \t\t$st = 'R';\n\t\t}else if($type == 'Account Holder'){\t\n\t \t\t$st = 'AH';\n\t\t}\n\t\treturn $st;\n\t}", "function securityValidation($id){\n\t\n$level_sql = \"SELECT * FROM user WHERE id = '$id'\";\n$level_query = mysql_query($level_sql);\n$row_level = mysql_num_rows($level_query);\n$rs_level = mysql_fetch_object($level_query);\n\nif( $row_level == 1){\n\t$sec = $rs_level->user_type;\n}else{\n$sec = false;\t\n}\n\nreturn $sec;\n}", "public static function validate($value, $type)\n {\n switch ($type) {\n case 'email':\n case 'user_name':\n case 'login':\n case 'body':\n case 'required':\n return !empty($value);\n case 'alphabets':\n preg_match('/^[a-zA-Z]*$/', $value, $matches);\n return !empty($value) && $matches[0];\n case 'numbers':\n preg_match('/^[0-9]*$/', $value, $matches);\n return !empty($value) && $matches[0];\n case 'date(m/d/y)':\n $array = explode(\"/\", $value);\n return !empty($value) && checkdate($array[0], $array[1], $array[2]);\n case 'date(m-d-y)':\n $array = explode(\"-\", $value);\n return !empty($value) && checkdate($array[0], $array[1], $array[2]);\n case 'date(d/m/y)':\n $array = explode(\"/\", $value);\n return !empty($value) && checkdate($array[1], $array[0], $array[2]);\n case 'date(d.m.y)':\n $array = explode(\".\", $value);\n return !empty($value) && checkdate($array[1], $array[0], $array[2]);\n case 'date(d-m-y)':\n $array = explode(\"-\", $value);\n return !empty($value) && checkdate($array[1], $array[0], $array[2]);\n case 'past':\n return !empty($value) && strtotime($value) < strtotime('now');\n case 'present':\n return !empty($value) && strtotime($value) === strtotime('now');\n case 'future':\n return !empty($value) && strtotime($value) > strtotime('now');\n default:\n return false;\n }\n }", "function got_permissions_value($user_id, $key)\n\t{\t\n\t}", "public function userIs($id)\r\n\t{\r\n\t\t$userIs = array();\r\n\t\t$userIs['id'] = $id;\r\n\t\t$userIs['country'] = JUserHelper::getProfile($id)->gizprofile[country];\r\n\t\t$userIs['groups'] = JUserHelper::getUserGroups($id);\r\n\t\t$userIs['name'] = JFactory::getUser($id)->name;\r\n\t\t\r\n\t\t$AppGroups['admin'] = &JComponentHelper::getParams('com_costbenefitprojection')->get('admin');\r\n\t\t$AppGroups['country'] = &JComponentHelper::getParams('com_costbenefitprojection')->get('country');\r\n\t\t$AppGroups['service'] = &JComponentHelper::getParams('com_costbenefitprojection')->get('service');\r\n\t\t$AppGroups['client'] = &JComponentHelper::getParams('com_costbenefitprojection')->get('client');\r\n\r\n\t\t$admin_user = (count(array_intersect($AppGroups['admin'], $userIs['groups']))) ? true : false;\r\n\t\t$country_user = (count(array_intersect($AppGroups['country'], $userIs['groups']))) ? true : false;\r\n\t\t$service_user = (count(array_intersect($AppGroups['service'], $userIs['groups']))) ? true : false;\r\n\t\t$client_user = (count(array_intersect($AppGroups['client'], $userIs['groups']))) ? true : false;\r\n\t\t\r\n\t\tif ($admin_user){\r\n\t\t\t$userIs['type'] = 'admin';\r\n\t\t} elseif ($country_user){\r\n\t\t\t$userIs['type'] = 'country';\r\n\t\t} elseif ($service_user){\r\n\t\t\t$userIs['type'] = 'service';\r\n\t\t} elseif ($client_user) {\r\n\t\t\t$userIs['type'] = 'client';\r\n\t\t\t$userIs['service'] = JUserHelper::getProfile($id)->gizprofile[serviceprovider];\r\n\t\t}\r\n\t\t\r\n\t\treturn $userIs;\r\n\t}", "public function checkCode(TwoFactorInterface $user, $code);", "public function setIduser($value)\n {\n $this->iduser = $value;\n }", "public function checkCode(User $user, $code);", "function validateUser($id, $key)\n{\n\n if (!isset($id, $key)) return false;\n\n $valid_users = array(\n 'demo' => 'TEST_USER_SOFTWARE_KEY'\n );\n\n return (array_key_exists($id, $valid_users) && $valid_users[$id] == $key);\n}", "public function userIsProfessor($user_id){\n $user_temp = Users::find($user_id);\n return !empty($user_id) && $user_temp && $user_temp['type'] == 1;\n }", "public function userIsProfessor($user_id){\n $user_temp = Users::find($user_id);\n return !empty($user_id) && $user_temp && $user_temp['type'] == 1;\n }", "function userIdExists($id) {\n return valueExists('users', 'id', $id);\n}", "public function test($type, $value = null)\n {\n return $this->tokens[$this->current]->test($type, $value);\n }", "function caldol_bxcft_show_field_value($value_to_return, $type, $id, $value){\n\n if ($type == 'email') {\n return $value;\n }\n return $value;\t\n}", "public static function makeTokenInvalid($user_id, $type)\n {\n }", "function updateMemberType($userId, $userType) {\r\n $sql = $this->db->prepare(\"UPDATE USER SET type=:user_type WHERE UserID=:user_id\");\r\n $sql->execute(array(\r\n 'user_type' => $userType,\r\n 'user_id' => $userId,\r\n ));\r\n return true;\r\n }", "function check( $value, $type='text' )\n {\n return Pgg_Validate::is( $value, $type );\n }", "function validate($userType=''){\n if(isset($_SESSION['user'])){\n return $_SESSION['user'];\n }else{\n return false;\n }\n }", "private function conditional_hit_type($field, $value) {\n\n\t\tswitch ($field) {\n\n\t\t\tcase 't':\n\t\t\t\tif ($value == 'event') {\n\t\t\t\t\t$this->add_mandatory_parameter('ec');\n\t\t\t\t\t$this->add_mandatory_parameter('ea');\n\t\t\t\t}\n\t\t\t\tif ($value == 'screenview')\n\t\t\t\t\t$this->add_mandatory_parameter('sn');\n\t\t\t\tbreak;\n\n\t\t\tcase 'qt':\n\t\t\t\tif ($value > $this->_qt_max) {\n\t\t\t\t\techo \"qt is too high </br>\\n\";\n\t\t\t\t\treturn False;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n//We assume that wci means wui in the spec\n\t\t\tcase 'wui':\n\t\t\t\t$userList = new UserList;\n\t\t\t\tif (!in_array($value, $userList->get_userlist())) {\n\t\t\t\t\techo \"User unknown </br>\\n\";\n\t\t\t\t\treturn False;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn True;\n\t}", "protected function setUser($user, $type) {\n\t\t$id = 0;\n\t\tif($user === true) $user = $this->wire('user');\n\t\tif(is_object($user)) {\n\t\t\tif($user instanceof NullPage) {\n\t\t\t\t$id = 0;\n\t\t\t} else if($user instanceof User) {\n\t\t\t\t$id = $user->isGuest() ? 0 : $user->id;\n\t\t\t}\n\t\t} else if(is_int($user)) {\n\t\t\t$id = $user;\n\t\t} else if(ctype_digit($user)) {\n\t\t\t$id = (int) $user;\n\t\t} else if(is_string($user)) {\n\t\t\t$name = $this->wire('sanitizer')->pageName($user);\n\t\t\t$user = $name ? $this->wire('users')->get(\"name=$name\") : null; \n\t\t\t$id = $user && $user->id ? $user->id : 0;\n\t\t}\n\t\tif($id < 0) $id = 0;\n\t\tif(strpos($type, 'created') === 0) {\n\t\t\t$this->_createdUser = ($id && $user instanceof User ? $user : null);\n\t\t\tparent::set('created_users_id', $id); \n\t\t} else if(strpos($type, 'modified') === 0) {\n\t\t\t$this->_modifiedUser = ($id && $user instanceof User ? $user : null);\n\t\t\tparent::set('modified_users_id', $id); \n\t\t}\n\t}", "function tokenVerification($type, $matchingId)\r\n{\r\n $tableRecord = & get_instance();\r\n $tableRecord\r\n ->load\r\n ->database();\r\n if ($type == '0')\r\n {\r\n return $tableRecord\r\n ->db\r\n ->get_where('loungeMaster', array(\r\n 'loungeId' => $matchingId,\r\n 'status' => '1'\r\n ));\r\n }\r\n else\r\n {\r\n $tableRecord\r\n ->db\r\n ->order_by('id', 'desc');\r\n return $tableRecord\r\n ->db\r\n ->get_where('loginMaster', array(\r\n 'loungeMasterId' => $matchingId,\r\n 'status' => '1',\r\n 'type' => '3'\r\n ));\r\n }\r\n}", "private static function validateUserType(string $userType): bool\n {\n return in_array($userType, Operation::USER_TYPES);\n }", "function UserIDAllow($id = \"\") {\n\t\t$allow = EW_USER_ID_ALLOW;\n\t\tswitch ($id) {\n\t\t\tcase \"add\":\n\t\t\tcase \"copy\":\n\t\t\tcase \"gridadd\":\n\t\t\tcase \"register\":\n\t\t\tcase \"addopt\":\n\t\t\t\treturn (($allow & 1) == 1);\n\t\t\tcase \"edit\":\n\t\t\tcase \"gridedit\":\n\t\t\tcase \"update\":\n\t\t\tcase \"changepwd\":\n\t\t\tcase \"forgotpwd\":\n\t\t\t\treturn (($allow & 4) == 4);\n\t\t\tcase \"delete\":\n\t\t\t\treturn (($allow & 2) == 2);\n\t\t\tcase \"view\":\n\t\t\t\treturn (($allow & 32) == 32);\n\t\t\tcase \"search\":\n\t\t\t\treturn (($allow & 64) == 64);\n\t\t\tdefault:\n\t\t\t\treturn (($allow & 8) == 8);\n\t\t}\n\t}", "function UserIDAllow($id = \"\") {\n\t\t$allow = EW_USER_ID_ALLOW;\n\t\tswitch ($id) {\n\t\t\tcase \"add\":\n\t\t\tcase \"copy\":\n\t\t\tcase \"gridadd\":\n\t\t\tcase \"register\":\n\t\t\tcase \"addopt\":\n\t\t\t\treturn (($allow & 1) == 1);\n\t\t\tcase \"edit\":\n\t\t\tcase \"gridedit\":\n\t\t\tcase \"update\":\n\t\t\tcase \"changepwd\":\n\t\t\tcase \"forgotpwd\":\n\t\t\t\treturn (($allow & 4) == 4);\n\t\t\tcase \"delete\":\n\t\t\t\treturn (($allow & 2) == 2);\n\t\t\tcase \"view\":\n\t\t\t\treturn (($allow & 32) == 32);\n\t\t\tcase \"search\":\n\t\t\t\treturn (($allow & 64) == 64);\n\t\t\tdefault:\n\t\t\t\treturn (($allow & 8) == 8);\n\t\t}\n\t}", "function UserIDAllow($id = \"\") {\n\t\t$allow = EW_USER_ID_ALLOW;\n\t\tswitch ($id) {\n\t\t\tcase \"add\":\n\t\t\tcase \"copy\":\n\t\t\tcase \"gridadd\":\n\t\t\tcase \"register\":\n\t\t\tcase \"addopt\":\n\t\t\t\treturn (($allow & 1) == 1);\n\t\t\tcase \"edit\":\n\t\t\tcase \"gridedit\":\n\t\t\tcase \"update\":\n\t\t\tcase \"changepwd\":\n\t\t\tcase \"forgotpwd\":\n\t\t\t\treturn (($allow & 4) == 4);\n\t\t\tcase \"delete\":\n\t\t\t\treturn (($allow & 2) == 2);\n\t\t\tcase \"view\":\n\t\t\t\treturn (($allow & 32) == 32);\n\t\t\tcase \"search\":\n\t\t\t\treturn (($allow & 64) == 64);\n\t\t\tdefault:\n\t\t\t\treturn (($allow & 8) == 8);\n\t\t}\n\t}", "function get_user_by($field, $value)\n {\n }", "static function is( $value, $type='text' )\n {\n $method = 'is' . ucwords( $type );\n if( method_exists( 'Pgg_Validate', $method ) ) {\n return self::$method( $value );\n }\n return $value;\n }", "public function GetUserType($userid=\"\"){\r\n return $this->db->query(\"select user_type from users where user_id='\".$userid.\"'\")->row_array()['user_type'];\r\n }", "function fiftyone_degrees_get_typed_value($property, $profile_value) {\n $value_string = $profile_value['value'];\n switch ($property['value_type_id']) {\n // String and Javascript.\n case 0:\n case 4:\n default:\n return $value_string;\n // Int.\n case 1:\n return (int) $value_string;\n // Double.\n case 2:\n return (double) $value_string;\n // Bool.\n case 3:\n return $value_string === 'True';\n }\n}", "function isValid( $id_user ) {\n\n\t\treturn true;\n\t}", "abstract public function verify($value): void;", "public function testIdentifyUserWithBearerTokenTypeSetsUserIdForValidHeader()\n {\n $request = new Request($this->config, ['HTTPS' => 'on']);\n $mockOauth = $this->getMockBuilder(OAuthModel::class)->disableOriginalConstructor()->getMock();\n $mockOauth->expects($this->once())\n ->method('verifyAccessToken')\n ->with('authPart')\n ->willReturn('TheUserId');\n\n $request->setOauthModel($mockOauth);\n\n $request->identifyUser('Bearer authPart');\n\n $this->assertEquals('TheUserId', $request->user_id);\n $this->assertEquals('TheUserId', $request->getUserId());\n }", "public function getUserType($user_id)\n {\n $query = \"SELECT `type` FROM `User` WHERE `identifier`='$user_id'\";\n if(($result = $this->getQuery($query,true)) != NULL)\n return $result[0]['type'];\n else\n return \"NO\";\n }", "public function testUserUserIDGet()\n {\n }", "public function testType()\n {\n $user = new User(null, null, null, \"student\");\n $this->assertEquals(\"student\", $user->getType());\n\n $user->setType(\"wrong\");\n $this->assertEquals(\"student\", $user->getType());\n\n $user->setType(\"admin\");\n $this->assertEquals(\"admin\", $user->getType());\n\n $user->setType(\"lecturer\");\n $this->assertEquals(\"lecturer\", $user->getType());\n\n $user->setType(\"student\");\n $this->assertEquals(\"student\", $user->getType());\n }", "public function testGetUsertByID()\n {\n echo \"\\nTesting the user retrieval by ID...\";\n $response = $this->getUser(\"44225\");\n //echo $response;\n $result = json_decode($response);\n $user = $result->User;\n $this->assertTrue((!is_null($user)));\n \n }", "public function getProfileType($userid)\n {\n $query = \"SELECT profile_type FROM \".$this->_name.\" WHERE identifier='\".$userid.\"'\";\n //echo $query.\"<br>\";\n if(($result = $this->getQuery($query,true)) != NULL)\n return $result;\n else\n return \"NO\";\n }", "public function index($id)\n {\n //\n $user = JWTAuth::parseToken()->authenticate();\n $userId = $user->id;\n $GetUserType=User::where('id','=',$userId)->select('userType')->first();\n $userType=$GetUserType->userType; \n //return $userType;\n\n if($userType==1){\n $userDetails=User::where('id','=',$id)->get();\n return new JsonResponse([\n 'message' => 'User Details Provided',\n 'data' => $userDetails\n ]);\n }else{\n return new JsonResponse([\n 'message' => 'User Not Permitted To See This Resource;',\n ]);\n }\n }", "function approveMember($userId) {\r\n $sql = $this->db->prepare(\"UPDATE USER SET type=2 WHERE UserID=:user_id\");\r\n $sql->execute(array('user_id' => $userId));\r\n return true;\r\n }", "function _check_table_id($value, $type, &$err = null)\n {\n $where = array();\n $where['id'] = $value;\n if ($type == 'product')\n $id = model('product')->get_id($where);\n elseif ($type == 'lesson')\n $id = model('lesson')->get_id($where);\n elseif ($type == 'site') {\n $user = user_get_account_info();\n if (!$user) {\n $err = 'Vui lòng đăng nhập để có thể sử dụng chức năng này';\n return false;\n }\n // kiem tra xem user nay da vote chua\n $err = 'Cám ơn, bạn đã đánh giá rồi.';\n\n $id = !model(\"comment\")->check_exits(['user_id' => $user->id, 'table_name' => 'site']);\n //$id = 1;\n } else {\n $id = model($type)->get_id($where);\n }\n\n //pr($id);\n if (!$id) {\n $this->form_validation->set_message(__FUNCTION__, lang('notice_value_invalid'));\n return FALSE;\n }\n\n return TRUE;\n }", "public function matchDataType($value, $type) {\n $match = FALSE;\n\n // Type is an array, then a list of acceptable value must be checked.\n if (is_array($type)) {\n $options = $type;\n $type = 'options';\n }\n\n switch($type) {\n case 'int':\n // Single value, of type integer. Including 0.\n if (is_numeric($value) && $value >= 0) {\n // Paging starts at 0, include 0.\n $match = TRUE;\n }\n\n break;\n\n case 'text':\n // Single value, text value.\n if (is_string($value)) {\n $match = TRUE;\n\n if ($match && !empty($value)) {\n // See if text is longer than 15 chars.\n $match = FALSE;\n\n if (strlen($value) <= 150) {\n $match = TRUE;\n }\n }\n }\n\n break;\n\n case 'year':\n // Four digit year YYYY.\n if (preg_match('/^[0-9]{4}$/', $value)) {\n // ie: 1979, 2000\n $match = TRUE;\n }\n\n break;\n\n case 'boolean':\n // Boolean true or false only.\n if (id_bool($value)) {\n // TRUE or FALSE.\n $match = TRUE;\n }\n\n break;\n\n case 'hash-code':\n // Single value, alphanumeric value matching a pattern.\n if (preg_match('/^\\w{5}-{1}\\w{5}-{1}\\w{5}-{1}\\w{5}-{1}\\w{5}$/', $value)) {\n // ie: ZovDs-BCDB9-P5QSP-6DSDx-Myisv\n $match = TRUE;\n }\n\n break;\n\n case 'array-text':\n // Array of string, where each element is of type text.\n if (is_array($value)) {\n $match = TRUE;\n foreach($value as $i => $item) {\n if (is_array($item)) {\n foreach($item as $item_value) {\n // Use the text condition of this method.\n $is_valid = $this->matchDataType($item_value, 'text');\n if ($is_valid) {\n $match = FALSE;\n break 2;\n }\n }\n }\n }\n }\n\n break;\n\n case 'array-int':\n // Array of string, where each element is of type integer.\n if (is_array($value)) {\n $match = TRUE;\n foreach($value as $i => $item) {\n if (is_array($item)) {\n foreach($item as $item_value) {\n // Use the int condition of this method.\n $is_valid = $this->matchDataType($item_value, 'int');\n if ($is_valid) {\n $match = FALSE;\n break 2;\n }\n }\n }\n }\n }\n\n break;\n\n case 'asc/desc':\n // Sort order asc for ascending order and desc for descending order.\n if ($value == 'asc' || $value == 'desc') {\n $match = TRUE;\n }\n\n break;\n\n case 'options':\n // Value must be one of the enumerated values.\n if (in_array($value, $options)) {\n $match = TRUE;\n }\n\n break;\n\n case 'datetime':\n // Value must be a date and time YYYY-MM-DD 00:00\n if (preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})$/', $value, $x)) {\n $match = TRUE;\n }\n\n break;\n }\n\n return $match;\n }", "function identifyUser() {\n}", "public function setUserid($value)\n {\n return $this->set(self::_USERID, $value);\n }", "public function setUserid($value)\n {\n return $this->set(self::_USERID, $value);\n }", "public function setUserid($value)\n {\n return $this->set(self::_USERID, $value);\n }", "function verify_userid(&$userid)\n\t{\n\t\tif ($userid == 0 OR $userid == $this->registry->userinfo['userid'] OR $this->dbobject->query_first(\"SELECT * FROM \" . TABLE_PREFIX . \"user WHERE userid = $userid\"))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tglobal $vbphrase;\n\t\t\t$this->error('invalidid', $vbphrase['user'], $this->registry->options['contactuslink']);\n\t\t\treturn false;\n\t\t}\n\t}", "function sanitize_user_field($field, $value, $user_id, $context)\n {\n }", "public static function field($value, string $type, array $params = []): bool\n {\n $validated = true;\n switch ($type) {\n case \"email\":\n $validated = self::email($value);\n\n break;\n case \"text\":\n $validated = self::str_length($value, $params);\n break;\n case \"password\":\n $validated = self::str_length($value, $params) === true && self::password($value) === true;\n\n }\n\n return $validated;\n }", "public static function checkUser($user_id);", "public function edp_api_user_id_test( $input )\n\t{\n\t\t$field_name = 'User ID (demo)';\n\t\t$constraints = array(\n\t\t\tnew Length(array(\n\t\t\t\t'min' => 5,\n\t\t\t\t'max' => 64,\n\t\t\t\t'minMessage' => $field_name . ' is too short.',\n\t\t\t\t'maxMessage' => $field_name . ' is too long.'\n\t\t\t)),\n\t\t\tnew NotBlank(array(\n\t\t\t\t'message' => $field_name . ' cannot be blank.'\n\t\t\t))\n\t\t);\n\n\t\treturn sanitize_text_field($this->validate(get_option('edp_api_user_id_test'), $input, $constraints));\n\n\t}", "public function verify_donor($user_id) {\n \n }", "private function validate($value,$type) {\n\t\tswitch($type) {\n\t\t\tcase \"varchar\":\n\t\t\t\treturn self::is_alphanum($value);\n\t\t\t\tbreak;\n\t\t\tcase \"int\":\n\t\t\t\treturn self::is_num($value);\n\t\t\t\tbreak;\n\t\t\tcase \"binary\":\n\t\t\t\treturn self::is_binary($value);\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tcase \"signed\":\n\t\t\t\treturn self::is_signed($value);\n\t\t\t\tbreak;\n\t\t\tcase \"file\":\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function verifyToken($userType,$token,$id,$action){\n $resp = false;\n /*if action is type reset*/\n if($action == 'reset'){\n /*validate user type*/\n if($userType == 'user')\n $sql = \"SELECT token FROM Users WHERE email = :id AND (status = '1' AND validate = '1')\"; //create sentence\n else if($userType == 'teacher')\n $sql = \"SELECT token FROM Teachers WHERE email = :id AND status = '1' AND validate = '1'\"; //create sentence\n }\n /*If action is type validate*/\n else if($action == 'activate'){\n /*validate user type*/\n if($userType == 'user')\n $sql = \"SELECT token FROM Users WHERE email = :id AND status = '1' AND validate = '0'\"; //create sentence\n else if($userType == 'teacher')\n $sql = \"SELECT token FROM Teachers WHERE email = :id AND status = '1' AND validate = '0'\"; //create sentence\n }\n $stmt = $this->connect()->prepare($sql); //prepare sentence\n $stmt->bindParam(':id',$id); //add params\n $stmt->execute(); //execute sentence\n /*If email exists*/\n if($stmt->rowCount() > 0){\n $tokendb = $stmt->fetchColumn(); //Get token from consult\n /*Validate token*/\n if($tokendb == '_token$'.$token)\n $resp = true;\n }\n $this->closeConnection(); //close conection\n return json_encode($resp); // convert to json and return this\n }", "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function authenticateUserById($emailOrJblUserId);", "private function searchUserType($by, $value){\n\t\t\t$sql = \"select id_type_user, type_user, DATE_FORMAT( date_modification_type_user, '%Y-%m-%d %h:%i:%s' ) date, description_type_user FROM type_user where\";\n\t\t\tif($by == \"id\") $sql .= \" id_type_user=?\";\n\t\t\telse if($by == \"name\") $sql .= \" type_user=?\";\n\t\t\telse throw new Exception(\"Bad search parameters\");\n\t\t\t$stmt = $this->db->executeQuery($sql, array($value));\n\t\t\tif(!$userType = $stmt->fetch()) return new UserType( \"\", \"\", \"\", \"\");\n\t\t\t$user = new UserType($userType['id_type_user'], $userType['type_user'], $userType['description_type_user'], $userType['date']);\n\t\t\treturn $this->loadUserTypeAccess($user);\n\t\t}", "public function getJWTCustomClaims()\n {\n return [\n 'type' =>'husband',\n ];\n }", "public function user_type($id){\n\t\tglobal $con;\n\t\t$query=\"SELECT * FROM user_admin WHERE id='$id' LIMIT 1\";\n\t\t$result=array();\n\t\t$user_type='';\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$user_type=$value['type'];\n\t\t}\n\t\treturn $user_type;\n\t}", "function uservalidationbyadmin_allow_new_user_can_edit($hook, $type, $value, $params) {\n\t// $params['user'] is the user to check permissions for.\n\t// we want the entity to check, which is a user.\n\t$user = elgg_extract('entity', $params);\n\n\tif (!($user instanceof ElggUser)) {\n\t\treturn;\n\t}\n\n\t$context = elgg_get_context();\n\tif ($context == 'uservalidationbyadmin_new_user' || $context == 'uservalidationbyadmin_validate_user') {\n\t\treturn TRUE;\n\t}\n\n\treturn;\n}", "function power_user_meta_default_on( $value, $user_id ) {\n\n\t// If a real value exists, simply return it.\n\tif ( $value ) {\n\t\treturn $value;\n\t}\n\n\t// Get the name of the field by removing the prefix from the active filter.\n\t$field = str_replace( 'get_the_author_', '', current_filter() );\n\n\t// Setup user data.\n\tif ( ! $user_id ) {\n\t\tglobal $authordata;\n\t} else {\n\t\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- same pattern used in` get_the_author_meta()\n\t\t$authordata = get_userdata( $user_id );\n\t}\n\n\t// Just in case.\n\t$user_field = \"user_$field\";\n\tif ( isset( $authordata->$user_field ) ) {\n\t\treturn $authordata->user_field;\n\t}\n\n\t// If an empty or false value exists, return it.\n\tif ( isset( $authordata->$field ) ) {\n\t\treturn $value;\n\t}\n\n\t// If all that fails, default to true.\n\treturn 1;\n\n}", "function theme_show_user_learner_data( $value, $column_name, $user_id ) {\n\n if( 'learner' == $column_name ) {\n\t return get_user_meta( $user_id, 'learner', true );\n } // end if\n\n}", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "function trac_load_value_user_email( $value, $post_id, $field ) {\n\tif ( false !== strpos($post_id, 'user_') && $user_id = str_replace('user_', '', $post_id) ) {\n\t\t$userdata = get_userdata( $user_id );\n\t\tif ( $userdata ) {\n\t\t\t$value = $userdata->user_email;\n\t\t}\n\t}\n return $value;\n}", "public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId() {}", "public function setUserId($value)\n {\n return $this->set(self::user_id, $value);\n }", "public function validateUserRoleExists($value, array $context)\n {\n /** @var Permissions */\n $Permissions = Registry::get('Permissions');\n $roles = array_column($Permissions->getRoles()->getAvailable(), 'type');\n if (in_array($value, $roles)) {\n return true;\n }\n\n return __('vld.user.user_type.allowedType', h($value));\n }", "public function transform($value)\n {\n if (null === $value || '' === $value) {\n return UsersConstant::USER_ID_ANONYMOUS;\n }\n\n if (is_numeric($value)) {\n // select user to verify it exists\n /** @var UserEntity $user */\n $user = $this->userRepository->find($value);\n if (null === $user) {\n return UsersConstant::USER_ID_ANONYMOUS;\n }\n\n return $value;\n }\n\n return $value;\n }", "private function validation($user_type=0)\n\t{\n\t\t$this->post_only();\n\t\t\n $this->form_validation->set_rules('name', 'Name', 'xss_clean|htmlentities');\n $this->form_validation->set_rules('id', 'Identity', 'xss_clean|htmlentities');\n $this->form_validation->set_rules('email', 'Email', 'trim|valid_email|required|xss_clean|htmlentities');\n $this->form_validation->set_rules('hp', 'No HP', 'trim|xss_clean|htmlentities');\n $this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|htmlentities');\n $this->form_validation->set_rules('c_password', 'Confirmation Password', 'trim|required|xss_clean|htmlentities');\n $this->form_validation->set_rules('status', 'Status', 'trim|integer|xss_clean|htmlentities');\n $this->form_validation->set_rules('user_type', 'Tipe User', 'trim|integer|xss_clean|htmlentities');\n if ($this->form_validation->run()) {\n\t\t\t$password = $this->form_validation->set_value('password');\n\t\t\t$c_password = $this->form_validation->set_value('c_password');\n\t\t\tif($password != $c_password) {\n\n\t\t\t}\n $value=array(\n 'id' => $this->form_validation->set_value('id'),\n 'name' => $this->form_validation->set_value('name'),\n 'email' => $this->form_validation->set_value('email'),\n 'hp' => $this->form_validation->set_value('hp'),\n// 'user_type' => $user_type, // mod imam\n 'status' => $this->form_validation->set_value('status'),\n 'user_type' => $this->form_validation->set_value('user_type'),\n 'password' => $password\n );\n // if success will return all value\n\t\t\treturn $value;\n }\n $this->json_badrequest(validation_errors());\n return false;\n\t}", "function is_auditor($user)\n{\n return is_array($user->roles) && in_array('auditor', $user->roles);\n}", "public function testGettingType()\n {\n $this->assertEquals('foo', $this->principal->getType());\n }", "protected function validateType($value)\n {\n }", "public function authorizeUserById($userId, $username);", "public function testSetUserIdAllowsForSettingOfUserId()\n {\n $request = new Request($this->config, []);\n $user = uniqid('', true);\n\n $request->setUserId($user);\n $this->assertEquals($user, $request->getUserId());\n }", "public function type(Request $request, $id)\n {\n $input = $request->input();\n $types = ['Admin','Editor','Author','Regular'];\n if (!in_array($input['type'], $types))\n return response()->json('Invalid User Type', 302);\n \n $user = User::FindOrFail($id);\n $user->type = $input['type'];\n $user->save();\n\n return response()->json($user, 200);\n }" ]
[ "0.63037914", "0.6011664", "0.57577765", "0.57464755", "0.57295203", "0.56439453", "0.56439453", "0.5551737", "0.5490112", "0.54703146", "0.54371774", "0.5353186", "0.53392076", "0.53300005", "0.53179073", "0.52988803", "0.5255845", "0.5255643", "0.5235468", "0.52289945", "0.5182553", "0.5176367", "0.51538146", "0.5149945", "0.5149904", "0.5128738", "0.5128341", "0.51136196", "0.5102956", "0.5100413", "0.5090932", "0.50814843", "0.50814843", "0.5080655", "0.507844", "0.5071129", "0.5056905", "0.50535274", "0.50488573", "0.5045773", "0.50393134", "0.50341666", "0.50322336", "0.50272053", "0.5020386", "0.5020386", "0.5020386", "0.5013607", "0.4999345", "0.49829987", "0.49754673", "0.4974992", "0.49577", "0.49526232", "0.49509937", "0.49468014", "0.49432755", "0.49412856", "0.49390873", "0.4938419", "0.49293554", "0.4923117", "0.49175605", "0.49112445", "0.49076054", "0.49076054", "0.49076054", "0.49045685", "0.48972747", "0.4883391", "0.48774716", "0.48757637", "0.4862344", "0.48606202", "0.48589373", "0.4856662", "0.48564148", "0.48516905", "0.484625", "0.48410216", "0.4838203", "0.48308325", "0.4830114", "0.48295927", "0.48295927", "0.48295927", "0.48295927", "0.48295927", "0.4827107", "0.48222983", "0.48202285", "0.48199478", "0.48199433", "0.4815231", "0.48108473", "0.48104542", "0.4809429", "0.4809251", "0.48056832", "0.48051244" ]
0.5595652
7
Create a request with UsersJwt authorization header.
protected function createRequest($header_name, $token): Request { $request = Request::create('/'); $request->headers->set($header_name, 'UsersJwt ' . $token); return $request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createNewRequest()\n { \n return $this->clientManager->createNewRequest('user');\n }", "public function generate_jwt_token($request) {\n \t$jwt = new Jwt_Auth_Public( 'jwt-auth', '1.1.0' );\n \treturn $jwt->generate_token($request);\n }", "public function registerUserRequest()\n {\n $user = factory(User::class)->make();\n\n return $this->json('POST', '/api/v2/user', array_merge($user->toArray(), ['password' => 'secret1234', 'agb_check' => true]));\n }", "public function requestToken(Request $request)\n\t{\n\t $request->validate([\n\t 'email' => 'required|email',\n\t 'password' => 'required',\n\t 'device_name' => 'required',\n\t ]);\n\n\t $user = User::where('email', $request->email)->first();\n\n\t if (! $user || ! Hash::check($request->password, $user->password)) {\n\t \t$response = [\n\t \t\t'status' => 'error',\n\t\t\t\t'message' => 'The provided credentials are incorrect.'\n\t\t\t];\n\t\t\treturn response()->json($response, 200);\n\t }\n\n\t $data['access_token'] = $user->createToken($request->device_name)->plainTextToken;\n\n\t $response = [\n \t\t'status' => 'success',\n \t\t'message' => 'Token generated',\n \t\t'data' => $data,\n\t\t];\n\t return response()->json($response, 200);\n\t}", "public function getRequestAuthorization(RequestInterface $request, AccessToken $token):RequestInterface;", "protected function withHeader(Request $request, array $params) : Request\n {\n // Percent encode the Authorization header parameters according to spec.\n foreach ($params as $key => $value) {\n $params[$key] = $key.'=\"'.rawurlencode($value).'\"';\n }\n\n return $request->withHeader('Authorization', 'OAuth ' . implode(', ', $params));\n }", "public static function create($user) {\n global $config;\n\n $header = new \\Psecio\\Jwt\\Header($config['jwt_secret']);\n $jwt = new \\Psecio\\Jwt\\Jwt($header);\n\n// $jwt\n// ->issuer('http://example.org')\n// ->audience('http://example.com')\n// ->issuedAt(1356999524)\n// ->notBefore(1357000000)\n// ->expireTime(time()+3600)\n// ->jwtId('id123456')\n// ->type('https://example.com/register')\n// ->custom('user', 'custom-claim');\n\n $payload = array();\n $payload['id'] = $user['id'];\n $payload['email'] = $user['email'];\n\n $jwt\n ->audience($config['host'])\n ->custom($payload, 'user');\n\n $token = $jwt->encode();\n\n return $token;\n }", "public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }", "public function generateJwt()\n {\n\n \t$now = time();\n \t$user = User::find(Auth::user()->id);\n\n \t$token = array(\n \"jti\" => bcrypt($now . rand()),\n \"iat\" => $now,\n \"name\" => $user->name,\n \"email\" => $user->email\n );\n\n \treturn JWT::encode($token, $this->key);\n }", "public function createRequest();", "public function createRequest();", "public function createUserWebAuthnAction(Request $request)\n {\n // Make sure that the client is providing something that we can consume\n $consumes = ['application/json'];\n if (!static::isContentTypeAllowed($request, $consumes)) {\n // We can't consume the content that the client is sending us\n return new Response('', 415);\n }\n\n // Figure out what data format to return to the client\n $produces = ['application/json'];\n // Figure out what the client accepts\n $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';\n $responseFormat = $this->getOutputFormat($clientAccepts, $produces);\n if ($responseFormat === null) {\n return new Response('', 406);\n }\n\n // Handle authentication\n // Authentication 'csrf' required\n // Set key with prefix in header\n $securitycsrf = $request->headers->get('X-CSRF-TOKEN');\n\n // Read out all input parameter values into variables\n $userWebAuthnCreateWithKey = $request->getContent();\n\n // Use the default value if no value was provided\n\n // Deserialize the input values that needs it\n try {\n $inputFormat = $request->getMimeType($request->getContentType());\n $userWebAuthnCreateWithKey = $this->deserialize($userWebAuthnCreateWithKey, 'OpenAPI\\Server\\Model\\UserWebAuthnCreateWithKey', $inputFormat);\n } catch (SerializerRuntimeException $exception) {\n return $this->createBadRequestResponse($exception->getMessage());\n }\n\n // Validate the input values\n $asserts = [];\n $asserts[] = new Assert\\NotNull();\n $asserts[] = new Assert\\Type(\"OpenAPI\\Server\\Model\\UserWebAuthnCreateWithKey\");\n $asserts[] = new Assert\\Valid();\n $response = $this->validate($userWebAuthnCreateWithKey, $asserts);\n if ($response instanceof Response) {\n return $response;\n }\n\n\n try {\n $handler = $this->getApiHandler();\n\n // Set authentication method 'csrf'\n $handler->setcsrf($securitycsrf);\n \n // Make the call to the business logic\n $responseCode = 200;\n $responseHeaders = [];\n $result = $handler->createUserWebAuthn($userWebAuthnCreateWithKey, $responseCode, $responseHeaders);\n\n // Find default response message\n $message = '';\n\n // Find a more specific message, if available\n switch ($responseCode) {\n case 200:\n $message = 'OK';\n break;\n case 403:\n $message = 'Unauthorized';\n break;\n }\n\n return new Response(\n $result !== null ?$this->serialize($result, $responseFormat):'',\n $responseCode,\n array_merge(\n $responseHeaders,\n [\n 'Content-Type' => $responseFormat,\n 'X-OpenAPI-Message' => $message\n ]\n )\n );\n } catch (Exception $fallthrough) {\n return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));\n }\n }", "function auth (){\n //$app = \\Slim\\Slim::getInstance();\n //$headers = $app->request()->headers();\n //$token = JWT::decode($headers['X-Auth-Token'], 'secret_server_key');\n //print_r($token);\n //echo $headers['X-Auth-Token'];\n}", "public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }", "public function userTokenAuth(Request $request)\n {\n $header = $request->header('Authorization');\n if (Str::startsWith($header, 'Bearer ')) {\n $header = Str::substr($header, 7);\n }else{\n response()->json($this->apiResponse(false,null,'Authorization syntax error'),200)->send();\n die();\n }\n\n /*\n * Check the User Token\n */\n $user = User::where('token',$header)->get()->first();\n\n if($user != null){\n\n if($user->status == 0){\n\n /*\n * Blocked User\n */\n response()->json($this->apiResponse(false,null,'هذا الحساب تم حظره من قبل مسؤول النظام' ),200)->send();\n die();\n }else{\n\n return $user;\n\n }\n\n }else{\n\n response()->json($this->apiResponse(false,null,'يجب ان تقوم بتسجيل الدخول لكي تتمكن من تصفح التطبيق'),200)->send();\n die();\n }\n }", "private function makeRequest()\n {\n $credentials = $this->generateCredentials();\n\n return $this->engine->client->request('POST', $this->endpoint, [\n 'json' => $credentials,\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ],\n ]);\n }", "protected function createTokenRequest($token_request)\n {\n // verify the required parameter 'token_request' is set\n if ($token_request === null || (is_array($token_request) && count($token_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $token_request when calling createToken'\n );\n }\n\n $resourcePath = '/appManagement/token';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($token_request)) {\n $_tempBody = $token_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected static function getJWTFromAuthHeader()\n {\n if ('testing' === env('APP_ENV')) {\n //getallheaders method is not available in unit test mode.\n return [];\n }\n\n if (!function_exists('getallheaders')) {\n function getallheaders()\n {\n if (!is_array($_SERVER)) {\n return [];\n }\n\n $headers = [];\n foreach ($_SERVER as $name => $value) {\n if (substr($name, 0, 5) == 'HTTP_') {\n $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] =\n $value;\n }\n }\n\n return $headers;\n }\n }\n\n $token = null;\n $headers = getallheaders();\n $authHeader = ArrayUtils::get($headers, 'Authorization');\n if (strpos($authHeader, 'Bearer') !== false) {\n $token = substr($authHeader, 7);\n }\n\n return $token;\n }", "private function issueTokenUsingAuthorizationHeader($header)\n {\n $matches = array();\n preg_match('/Bearer\\s([^\\s]+)/si', $header, $matches);\n if (!isset($matches[1])) {\n throw new InvalidArgumentException('Cannot parse authorization header..');\n }\n\n $credentials = $matches[1];\n\n // decode\n $payload = $this->decodeToken($credentials);\n\n // make sure that 'username' is encoded\n if (!isset($payload['username']) || empty($payload['username'])) {\n throw new BadCredentialsException('Cannot extract username from token payload.');\n }\n\n $token = $this->factory->createToken($payload['username'], $credentials); // initialize anonymous user token\n $token->setAuthenticated(false);\n\n return $token;\n }", "public function testValidCredentialsInHeader()\n {\n $server = $this->getTestServer();\n $headers = array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('Test Client ID:TestSecret'), 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n\n // create using PHP Authorization Globals\n $headers = array('PHP_AUTH_USER' => 'Test Client ID', 'PHP_AUTH_PW' => 'TestSecret', 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n }", "protected function createPrivateKeyRequest()\n {\n\n $resourcePath = '/v1/account/privkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getJwtFromRequest(Request $request) {\n $auth_header = $request->headers->get('X-Authorization');\n $matches = [];\n if (!preg_match('/^Bearer (.*)/', $auth_header, $matches)) {\n return FALSE;\n }\n\n return $matches[1];\n }", "public function createToken()\n\t{\n\t\t$domain = $this->config->get('app.domain');\n\n\t\t$data = [\n\t\t\t'iss' => $domain,\n\t\t\t'aud' => $domain,\n\t\t\t'iat' => time(),\n\t\t\t'exp' => time () + $this->expiration,\n\t\t];\n\n\t\t$token = JWT::encode($data, $this->config->get('app.app_key'));\n\n\t\t$this->createAuth([\n\t\t\t'token' => $token,\n\t\t\t'expires_at' => date('Y-m-d h:i:s', $data['exp'])\n\t\t]);\n\n\t\treturn $token;\n\t}", "public function withHeaders(array $headers): RequestInterface;", "public function withAuthHeader($user)\n {\n $token = JWTAuth::fromUser($user);\n $this->headers['Authorization'] = \"Bearer {$token}\";\n return $this;\n }", "public function getAuth()\n {\n $this->getRequestHeaders([\n 'X-User-Id', 'X-Auth-Token'\n ]);\n }", "function createToken($userAgent, $userId = null);", "protected function createPublicKeyRequest()\n {\n\n $resourcePath = '/v1/account/pubkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "static public function getRequestString($params)\n {\n // Create token header as a JSON string\n $header = json_encode(['alg' => 'HS256', 'typ' => 'JWT']);\n\n // Encode Header to Base64Url String\n $base64UrlHeader = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($header));\n\n $payload = json_encode($params);\n\n // Encode Payload to Base64Url String\n $base64UrlPayload = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($payload));\n\n // Create Signature Hash\n $signature = hash_hmac('sha256', $base64UrlHeader . \".\" . $base64UrlPayload, getenv('AMTEL_SECRET'), true);\n\n // Encode Signature to Base64Url String\n $base64UrlSignature = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($signature));\n\n // Create JWT\n return $base64UrlHeader . \".\" . $base64UrlPayload . \".\" . $base64UrlSignature;\n }", "protected function getUsersRequest($zap_trace_span = null)\n {\n\n $resourcePath = '/api/v2/users';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($zap_trace_span !== null) {\n $headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\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 }", "function generateJWT($host,$user_id,$login) {\n $now = new DateTime();\n $future = new DateTime(\"now +12 hours\");\n $jti = Base62::encode(random_bytes(16));\n\n $payload = [\n \"iat\" => $now->getTimeStamp(),\n \"exp\" => $future->getTimeStamp(),\n \"jti\" => $jti,\n \"iss\" => $host,\n // \"sub\" => $server[\"PHP_AUTH_USER\"],\n // \"scope\" => $scopes\n \"data\" => [\n \"userId\" => $user_id,\n \"userLogin\" => $login,\n ]\n ];\n $secret = getenv(\"JWT_SECRET\");\n return JWT::encode($payload, $secret, \"HS256\");\n}", "public function makeAuthHeader() {\r\n\t\t$this->timestamp = $this->timestamp ? $this->timestamp : $this->getEdgeGridTimestamp();\r\n\t\t$this->nonce = $this->nonce ? $this->nonce : $this->makeNonce();\r\n\r\n\t\t$auth_header = 'EG1-HMAC-SHA256 ' .\r\n\t\t\t\t'client_token=' . $this->client_token . ';' .\r\n\t\t\t\t'access_token=' . $this->access_token . ';' .\r\n\t\t\t\t'timestamp=' . $this->timestamp . ';' .\r\n\t\t\t\t'nonce=' . $this->nonce . ';';\r\n\r\n\t\t$this->verbose('auth_header', $auth_header);\r\n\r\n\t\tswitch ($this->method) {\r\n\t\t\tcase 'POST':\r\n\t\t\t\t$this->body_to_sign = $this->body;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'PUT':\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$this->body = null;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t$this->verbose('body_to_sign', $this->body_to_sign);\r\n\r\n\t\t$signed_auth_header = $auth_header . 'signature=' . $this->signRequest($auth_header);\r\n\t\t$this->verbose('signed_auth_header', $signed_auth_header);\r\n\r\n\t\treturn $signed_auth_header;\r\n\t}", "public function buildRequest($addReq = null) {\n \t// Build Authentication\n \t$this->request['WebAuthenticationDetail'] = array(\n\t\t\t'UserCredential'=> array(\n\t\t\t\t'Key' \t\t=> $this->key, \n\t\t\t\t'Password'\t=> $this->password\n\t\t\t)\n\t\t);\n\n\t\t//Build Client Detail\n\t\t$this->request['ClientDetail'] = array(\n\t\t\t'AccountNumber' => $this->acct_num, \n\t\t\t'MeterNumber' \t=> $this->meter_num\n\t\t);\n\n\t\t// Build Customer Transaction Id\n\t\t$this->request['TransactionDetail'] = array(\n\t\t\t'CustomerTransactionId' => $this->customerTransactionId\n\t\t);\n\t\t\n\t\t// Build API Version info\n\t\t$this->request['Version'] = array(\n\t\t\t'ServiceId' \t=> $this->service_id, \n\t\t\t'Major' \t\t=> $this->major, \n\t\t\t'Intermediate'\t=> $this->intermediate, \n\t\t\t'Minor' \t\t=> $this->minor\n\t\t);\n\n\t\t// Enable detailed scans\n\t\t$this->request['ProcessingOptions'] = 'INCLUDE_DETAILED_SCANS';\n\n\t\tif(!is_null($addReq))\n\t\t\t$this->request = array_merge($this->request, $addReq);\n\n\t\treturn $this->request;\n }", "public function registerViaRequest()\n {\n return User::create(array_merge([\n 'password' => bcrypt(input('password')),\n ], only('email', 'name', 'is_public')));\n }", "function generateToken($resp) {\n //Chave para a encriptação\n $key='klEpFG93';\n\n //Configuração do JWT\n $header = [\n 'alg' => 'HS256',\n 'typ' => 'JWT'\n ];\n\n $header = json_encode($header);\n $header = base64_encode($header);\n\n //Dados \n $payload = [\n 'iss' => 'CALIKA',\n 'nome' => $resp->nome,\n ];\n\n $payload = json_encode($payload);\n $payload = base64_encode($payload);\n\n //Signature\n\n $signature = hash_hmac('sha256', \"$header.$payload\", $key,true);\n $signature = base64_encode($signature);\n // echo $header.$payload.$signature;\n $this->db->query(\"UPDATE users SET token=:token WHERE id=:id\", [':token'=>$header.'.'.$payload.'.'.$signature, ':id'=>$resp->id]);\n\n return \"$header.$payload.$signature\";\n }", "public function registerAndActivateUserRequest()\n {\n $this->registerUserRequest();\n\n return $this->get('/api/v2/user/activate/' . User::first()->activation_key);\n }", "public function user(Request $request)\n {\n $tokenWithBearer = $request->header('Authorization');\n $bearer = substr($tokenWithBearer, 0, 7);\n $token = substr($tokenWithBearer, 7);\n\n $user = Auth::user();\n\n return response()->json([\n 'message' => 'Success',\n 'user' => $user,\n //'posts' => $user->posts,\n 'access_token' => $token,\n 'token_type' => trim($bearer),\n ]);\n }", "function __construct()\n {\n parent::__construct();\n header(\"Access-Control-Allow-Origin:*\");\n header(\"Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept\");\n header('Access-Control-Request-Method: OPTIONS, POST, GET, PUT, DELETE');\n\n // Configure limits on our controller methods\n // Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php\n $this->methods['users_get']['limit'] = 500; // 500 requests per hour per user/key\n $this->methods['users_post']['limit'] = 100; // 100 requests per hour per user/key\n $this->methods['users_delete']['limit'] = 50; // 50 requests per hour per user/key\n\n $this->objOfJwt = new ImplementJWT();\n }", "public function __invoke(Request $request)\n\t{\n\t\t$data = $request->validate([\n\t\t\t'firstname' => ['required', 'string', 'max:48'],\n\t\t\t'lastname' => ['required', 'string', 'max:48'],\n\t\t\t'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n\t\t\t'password' => ['required', 'string', 'min:6', 'confirmed'],\n\t\t]);\n\t\t\n\t\t$user = User::create($data);\n\t\t\n\t\t$token = Auth::attempt([\n\t\t\t'email' => $data['email'],\n\t\t\t'password' => $data['password'],\n\t\t]);\n\n\t\treturn response()\n\t\t\t->json([\n\t\t\t\t'token' => [\n\t\t\t\t\t'type' => 'Bearer',\n\t\t\t\t\t'token' => $token,\n\t\t\t\t\t'expires_in' => auth()->factory()->getTTL() * 60,\n\t\t\t\t],\n\t\t\t\t'user' => new UserResource($user),\n\t\t\t], 201);\n\t}", "public function toRequest(): Request\n {\n // Create URI\n $uri = new Uri(sprintf($this->uriTemplate, $this->shop));\n\n // Create headers\n $authenticatedRequestHeader = $this->accessTokenTransformer\n ->toAuthenticatedRequestHeader($this->accessToken);\n\n // Create headers\n $headers = array_merge($this->headers, $authenticatedRequestHeader);\n\n // Create request\n return new Request($this->httpMethod, $uri, $headers);\n }", "public function jwtToken($arr = array()){\n $payload = [\n 'iss' => Hash::make(env('APP_NAME')),\n 'sub' => $this->authUser->id,\n 'iat' => time(),\n 'exp' => time() + env('JWT_EXPIRY', 10)*60\n ];\n\n if(count($arr) > 0) $payload = array_merge($arr, $payload);\n\n return JWT::encode($payload, env('JWT_SECRET'));\n }", "public function testIdentifyUserWithBearerTokenTypeSetsUserIdForValidHeader()\n {\n $request = new Request($this->config, ['HTTPS' => 'on']);\n $mockOauth = $this->getMockBuilder(OAuthModel::class)->disableOriginalConstructor()->getMock();\n $mockOauth->expects($this->once())\n ->method('verifyAccessToken')\n ->with('authPart')\n ->willReturn('TheUserId');\n\n $request->setOauthModel($mockOauth);\n\n $request->identifyUser('Bearer authPart');\n\n $this->assertEquals('TheUserId', $request->user_id);\n $this->assertEquals('TheUserId', $request->getUserId());\n }", "public function createUser(Request $request)\n {\n\n // Validate key parameters\n $validator = Validator::make(Input::all(), [\n \"name\" => \"required|max:255\",\n \"email\" => \"required|email|max:255|unique:users,email\",\n \"password\" => \"required|min:8|max:16\"\n ]);\n\n // On fail, return error messages.\n if($validator->fails())\n {\n return StandardResponse::json($validator->errors(), 400);\n }\n\n // Fill User object, create password and api_token hashes.\n $user = User::create(Input::all());\n\n // Return User object.\n return StandardResponse::json([\n \"user\" => $user, \n \"api_token\" => $user->api_token\n ], 200);\n\n }", "public function createTokenRequest($options)\n {\n // unbox the parameters from the associative array\n\n\n $resourcePath = '/tokens';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\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 = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function buildAccessHeader ()\n {\n $this->is_preauthorized_request = 0;\n if ($this->IsAccessParams())\n $this->addHeader('Authorization', $this->token_type . ' ' . $this->access_token);\n\n }", "public function authorizeRequest(Http\\HapiClient $hapiClient, Http\\Request $request);", "public function testBuildingAuthorizationHeader() {\n\t\t$signer = new Auth_OAuth_Signer();\n\n\t\t$params = array('file'=>'vacation.jpg', 'size'=>'original', 'oauth_version'=>'1.0',\n\t\t\t\t\t'oauth_consumer_key'=>'dpf43f3p2l4k3l03', 'oauth_token'=>'nnch734d00sl2jdk',\n\t\t\t\t\t'oauth_timestamp'=>'1191242096', 'oauth_nonce'=>'kllo9940pd9333jh');\n\t\tself::build_request('GET', 'http://photos.example.net/photos', $params);\n\t\t$request = Auth_OAuth_RequestImpl::fromRequest();\n\t\t$server = new Auth_OAuth_Store_ServerImpl('key', 'kd94hf93k423kf44');\n\t\t$server->setSignatureMethods( array('PLAINTEXT', 'HMAC-SHA1') );\n\t\t$token = new Auth_OAuth_TokenImpl('token', 'pfkkdhi9sl3r4s00', 'key', 'access');\n\n\t\t$signer->sign($request, $server, $token);\n\n\t\t$this->assertEquals('OAuth oauth_version=\"1.0\", oauth_consumer_key=\"dpf43f3p2l4k3l03\", '\n\t\t\t. 'oauth_token=\"nnch734d00sl2jdk\", oauth_timestamp=\"1191242096\", oauth_nonce=\"kllo9'\n\t\t\t. '940pd9333jh\", oauth_signature_method=\"PLAINTEXT\", oauth_signature=\"kd94hf93k423k'\n\t\t\t. 'f44%26pfkkdhi9sl3r4s00\"', $signer->getAuthorizationHeader($request));\n\t}", "private function sign( Ga_Lib_Api_Request $request ) {\n\t\t// Add the OAuth2 header to the request\n\t\t$request->set_request_headers( array( 'Authorization: Bearer ' . $this->token['access_token'] ) );\n\n\t\treturn $request;\n\t}", "public function make(){\n \n \n $this->makeHeaders();\n\n $this->setDefaultClaims();\n\n $this->secret = $_ENV['JWT_SECRET'];\n \n $signature = $this->signToken($_ENV['JWT_ALG'],$this->encodeToken($this->header,$this->payload,$this->secret));\n \n return $this->encode($this->header) . '.' . $this->encode($this->payload) . '.' . $signature;\n\n }", "public function __invoke()\n {\n return new JwtAuthentication([\n 'secret' => getenv('JWT_SECRET_KEY'),\n 'attribute' => 'JWT',\n \"error\" => function ($response, $arguments) {\n \n return $response->withJson(['message' => \"Invalid token! ({$arguments['message']})\"], 401);\n\n }\n ]); \n }", "protected function getCurrentUserPermissionsRequest()\n {\n\n $resourcePath = '/1.0/kb/security/permissions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($httpBody);\n } elseif (is_array($httpBody) && $headers['Content-Type'] === 'application/json') {\n $httpBody = array_map(function($value) {\n return ObjectSerializer::sanitizeForSerialization($value);\n }, $_tempBody);\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createUser($request) {\n $response = $this->client->request('POST', 'user', [\n 'body' => $request,\n 'form_params' => [\n 'name' => $request->input('name'),\n 'email' => $request->input('email'),\n 'password'=> md5($request->input('password'))\n ]\n ]);\n \n return $response;\n }", "public function index(Request $request)\n {\n $header = getallheaders();\n $userParams = JWT::decode($header['Authorization'],$this->key, array('HS256'));\n if ($userParams->id == 1) {\n return User::where('role_id', 2)->get();\n }else{\n return reponse()->json([\n 'MESSAGE' => 'Dont have enough permission'], 403\n );\n }\n }", "public function createRequest()\n {\n return new ChipVN_Http_Request;\n }", "public function login(Request $request) {\n $jwtAuth = new JwtAuth();\n\n $json = $request->input('json', null);\n $params = json_decode($json);\n\n $username = (!is_null($json) && isset($params->username)) ? $params->username : null;\n $getToken = (!is_null($json) && isset($params->gettoken)) ? $params->gettoken : null;\n\n if(!is_null($username) && ($getToken == null || $getToken == 'false'))\n {\n $signup = $jwtAuth->signup($username);\n }elseif ($getToken != null){\n $signup = $jwtAuth->signup($username, $getToken);\n }else{\n $signup = array(\n 'status' => 'error',\n 'message' => 'Envia tus datos por post'\n );\n }\n \n return response()->json($signup, 200);\n }", "public function buildAuthorizationHeader ()\n {\n $this->addHeader('Authorization', 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret));\n $this->is_preauthorized_request = 1;\n }", "public function createToken()\n {\n $key = base64_encode(getenv('JWT_SECRET'));\n $payload = array(\n \"jti\" => base64_encode(random_bytes(32)),\n \"iat\" => time(),\n \"iss\" => getenv('BASE_URL'),\n \"nbf\" => time() + 10,\n \"exp\" => time() + (3600 * 24 * 15),\n \"data\" => [\n \"user\" => [\n \"username\" => $this->username,\n \"uuid\" => $this->uuid\n ]\n ]\n );\n try {\n return $this->container->jwt::encode($payload, $key, 'HS256');\n } catch (Exception $e) {\n return false;\n }\n }", "private function prepareAuth()\n {\n $this->client->setHeaders(\n [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->zendeskHelper->getToken()\n ]\n );\n }", "public function generateToken()\n {\n $token = array(\n \"iss\" => $this->id,\n \"aud\" => $this->name,\n \"iat\" => $this->email,\n \"nbf\" => $this->phone\n );\n\n return JWT::encode($token, self::JWT_KEY);\n }", "public function generateTokenAction($header_data,$data){ \n if( !isset($data['device_id']) ) {\n Library::logging('alert',\"API : generateToken : \".ERROR_INPUT.\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_INPUT, null);\n } else {\n try {\n $user_id = $header_data['id'];\n $device_id = $data['device_id'];\n $security = new \\Phalcon\\Security();\n $user = Users::findById($user_id);\n if($user) {\n $result = array();\n // generate new hash\n $hash = KEY.'-'.$device_id;\n $hash = $security->hash($hash); \n $user->hash = $hash;\n $user->save();\n\n $result['token'] = $hash;\n\n Library::output(true, '1', TOKEN_MSG, $result);\n } else {\n Library::output(false, '0', USER_NOT_REGISTERED, null);\n }\n } catch (Exception $e) {\n Library::logging('error',\"API : generateToken : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }\n }", "public function getJWT();", "public function requestToken() {\n\t\t$this->verify(false);\n\n\t\t// Optional TTL\n\t\t$options = array();\n\t\t$ttl = $this->getParam(self::XOAUTH_TOKEN_TTL, false);\n\t\tif($ttl) {\n\t\t\t$options['token_ttl'] = $ttl;\n\t\t}\n\n\t\t// 1.0a Compatibility : associate callback url to the request token\n\t\t$callbackUrl = $this->getParam(self::OAUTH_CALLBACK, true);\n\t\tif($callbackUrl) {\n\t\t\t$options['callback_url'] = $callbackUrl;\n\t\t}\n\n\t\t// Create a request token\n\t\t$consumerKey = $this->getParam(self::OAUTH_CONSUMER_KEY, true);\n\n\t\tif(! isset($this->storages['request_token'])) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'You must supply a storage object implementing ' .\n\t\t\t\t\t $this->storageMap['request_token']);\n\t\t}\n\n\t\t// MUST be included with an empty value to indicate this is a two-legged request.\n\t\t$is2Legged = $this->getParam(self::OAUTH_CALLBACK) === '';\n\t\tif($is2Legged) {\n\t\t\t// Create pre-authorized request token\n\t\t}\n\n\t\t$requestToken = $this->storages['request_token']->createRequestToken($consumerKey,\n\t\t\t$options);\n\n\t\t$data = [];\n\t\t$data[self::OAUTH_TOKEN] = Rfc3986::urlEncode($requestToken['token']);\n\t\t$data[self::OAUTH_TOKEN_SECRET] = Rfc3986::urlEncode(\n\t\t\t$requestToken['token_secret']);\n\t\t$data[self::OAUTH_CALLBACK_CONFIRMED] = '1';\n\n\t\tif(! empty($requestToken['expires_at']) && is_numeric($requestToken['expires_at'])) {\n\t\t\t$expiresAt = Carbon::createFromTimestamp(intval($requestToken['expires_at']));\n\n\t\t\t$data[self::XOAUTH_TOKEN_TTL] = $expiresAt->diffInSeconds();\n\t\t}\n\n\t\treturn $data;\n\t}", "public function vendJWT($request)\n {\n return $this->start()->uri(\"/api/jwt/vend\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function testIdentifyUserWithOauthTokenTypeSetsUserIdForValidHeader()\n {\n $request = new Request($this->config, ['HTTPS' => 'on']);\n $mockOauth = $this->getMockBuilder(OAuthModel::class)->disableOriginalConstructor()->getMock();\n $mockOauth->expects($this->once())\n ->method('verifyAccessToken')\n ->with('authPart')\n ->willReturn('TheUserId');\n\n $request->setOauthModel($mockOauth);\n\n $request->identifyUser('oauth authPart');\n\n $this->assertEquals('TheUserId', $request->user_id);\n $this->assertEquals('TheUserId', $request->getUserId());\n }", "public function testCreateAuthorization()\n\t{\n\t\t$this->options->set('api.accessKeyId', 'MyTestAccessKeyId');\n\t\t$this->options->set('api.secretAccessKey', 'MyTestSecretAccessKey');\n\n\t\t$url = \"https://\" . $this->options->get(\"api.url\") . \"/\";\n\t\t$headers = array(\n\t\t\t\"Date\" => \"Tue, 16 Jul 2013 19:39:06 +0300\",\n\t\t);\n\t\t$expectedResult = \"AWS MyTestAccessKeyId:yLA1qJ2sCHVRNPjpbRvcIA9fwGY=\";\n\n\t\t$this->assertThat(\n\t\t\t$this->object->createAuthorization(\"GET\", $url, $headers),\n\t\t\t$this->equalTo($expectedResult)\n\t\t);\n\t}", "public static function authorize() {\n\t\t$headers = apache_request_headers();\n\n\t\tif (!isset($headers[\"Authorization\"])) {\n\t\t\t// no authorization header set\n\t\t\treturn self::JWT_EMPTY;\n\t\t}\n\n\t\t$token = $headers[\"Authorization\"];\n\t\tif (strlen($token) < 8 || substr($token, 0, 7) !== \"Bearer \") {\n\t\t\t// malformed header value\n\t\t\treturn self::JWT_INVALID;\n\t\t}\n\t\t\n\t\t$token = substr($token, 7);\n\t\ttry {\n\t\t\t// decoding the token throws exception when the signature is invalid or the token has expired\n\t\t\tJWT::decode($token, Config::getJWTKey(), array(\"HS256\"));\n\n\t\t\t// if everything works the user is authorized\n\t\t\treturn self::JWT_VALID;\n\t\t} catch (UnexpectedValueException | SignatureInvalidException $e) {\n\t\t\t// TODO: for logging purposes it's maybe better to catch exception specifically\n\t\t\t// `JWT::decode` can throw SignatureInvalidException, BeforeValidException,\n\t\t\t// ExpiredException or UnexpectedValueException\n\t\t\treturn self::JWT_INVALID;\n\t\t} catch (ExpiredException $e) {\n\t\t\treturn self::JWT_EXPIRED;\n\t\t}\n\t}", "public function createToken();", "protected function getCreateRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\": 1}');\n\t\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "function createAuthHeader($method, $url) {\n $time = time()*1000;\n\n $data = \"$method $url $time\";\n $sig = sha1(\"$data {$this->secret}\");\n\n return \"Authorization: SprdAuth apiKey=\\\"{$this->key}\\\", data=\\\"{$data}\\\", sig=\\\"$sig\\\"\";\n }", "public function build()\n {\n return [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $this->token\n ]\n ];\n }", "public function generateCredentialsRequest( $extra_params = array() ) {\n\t\t$request = parent::generateCredentialsRequest();\n\t\t$grant_type = $this->getGrantType();\n\n\t\tif ( empty( $extra_params ) || 'refresh_token' !== $grant_type ) {\n\t\t\treturn $request;\n\t\t}\n\n\t\t$params = array(\n\t\t\t'body' => Query::build(\n\t\t\t\tarray_merge(\n\t\t\t\t\tQuery::parse( Utils::copyToString( $request->getBody() ) ),\n\t\t\t\t\t$extra_params\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\n\t\treturn Utils::modifyRequest( $request, $params );\n\t}", "public function getJWT()\n {\n // Collect all the data\n $secret = static::getSecretKey();\n $currentTime = time();\n $expire = $currentTime + 86400; // 1 day\n $request = Yii::$app->request;\n $hostInfo = '';\n // There is also a \\yii\\console\\Request that doesn't have this property\n if ($request instanceof WebRequest) {\n $hostInfo = $request->hostInfo;\n }\n // Merge token with presets not to miss any params in custom\n // configuration\n $token = array_merge([\n 'iat' => $currentTime,\n // Issued at: timestamp of token issuing.\n 'iss' => $hostInfo,\n // Issuer: A string containing the name or identifier of the issuer application. Can be a domain name and can be used to discard tokens from other applications.\n 'aud' => $hostInfo,\n 'nbf' => $currentTime,\n // Not Before: Timestamp of when the token should start being considered valid. Should be equal to or greater than iat. In this case, the token will begin to be valid 10 seconds\n 'exp' => $expire,\n // Expire: Timestamp of when the token should cease to be valid. Should be greater than iat and nbf. In this case, the token will expire 60 seconds after being issued.\n 'data' => [\n 'username' => $this->username,\n 'roleLabel' => $this->getRoleLabel(),\n 'lastLoginAt' => $this->last_login_at,\n ]\n ], static::getHeaderToken());\n // Set up id\n $token['jti'] = $this->getJTI(); // JSON Token ID: A unique string, could be used to validate a token, but goes against not having a centralized issuer authority.\n return [JWT::encode($token, $secret, static::getAlgo()), $token];\n }", "public function login(Request $request)\n {\n\n $jwtAuth = new \\JwtAuth();\n //recibir datos por POST\n $json = $request->input('json', null);\n $params = json_decode($json);\n $params_array = json_decode($json, true);\n\n //validar los datos\n $validate = \\Validator::make($params_array, [\n 'correo' => 'required|email',\n 'contrasena' => 'required'\n ]);\n\n if ($validate->fails()) {\n $signup = array(\n 'status' => 'error',\n 'code' => 404,\n 'message' => 'El usuario no se ha podido identificar',\n 'errores' => $validate->errors()\n );\n } else {\n //cifrar la password\n $pwd = hash('sha256', $params->contrasena);\n //logea al usuario con la funcion signup en jwtAuth y recibe el token\n $signup = $jwtAuth->signup($params->correo, $pwd);\n\n if (!empty($params->gettoken)) {\n //logea al usuario con la funcion signup en jwtAuth y recibe los datos decodificados\n $signup = $jwtAuth->signup($params->correo, $pwd, true);\n }\n }\n\n return response()->json($signup, 200);\n }", "public function authorize($uriComponents, $requestHeaders, $requestMethod, $requestParams, $requestBody)\n {\n// new QEEE(3,\"quality\",\"a\"),\n// new QEEE(2,\"milk\",\"b\"),\n// new QEEE(2,\"milk\",\"c\"),\n// new QEEE(5,\"pork\",\"c\"));\n// var_dump(ArrayUtils::sort($arr, array(new OrderColumn(\"num\", Comparison::descending))));\n// var_dump($arr);\n\n\n $this->uriComponents = $uriComponents;\n $this->requestHeaders = $requestHeaders;\n $this->requestMethod = $requestMethod;\n $this->requestParams = $requestParams;\n $this->requestBody = $requestBody;\n\n // Get and check the authorization and scope of the client\n // if the header contain authorization code\n // find user id with that code (check if the code is in expired_time) and check scope\n // else redirect to api with that path if api scope is (0,0,0,0)\n\n $this->scopes = \"0,0,0,0\";\n $accessToken = null;\n $this->chanelId = -1;\n foreach ($requestHeaders as $name => $value) {\n if (StringUtils::compareStringIgnoreCase(strtolower($name), strtolower(Constants::ChanelID))) {\n $this->chanelId = $value;\n } else if (StringUtils::compareStringIgnoreCase(strtolower($name), strtolower(Constants::Authorization))) {\n $accessToken = $value;\n }\n }\n\n if ($accessToken != null) {\n try {\n $token = TokenService::getInstance()->findFirstByToken($accessToken);\n if ($token != null) {\n $tokenDate = DateTimeUtils::convertStringToDateTimeDB($token->created_timestamp);\n $currentDate = DateTimeUtils::getCurrentTime();\n if ($tokenDate != false) {\n $interval = $currentDate->getTimestamp() - $tokenDate->getTimestamp();\n $expire = $token->expired_interval;\n if ($expire == null || $expire < 0 || $interval < $expire) {\n $authorization = AuthorizationService::getInstance()->find($token->authorized_id);\n// var_dump($authorization);\n foreach ($authorization as $item) {\n $auth_id = $item->id;\n switch ($this->chanelId) {\n case Configuration::BOARD:\n $boardConfiguration = BoardConfigurationService::getInstance()->findByAuthID($auth_id);\n// var_dump($boardConfiguration);\n if ($boardConfiguration != null) {\n $this->requestHeaders[Constants::BoardID] = $boardConfiguration->id;\n $this->scopes = $boardConfiguration->scopes;\n $this->interceptData = $boardConfiguration;\n $this->token = $token;\n $this->authorization = $item;\n }\n break;\n case Configuration::USER:\n $userConfiguration = UserService::getInstance()->findByAuthID($auth_id);\n if ($userConfiguration != null) {\n $this->requestHeaders[Constants::UserID] = $userConfiguration->id;\n $this->scopes = $userConfiguration->scopes;\n $this->interceptData = $userConfiguration;\n $this->token = $token;\n $this->authorization = $item;\n }\n break;\n case Configuration::USER_DEVICE:\n $userDeviceConfiguration = UserDeviceService::getInstance()->findByAuthID($auth_id);\n if ($userDeviceConfiguration != null) {\n $this->requestHeaders[Constants::UserDeviceID] = $userDeviceConfiguration->id;\n $this->scopes = $userDeviceConfiguration->scopes;\n $this->interceptData = $userDeviceConfiguration;\n $this->token = $token;\n $this->authorization = $item;\n }\n break;\n case Configuration::SERVER:\n $serverConfiguration = ServerConfigurationService::getInstance()->findByAuthID($auth_id);\n if ($serverConfiguration != null) {\n $this->requestHeaders[Constants::ServerID] = $serverConfiguration->id;\n $this->scopes = $serverConfiguration->scopes;\n $this->interceptData = $serverConfiguration;\n $this->token = $token;\n $this->authorization = $item;\n }\n break;\n default:\n echo \"Unknown Error\";\n break;\n }\n }\n }\n }\n }\n } catch (Exception $e) {\n// echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n echo \"Unknown Error\";\n }\n }\n }", "public function authenticatedRequest(Google_Http_Request $request)\n {\n $request = $this->sign($request);\n return $this->io->makeRequest($request);\n }", "private function getAuthHeader()\n {\n $credential = $this->apiContext->getCredential();\n\n $header = '<wsse:Security SOAP-ENV:mustUnderstand=\"1\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">';\n $header .= '<wsse:UsernameToken wsu:Id=\"UsernameToken-9\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">';\n $header .= '<wsse:Username>' . $credential->getUsername() . '</wsse:Username>';\n $header .= '<wsse:Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\">' . $credential->getPassword() . '</wsse:Password>';\n $header .= '</wsse:UsernameToken>';\n $header .= '</wsse:Security>';\n\n $headerbody = new \\SoapVar($header, XSD_ANYXML, null, null, null);\n return new \\SOAPHeader(self::PAYU_NAMESPACE, 'Security', $headerbody, true);\n }", "protected function getUserRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling getUser');\n }\n\n $resourcePath = '/users/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace('{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath);\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 (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\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 // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }", "public function getJWT()\n\t{\n\t\t$secret = static::getSecretKey();\n\t\t$currentTime = time();\n\t\t$expire = $currentTime + 28800; //28800 8 ชม //1 day 86400\n\t\t$request = Yii::$app->request;\n\t\t$hostInfo = '';\n\t\t// There is also a \\yii\\console\\Request that doesn't have this property\n\t\tif ($request instanceof WebRequest) {\n\t\t\t$hostInfo = $request->hostInfo;\n\t\t}\n\n\t\t// Merge token with presets not to miss any params in custom\n\t\t// configuration\n\t\t$token = array_merge([\n\t\t\t'iat' => $currentTime, // Issued at: timestamp of token issuing.\n\t\t\t'iss' => $hostInfo, // Issuer: A string containing the name or identifier of the issuer application. Can be a domain name and can be used to discard tokens from other applications.\n\t\t\t'aud' => $hostInfo,\n\t\t\t'nbf' => $currentTime, // Not Before: Timestamp of when the token should start being considered valid. Should be equal to or greater than iat. In this case, the token will begin to be valid 10 seconds\n\t\t\t'exp' => $expire, // Expire: Timestamp of when the token should cease to be valid. Should be greater than iat and nbf. In this case, the token will expire 60 seconds after being issued.\n\t\t\t'data' => [\n 'name' => $this->profile->name,\n\t\t\t\t'email' => $this->email,\n\t\t\t\t'username' => $this->username\n\t\t\t]\n\t\t], static::getHeaderToken());\n\t\t// Set up id\n\t\t$token['jti'] = $this->getJTI(); // JSON Token ID: A unique string, could be used to validate a token, but goes against not having a centralized issuer authority.\n\t\treturn [JWT::encode($token, $secret, static::getAlgo()), $token];\n }", "public function creating(Request $request)\n {\n $request->token = newToken();\n }", "public function getToken(Request $request)\n {\n $email = $request->input('username');\n $password = $request->input('password');\n //checking if user exists\n $user = User::where('email', $email)->get();\n if ($user->count() > 0) {\n $user = $user[0];\n if (Hash::check($password, $user->password)) {\n $role = $user->app_role;\n\n $oauth_client = DB::table('oauth_clients')->where('password_client', 1)->first();\n $request->request->add([\n 'grant_type' => 'password',\n 'client_id' => $oauth_client->id,\n 'client_secret' => $oauth_client->secret,\n 'scope' => '*',\n ]);\n $tokenRequest = Request::create(\n '/oauth/token',\n 'post'\n );\n return Route::dispatch($tokenRequest);\n\n// $temp = Route::dispatch($tokenRequest);\n// return $temp->expires_in;\n// return Carbon::parse($temp->expires_in)->toDateTimeString();\n } else {\n //type = 2 => incorrect passowrd\n return [\n 'error' => '2',\n 'errorType' => 'auth'];\n }\n } else {\n //type= 1 => no such user exists\n return [\n 'error' => '1',\n 'errorType' => 'auth'];\n }\n }", "public function loginRequest()\n {\n $response = $this->client->request('POST', $this->url, [\n 'json' => $this->body,\n 'headers' => $this->headers\n ]);\n return $response;\n\n }", "private function jwt($user) {\n $payload = [\n 'iss' => env('JWT_SECRET'), // Issuer of the token\n 'sub' => $user['id'], // Subject of the token\n 'iat' => time(), // Time when JWT was issued.\n 'exp' => time() + env('JWT_EXPIRATION_TIME') // Expiration time\n ];\n\n return JWT::encode($payload, env('JWT_SECRET'));\n }", "public function login(Request $request, JwtAuthService $jwt_auth_service) {\n $json = $request->get('json', null);\n\n //Decodificar el Json\n $params = json_decode($json);//Objeto\n\n //Array por defecto para devolver\n $data = [\n 'status' => 'error',\n 'code' => 400,\n 'message' => 'El usuario no se ha podido identificar'\n ];\n\n //Comprobar y validad los datos\n if($json != null) {\n $email = (isset($params->email)) ? $params->email : null;\n $password = (isset($params->password)) ? $params->password : null;\n $getToken = (isset($params->getToken)) ? $params->getToken : null;\n\n $validator = Validation::createValidator();\n $validate_email = $validator->validate($email, [\n new Email()\n ]);\n\n if(!empty($email) && count($validate_email) == 0 && !empty($password)) {\n //Cifrar la contraseña\n $pwd = hash('sha256', $password);\n\n //Devolver token o datos\n if($getToken) {\n $signup = $jwt_auth_service->signup($params->email, $pwd, $getToken);\n } else {\n $signup = $jwt_auth_service->signup($params->email, $pwd);\n }\n\n return new JsonResponse($signup);\n } else {\n $data['message'] = 'Validación incorrecta';\n }\n }\n\n //Crear respuesta en JSON\n return $this->responseJsonPersonalizado($data);\n }", "public function authorize(array $parameters = []): RequestInterface\n {\n return $this->createRequest(CreateTransactionRequest::class, $parameters);\n }", "public function getAuthUser(Request $request){\n $user = JWTAuth::toUser($request->token);\n return response()->json(['result' => $user]);\n }", "protected function create_new_request( $data )\n {\n $request = new \\WP_REST_Request();\n\n $request->set_header( 'X-POC-Access-Token', '8wdT9UsxXd' );\n\n $request->set_header( 'Content-Type', 'application/json' );\n\n $request->set_body( json_encode( $data ) );\n\n return $request;\n }", "public function createRequest(): IRequest;", "public function createRequest(string $method, string $uri, array $body = []): RequestInterface\n {\n $request = $this->requestFactory->createRequest($method, $uri)\n ->withHeader('Content-Type', 'application/json')\n ->withHeader('Authorization', 'Token ' . $this->token)\n ->withHeader('X-Secret', $this->secret)\n ;\n\n if (!empty($body)) {\n $request = $request\n ->withBody($this->streamFactory->createStream(json_encode($body, JSON_UNESCAPED_UNICODE)))\n ;\n }\n\n return $request;\n }", "public function createRequestToExchange(string $code) : RequestInterface\n {\n $request = RequestFactory::createStandardIntuitRequest(RequestType::OAUTH);\n $request->setMethod(RequestInterface::POST)\n ->setUrl($this->getDiscoveryURLs()->getTokenEndpointUrl())\n ->setHeader($this->generateHeaderForTokenRequest())\n ->setBody($this->generateBodyForTokenRequest($code));\n return $request;\n }", "public function get_test_authorization_header()\n {\n }", "public function getJWT()\n {\n // Collect all the data\n $secret = static::getSecretKey();\n $currentTime = time();\n// $expire = $currentTime + 24 * 60 * 60; // 微信端不过期\n $request = Yii::$app->request;\n $hostInfo = '';\n // There is also a \\yii\\console\\Request that doesn't have this property\n if ($request instanceof WebRequest) {\n $hostInfo = $request->hostInfo;\n }\n\n // Merge token with presets not to miss any params in custom\n // configuration\n $token = array_merge([\n 'iat' => $currentTime, // Issued at: timestamp of token issuing.\n 'iss' => $hostInfo, // Issuer: A string containing the name or identifier of the issuer application. Can be a domain name and can be used to discard tokens from other applications.\n 'aud' => $hostInfo,\n 'nbf' => $currentTime, // Not Before: Timestamp of when the token should start being considered valid. Should be equal to or greater than iat. In this case, the token will begin to be valid 10 seconds\n// 'exp' => $expire, // 微信端不过期 Expire: Timestamp of when the token should cease to be valid. Should be greater than iat and nbf. In this case, the token will expire 60 seconds after being issued.\n 'data' => [\n 'username' => $this->username,\n 'lastLoginAt' => $this->last_login_at,\n ]\n ], static::getHeaderToken());\n // Set up id\n $token['jti'] = $this->getJTI(); // JSON Token ID: A unique string, could be used to validate a token, but goes against not having a centralized issuer authority.\n return [JWT::encode($token, $secret, static::getAlgo()), $token];\n }", "protected function generateHeader()\n\t{\n\t\t$header \t= [];\n\t\t$header[] \t= 'Authorization: Basic '.$this->credentials;\n\t\t$header[] \t= 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8';\n\n\t\treturn $header;\n\t}", "public function bearerToken($request)\n {\n $header = $request->header('Authorization', '');\n if($header){\n if (Str::startsWith($header, 'Bearer ')) {\n $token = Str::substr($header, 7);\n \n // Verify the token with the user.\n $check = User::where('api_token', $token)->first();\n if($check){\n return ['msg' => 'User is authorized.', 'status'=>100];\n }else{\n return ['msg' => 'Unauthorized user.', 'status'=>101];\n }\n }\n } else{\n return ['msg' => 'Authentication token is missing.', 'status'=>101];\n }\n }", "public function create($params)\n {\n $status = Response::STATUS_BAD_REQUEST;\n $data = array();\n\n $email = $this->safeGet($params, 'email', '');\n $password = $this->safeGet($params, 'password', '');\n\n if (!$email) {\n $data['message'] = __('api_required_field', array(\n '[field]' => 'email'\n ));\n } elseif (!$password) {\n $data['message'] = __('api_required_field', array(\n '[field]' => 'password'\n ));\n } else {\n $status = Response::STATUS_NOT_FOUND;\n\n list($user_exists, $user_data, $login, $password, $salt) = fn_auth_routines(\n array(\n 'user_login' => $email,\n 'password' => $password,\n ),\n array()\n );\n if ($user_data && fn_generate_salted_password($password, $salt) == $user_data['password']) {\n list($token, $expiry_time) = fn_get_user_auth_token($user_data['user_id']);\n\n $status = Response::STATUS_CREATED;\n $data = array(\n 'token' => $token,\n 'ttl' => $expiry_time - TIME,\n );\n }\n }\n\n return array(\n 'status' => $status,\n 'data' => $data\n );\n }", "public function user(): UserRequestBuilder {\n return new UserRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "function authUsers($userType, Request $request, Response $response) {\n $authHeader = $request->getHeader('Authorization');\n list($jwt) = sscanf($authHeader[0], 'Bearer %s');\n if ($jwt) {\n try {\n $data = getTokenData($request);\n if (in_array($data[Constants::USERS_FLD_USER_TYPE], $userType)) {\n return true;\n } else {\n return false;\n }\n } catch (Exception $e) {\n return false;\n }\n } else {\n return false;\n }\n return false;\n}", "public function generateAuthorizationHeader($method, $url, $serviceName, $postParams=array()) {\n \n $app = Dataface_Application::getInstance();\n $baseUrl = $url;\n if (strpos($baseUrl, '?') !== false) {\n $baseUrl = substr($baseUrl, 0, strpos($baseUrl, '?'));\n }\n $queryString = substr($url, strlen($baseUrl));\n $params = array();\n foreach ($postParams as $k=>$v) {\n $params[$k] = $v;\n }\n if ($queryString) {\n if ($queryString[0] == '?') {\n $queryString = substr($queryString, 1);\n }\n parse_str($queryString, $tmpParams);\n foreach ($tmpParams as $k=>$v) {\n $params[$k] = $v;\n }\n }\n \n $serviceConfig =& $app->_conf['oauth_'.$serviceName];\n $isTokenRequest = $serviceConfig['request_token_url'] == $url;\n \n $params['oauth_consumer_key'] = $serviceConfig['client_id'];\n $params['oauth_nonce'] = md5(mt_rand());\n $params['oauth_signature_method'] = 'HMAC-SHA1';\n $params['oauth_timestamp'] = time();\n $params['oauth_version'] = '1.0';\n //print_r($_SERVER);exit;\n //print_r($_SESSION);\n $oauthToken = $this->getOauthToken($serviceName);\n if (!isset($params['oauth_token']) and isset($oauthToken) and !$isTokenRequest) {\n $params['oauth_token'] = $oauthToken;\n }\n \n $tmp = array();\n foreach ($params as $k=>$v) {\n $tmp[rawurlencode($k)] = rawurlencode($v);\n }\n $params = $tmp;\n ksort($params);\n \n $paramString = '';\n $first = true;\n foreach ($params as $k=>$v) {\n if ($first) {\n $first = false;\n } else {\n $paramString .= '&';\n }\n $paramString .= $k . '=' . $v;\n }\n $baseUrl = $url;\n if (strpos($url, '?') !== false) {\n $baseUrl = substr($url, 0, strpos($url, '?'));\n }\n $signatureBase = strtoupper($method).'&'.rawurlencode($baseUrl).'&'.rawurlencode($paramString);\n //echo \"Signature base: \".$signatureBase;exit;\n $signingKey = rawurlencode($serviceConfig['client_secret']).'&';\n $tokenSecret = $this->getOauthTokenSecret($serviceName);\n if (isset($tokenSecret) and !$isTokenRequest) {\n $signingKey .= rawurlencode($tokenSecret);\n }\n //echo \"<br>Signing Key: \".$signingKey;exit;\n $signature = base64_encode(hash_hmac(\"sha1\", $signatureBase, $signingKey, true));\n //echo \"<br>Signature \".$signature;exit;\n $oauth_keys = array(\n 'oauth_consumer_key', 'oauth_nonce', 'oauth_signature_method', 'oauth_timestamp', 'oauth_token', 'oauth_version', 'oauth_callback'\n );\n \n $auth_params = array();\n foreach ($oauth_keys as $k) {\n if (isset($params[$k])) {\n $auth_params[$k] = $params[$k];\n }\n }\n $auth_params['oauth_signature'] = rawurlencode($signature);\n \n $DST = 'OAuth ';\n $first = true;\n foreach ($auth_params as $k=>$v) {\n if ($first) {\n $first = false;\n } else {\n $DST .= ', ';\n }\n $DST .= $k.'=\"'.$v.'\"';\n }\n //echo $DST;exit;\n return $DST;\n \n \n }", "protected function getCurrentUserSubjectRequest()\n {\n\n $resourcePath = '/1.0/kb/security/subject';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($httpBody);\n } elseif (is_array($httpBody) && $headers['Content-Type'] === 'application/json') {\n $httpBody = array_map(function($value) {\n return ObjectSerializer::sanitizeForSerialization($value);\n }, $_tempBody);\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getPublicKeysRequest()\n {\n\n $resourcePath = '/v1/account/pubkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function headerWithToken()\n {\n return [\n 'Accept:application/json',\n 'Content-Type:application/json',\n 'Authorization:Bearer ' . $this->token\n ];\n }" ]
[ "0.6171909", "0.59389013", "0.5937782", "0.5822697", "0.57804376", "0.57697195", "0.5762346", "0.573369", "0.56888425", "0.56774914", "0.56774914", "0.56142706", "0.55928224", "0.55868185", "0.5564341", "0.55626774", "0.55427176", "0.55412066", "0.55345464", "0.55021286", "0.5484791", "0.547757", "0.54700446", "0.5465417", "0.5457182", "0.5445097", "0.54413027", "0.5408504", "0.5377632", "0.5376944", "0.5371045", "0.53627115", "0.53522664", "0.53474706", "0.5342907", "0.53408855", "0.5330996", "0.53228277", "0.53173155", "0.5313472", "0.5311241", "0.53053236", "0.53034985", "0.5289895", "0.5289547", "0.5267887", "0.526745", "0.526301", "0.5261934", "0.525169", "0.5247618", "0.5244229", "0.5237271", "0.52271783", "0.521884", "0.52117705", "0.52116233", "0.5203926", "0.51972276", "0.51941174", "0.51908463", "0.5187262", "0.51841545", "0.5178659", "0.5177474", "0.5176427", "0.517497", "0.5174383", "0.51615274", "0.5160583", "0.5153725", "0.5153096", "0.5151513", "0.51474977", "0.51420677", "0.5141081", "0.5134271", "0.51322854", "0.51202166", "0.5119602", "0.51190937", "0.51033187", "0.5099451", "0.50974536", "0.50903964", "0.5086296", "0.5086291", "0.5081386", "0.50744265", "0.5072679", "0.5061745", "0.5057455", "0.5056547", "0.50563633", "0.50511384", "0.50502306", "0.5039168", "0.50360656", "0.50359756", "0.5035794" ]
0.65883183
0
Run the database seeds.
public function run() { factory(OauthClient::class,1)->create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Display a listing of the resource.
public function index() { return view('User.notifications.index'); }
{ "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
translator ready mail ready addnews ready
function findgem_getmoduleinfo(){ $info = array( "name"=>"Find Gems", "version"=>"1.1", "author"=>"Eric Stevens", "category"=>"Forest Specials", "download"=>"core_module", ); return $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNews($subj,$message,$un) \n{\n\tglobal $DB, $Core, $lang;\n if(!$subj | !$message)\n\t{\n\t\toutput_message('validation', $lang['field_left_blank']);\n\t}\n\telse\n\t{\n\t\t$post_time = time();\n\t\t$sql = \"INSERT INTO mw_news(title, message, posted_by, post_time) VALUES('\".mysqli_real_escape_string($DB->getConn(), $subj).\"','\".mysqli_real_escape_string($DB->getConn(), $message).\"','\".mysqli_real_escape_string($DB->getConn(), $un).\"','\".$post_time.\"')\";\n $tabs = $DB->query($sql);\n\t\t$Core->clearCache();\n\t\toutput_message('success', $lang['news_add_success']);\n }\n}", "function Newsletters()\n\t{\n\t\t$this->PopupWindows[] = 'sendpreviewdisplay';\n\t\t$this->PopupWindows[] = 'checkspamdisplay';\n\t\t$this->PopupWindows[] = 'viewcompatibility';\n\t\t$this->LoadLanguageFile();\n\t}", "function LaunchNewsletter()\n{\n\tglobal $xoopsModule, $xoopsConfig, $dateformat;\n\txoops_cp_header();\n\tadminmenu(5);\n\n\tif (file_exists(XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/newsletter.php')) {\n\t\tinclude_once XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/newsletter.php';\n\t} else {\n\t\tinclude_once XOOPS_ROOT_PATH.'/modules/news/language/english/newsletter.php';\n\t}\n\techo \"<br />\";\n\t$story = new NewsStory();\n\t$exportedstories=array();\n\t$topiclist='';\n\t$removebr=false;\n\tif(isset($_POST['removebr']) && intval($_POST['removebr'])==1) {\n\t\t$removebr=true;\n\t}\n\t$date1=$_POST['date1'];\n\t$date2=$_POST['date2'];\n\t$timestamp1=mktime(0,0,0,intval(substr($date1,5,2)), intval(substr($date1,8,2)), intval(substr($date1,0,4)));\n\t$timestamp2=mktime(0,0,0,intval(substr($date2,5,2)), intval(substr($date2,8,2)), intval(substr($date2,0,4)));\n\tif(isset($_POST['export_topics'])) {\n\t\t$topiclist=implode(\",\",$_POST['export_topics']);\n\t}\n\t$tbltopics=array();\n\t$exportedstories=$story->NewsExport($timestamp1, $timestamp2, $topiclist, 0, $tbltopics);\n $newsfile=XOOPS_ROOT_PATH.'/uploads/newsletter.txt';\n\tif(count($exportedstories)) {\n\t\t$fp=fopen($newsfile,'w');\n\t\tif(!$fp) {\n\t\t\tredirect_header('index.php',4,sprintf(_AM_NEWS_EXPORT_ERROR,$newsfile));\n\t\t}\n\n\t\tforeach($exportedstories as $onestory)\n\t\t{\n\t\t\t$content=$newslettertemplate;\n\t\t\t$content=str_replace('%title%',$onestory->title(),$content);\n\t\t\t$content=str_replace('%uname%',$onestory->uname(),$content);\n\t\t\t$content=str_replace('%created%',formatTimestamp($onestory->created(),$dateformat),$content);\n\t\t\t$content=str_replace('%published%',formatTimestamp($onestory->published(),$dateformat),$content);\n\t\t\t$content=str_replace('%expired%',formatTimestamp($onestory->expired(),$dateformat),$content);\n\t\t\t$content=str_replace('%hometext%',$onestory->hometext(),$content);\n\t\t\t$content=str_replace('%bodytext%',$onestory->bodytext(),$content);\n\t\t\t$content=str_replace('%description%',$onestory->description(),$content);\n\t\t\t$content=str_replace('%keywords%',$onestory->keywords(),$content);\n\t\t\t$content=str_replace('%reads%',$onestory->counter(),$content);\n\t\t\t$content=str_replace('%topicid%',$onestory->topicid(),$content);\n\t\t\t$content=str_replace('%topic_title%',$onestory->topic_title(),$content);\n\t\t\t$content=str_replace('%comments%',$onestory->comments(),$content);\n\t\t\t$content=str_replace('%rating%',$onestory->rating(),$content);\n\t\t\t$content=str_replace('%votes%',$onestory->votes(),$content);\n\t\t\t$content=str_replace('%publisher%',$onestory->uname(),$content);\n\t\t\t$content=str_replace('%publisher_id%',$onestory->uid(),$content);\n\t\t\t$content=str_replace('%link%',XOOPS_URL.'/modules/news/article.php?storyid='.$onestory->storyid(),$content);\n\t\t\tif($removebr) {\n\t\t\t\t$content=str_replace('<br />',\"\\r\\n\",$content);\n\t\t\t}\n\t\t\tfwrite($fp,$content);\n\t\t}\n\t\tfclose($fp);\n\t\t$newsfile=XOOPS_URL.'/uploads/newsletter.txt';\n\t\tprintf(_AM_NEWS_NEWSLETTER_READY,$newsfile,XOOPS_URL.'/modules/news/admin/index.php?op=deletefile&amp;type=newsletter');\n\t} else {\n\t\tprintf(_AM_NEWS_NOTHING);\n\t}\n}", "protected function getSystemNews() {}", "function warquest_show_breaking_news() { \r\n\r\n\t/* input */\r\n\tglobal $page;\r\n\tglobal $player;\r\n\tglobal $config;\r\n\tglobal $browser;\r\n\r\n\t$page .= '<div class=\"subparagraph\">'.t('HOME_FLASH_NEWS_TITLE').'</div>';\r\n\t$message = '';\r\n\t\r\n\t$language=\"en\";\r\n\tif (isset($player) && (strlen($player->language)>0)) {\r\n\t\t$language=$player->language;\r\n\t} \r\n\t\t\r\n\t$query = 'select date, body, content from news where language=\"en\" order by id desc ';\r\n\t$result = warquest_db_query($query);\r\n\t\t\r\n\twhile ($data=warquest_db_fetch_object($result)) {\r\n\t\t\t\r\n\t\t$message .= '<span class=\"money\">';\r\n\t\t$message .= $data->body;\r\n\t\t$message .= '</span> ';\r\n\t\t$message .= $data->content;\r\n\t\t$message .= ' ';\r\n\t}\r\n\t\t\r\n\t$page .= '<div class=\"box\">';\r\n\t\r\n $page .= '<marquee id=\"breakingnews\" behavior=\"scroll\" direction=\"left\" scrollamount=\"4\">';\r\n\t$page .= $message;\r\n\t$page .= '</marquee>';\r\n\t$page .= '</div>';\r\n\t\r\n\t$page .= '<script language=\"JavaScript\" src=\"'.$config[\"content_url\"].'js/news2.js\" type=\"text/javascript\"></script>';\r\n\t$page .= '<script language=\"JavaScript\">';\r\n\t$page .= 'newsInit('.MENU_SERVICE.','.EVENT_GET_HEADLINES.'); newsCall();';\r\n\t$page .= '</script>';\r\n}", "public function __construct()\n\t{\n\t\tt('lang')->load('site/deposit_sms');\n\t}", "function generateNewsletterHtml($intereses, $posts, $lang) {\n $files = scandir(\"./templates/\");\n foreach ($files as $file) {\n $file_parts = pathinfo($file);\n if($file_parts['extension'] == 'html') {\n $template[$file_parts['filename']] = file_get_contents (\"./templates/\".$file);\n }\n }\n \n //Noticias ------------------\n $news = '';\n foreach ($_REQUEST['data'] as $item ) {\n if($item['post_id'] >= 0 && $item['format'] != '') {\n $temp = $template['new_'.$item['format']];\n //https://help.activecampaign.com/hc/en-us/articles/220358207-How-to-use-Conditional-Content-in-emails\n if (isset($item['intereses']) && count($item['intereses']) > 0) {\n $temp = \"<!-- %IF in_array('\".implode($item['intereses'], \"', \\$SLASHED_TAGS) || in_array('\").\"', \\$SLASHED_TAGS)% -->\\n\\n\".$temp.\"\\n\\n<!-- %/IF% -->\";\n }\n $temp = str_replace(\"[text]\", ( isset($item['texto_especial']) && $item['texto_especial'] != '' ? strip_tags($item['texto_especial']) : strip_tags($posts[$item['post_id']]->excerpt->rendered)), str_replace(\"[link]\", $posts[$item['post_id']]->link, str_replace(\"[title]\", $posts[$item['post_id']]->title->rendered, $temp)));\n $cat = json_decode(file_get_contents(DOMAIN_WP.\"/wp-json/wp/v2/categories/\". $posts[$item['post_id']]->categories[0]));\n $temp = str_replace(\"[category]\", $cat->name, $temp);\n if($item['imagen'] != '') {\n $temp = str_replace(\"[image]\", $item['imagen'], $temp);\n } else {\n $current_image = json_decode(file_get_contents(DOMAIN_WP.\"/wp-json/wp/v2/media/\". $posts[$item['post_id']]->featured_media));\n if($current_image->media_details->sizes->medium_large) $temp = str_replace(\"[image]\", $current_image->media_details->sizes->medium_large->source_url, $temp);\n else $temp = str_replace(\"[image]\", $current_image->media_details->sizes->full->source_url, $temp);\n }\n } else $temp = \"\";\n $news .= $temp;\n }\n\n //Ayudas -------------\n $helps = '';\n if(is_array($_REQUEST['help']) && count($_REQUEST['help']) > 0) {\n $max = ceil(count($_REQUEST['help'])/3) * 3;\n for($i = 1; $i <= $max; $i++) {\n $key = $i-1;\n $item = $_REQUEST['help'][$key];\n if($item['title'] != '') {\n $helps .= replaceTags ($item, $template['help']);\n } else {\n $helps .= \"<td width='33%'></td>\";\n }\n if (($i%3) == 0 && $i < $max) {\n $helps .= \"</tr><tr>\"; \n }\n }\n }\n\n //Banners ------------------\n $banners = '';\n if(is_array($_REQUEST['banner']) && count($_REQUEST['banner']) > 0) {\n foreach($_REQUEST['banner'] as $item) {\n $banners .= replaceTags ($item, $template['banner']); \n }\n }\n\n //Generamos la plantilla\n $newsletter = str_replace(\"[BANNERS]\", $banners, str_replace(\"[YEAR]\", $_REQUEST['ano'], str_replace(\"[HELPS]\", $helps, str_replace(\"[NEWS]\", $news, $template['mail_'.$lang]))));\n\n if(is_array($_REQUEST['help']) && count($_REQUEST['help']) > 0) $newsletter = str_replace(\"[END_IF_HELPS]\", \"\", str_replace(\"[IF_HELPS]\", \"\", $newsletter));\n else $newsletter = str_replace(\"[END_IF_HELPS]\", \" -->\", str_replace(\"[IF_HELPS]\", \"<!-- \", $newsletter));\n\n file_put_contents(\"temp.html\", $newsletter);\n return;\n}", "function svbk_mandrill_emails_init() {\n\tload_plugin_textdomain( 'svbk-mandrill-emails', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n}", "function news($word) {\n $link = new Db;\n $link->query(sprintf(\"select distinct newssite.razd,newssite.id,newssite.subj,newssiterazd.type_user from newssite left join newssiterazd on newssite.razd=newssiterazd.id where newssite.site='%d' and newssiterazd.site='%d' and (newssite.msg like '%%%s%%' or newssite.subj like '%%%s%%')\",$this->sitenumber,$this->sitenumber,$word,$word));\n $y=$link->num_rows();\n $j=0;\n for ($i=0;$i<$y;$i++) {\n $res[$i]=$link->next_record();\n if ($this->auth->verify($res[$i])) {\n $result[$j]=$res[$i];$j++;\n }\n }\n $smarty = new Smarty; \n $smarty->assign(\"res\",$result);\n $smarty->assign(\"word\",$word);\n $smarty->assign(\"from\",$this->from);\n $res=$smarty->fetch(\"{$this->path}sres-news.tpl\");\n return $res;\n// $link->close();\n }", "function mail_fetch_setnew() {\n include_once (SM_PATH . 'plugins/mail_fetch/functions.php');\n mail_fetch_setnew_function();\n}", "function og_simplenews_manager_add_newsletter($form, &$form_state) {\n $name = $form_state['values']['newsletters']['new'];\n if (!empty($name)) {\n og_simplenews_new_group_newsletter($form_state['node'], $name);\n }\n}", "public function load_textdomain()\n {\n }", "public function translated();", "public function translated();", "public function news();", "function run($map)\n\t{\n\t\trequire_lang('newsletter');\n\t\trequire_lang('javascript');\n\n\t\t$newsletter_id=array_key_exists('param',$map)?intval($map['param']):db_get_first_id();\n\n\t\t$_newsletter_title=$GLOBALS['SITE_DB']->query_value_null_ok('newsletters','title',array('id'=>$newsletter_id));\n\t\tif (is_null($_newsletter_title)) return paragraph(do_lang_tempcode('MISSING_RESOURCE'));\n\t\t$newsletter_title=get_translated_text($_newsletter_title);\n\n\t\t$address=post_param('address'.strval($newsletter_id),'');\n\t\tif ($address!='')\n\t\t{\n\t\t\trequire_code('newsletter');\n\n\t\t\trequire_code('type_validation');\n\t\t\tif (!is_valid_email_address($address))\n\t\t\t{\n\t\t\t\t$msg=do_template('INLINE_WIP_MESSAGE',array('MESSAGE'=>do_lang_tempcode('INVALID_EMAIL_ADDRESS')));\n\t\t\t\treturn do_template('BLOCK_MAIN_NEWSLETTER_SIGNUP',array('URL'=>get_self_url(),'MSG'=>$msg));\n\t\t\t}\n\n\t\t\tif (!array_key_exists('path',$map)) $map['path']='uploads/website_specific/signup.txt';\n\t\t\t$path_exists=file_exists(get_custom_file_base().'/'.$map['path']);\n\n\t\t\trequire_code('character_sets');\n\t\t\t$password=basic_newsletter_join($address,4,NULL,!$path_exists,$newsletter_id,post_param('firstname'.strval($newsletter_id),''),post_param('lastname'.strval($newsletter_id),''));\n\t\t\tif ($password=='')\n\t\t\t{\n\t\t\t\treturn do_template('INLINE_WIP_MESSAGE',array('MESSAGE'=>do_lang_tempcode('NEWSLETTER_THIS_ALSO')));\n\t\t\t}\n\t\t\tif ($password==do_lang('NA'))\n\t\t\t{\n\t\t\t\t$manage_url=build_url(array('page'=>'newsletter','email'=>$address),get_module_zone('newsletter'));\n\t\t\t\treturn do_template('INLINE_WIP_MESSAGE',array('MESSAGE'=>do_lang_tempcode('ALREADY_EMAIL_ADDRESS',escape_html($manage_url->evaluate()))));\n\t\t\t}\n\n\t\t\trequire_code('mail');\n\t\t\tif ($path_exists)\n\t\t\t{\n\t\t\t\t$url=(url_is_local($map['path'])?(get_custom_base_url().'/'):'').$map['path'];\n\t\t\t\tmail_wrap(array_key_exists('subject',$map)?$map['subject']:do_lang('_WELCOME'),convert_to_internal_encoding(http_download_file($url)),array($address),empty($map['to'])?'':$map['to'],'','',3,NULL,false,NULL,true);\n\t\t\t}\n\n\t\t\treturn do_template('BLOCK_MAIN_NEWSLETTER_SIGNUP_DONE',array('_GUID'=>'9953c83685df4970de8f23fcd5dd15bb','NEWSLETTER_TITLE'=>$newsletter_title,'NID'=>strval($newsletter_id),'PASSWORD'=>$password,'PATH_EXISTS'=>$path_exists));\n\t\t} else\n\t\t{\n\t\t\treturn do_template('BLOCK_MAIN_NEWSLETTER_SIGNUP',array('NEWSLETTER_TITLE'=>$newsletter_title,'NID'=>strval($newsletter_id),'URL'=>get_self_url()));\n\t\t}\n\t}", "public function translationStart()\n {\n }", "function translation() {\n\t\t\n\t\t// only use, if we have it...\n\t\tif( function_exists('load_plugin_textdomain') ) {\n\t\t\n\t\t\t// load it\n\t\t\tload_plugin_textdomain( \n\t\t\t\n\t\t\t\t// unique name\n\t\t\t\t'cp-multisite', \n\t\t\t\t\n\t\t\t\t// deprecated argument\n\t\t\t\tfalse,\n\t\t\t\t\n\t\t\t\t// path to directory containing translation files\n\t\t\t\tplugin_dir_path( CPMU_PLUGIN_FILE ) . 'languages/'\n\t\t\t\t\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t}", "function enh_latest_news_text($mod_id, $nl_url, $ModName) {\n\n// get vars\n $prefix = pnConfigGetVar('prefix');\t\t\n list($dbconn) = pnDBGetConn();\n\t $pntable =& pnDBGetTables();\n\n $language = pnConfigGetVar('language');\n\n// name the lang file the same as this file\n include(\"modules/$ModName/modules/lang/$language/enhnews.php\");\n\n// get the module setting from the database\n\t $modsql = \"SELECT mod_qty, mod_data FROM $prefix\"._nl_modules.\" WHERE mod_id = '$mod_id'\";\n\t\t$result = $dbconn->Execute($modsql);\n\t if ($dbconn->ErrorNo() != 0) {\n\t\t echo _DBREADERROR;\n\t }\n if (!$result->EOF) {\n\t list($mod_qty, $mod_data) = $result->fields;\n } else {\n\t\t // take care od errors?\n\t\t}\n\n// clear the output variable\n// title of the page to show up\n\t $output =\"\"._ENHLATESTARTICLES.\":\\n\\n\";\n\n// query the database and generate your output in the amount of mod_qty\n\t $sql = \"SELECT pn_sid, pn_title, pn_hometext, pn_bodytext, pn_informant, pn_time \n\t\t FROM $pntable[stories] \n\t\t WHERE pn_ihome = '0' ORDER BY pn_time DESC limit 0,$mod_qty\";\n\n\t\t$result = $dbconn->Execute($sql);\n\t if ($dbconn->ErrorNo() != 0) {\n\t\t echo _DBREADERROR;\n\t }\n\t\t\t\t\t\t\n while(!$result->EOF) {\n\t\t list($pn_sid, $pn_title, $pn_hometext, $pn_bodytext, $pn_informant, $pn_time) = $result->fields;\n\t\t\t\t$result->MoveNext(); \n\t\t $output .= \"$pn_title\\n\";\n\t\t $output .= \"$pn_hometext\\n\";\n\t\t if ($pn_bodytext) {\n\t\t\t $output .= \"\"._READMORE.\": $nl_url/modules.php?op=modload&name=News&file=article&sid=$pn_sid\\n\";\n\t\t\t }\n\t\t $output .= \"\\n\";\n\t\t}\n\n// strip the slashes out all at once\n\t $output = stripslashes($output);\n\n// send the output to the system (it must be output and not another variable name)\n\t return $output;\n}", "public function localization_setup() {\n load_plugin_textdomain( 'wc-mailerlite', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );\n }", "function Newsletter()\n{\n global $xoopsDB;\n include_once XOOPS_ROOT_PATH.\"/class/xoopsformloader.php\";\n xoops_cp_header();\n adminmenu(5);\n echo \"<br />\";\n\t$sform = new XoopsThemeForm(_AM_NEWS_NEWSLETTER, \"newsletterform\", XOOPS_URL.'/modules/news/admin/index.php', 'post');\n\t$dates_tray = new XoopsFormElementTray(_AM_NEWS_NEWSLETTER_BETWEEN);\n\t$date1 = new XoopsFormTextDateSelect('', 'date1',15,time());\n\t$date2 = new XoopsFormTextDateSelect(_AM_NEWS_EXPORT_AND, 'date2',15,time());\n\t$dates_tray->addElement($date1);\n\t$dates_tray->addElement($date2);\n\t$sform->addElement($dates_tray);\n\n\t$topiclist=new XoopsFormSelect(_AM_NEWS_PRUNE_TOPICS, 'export_topics','',5,true);\n\t$topics_arr=array();\n\t$xt = new NewsTopic();\n\t$allTopics = $xt->getAllTopics(false);\t\t\t\t// The webmaster can see everything\n\t$topic_tree = new XoopsObjectTree($allTopics, 'topic_id', 'topic_pid');\n\t$topics_arr = $topic_tree->getAllChild(0);\n\tif(count($topics_arr)) {\n\t\tforeach ($topics_arr as $onetopic) {\n\t\t\t$topiclist->addOption($onetopic->topic_id(),$onetopic->topic_title());\n\t\t}\n\t}\n\t$topiclist->setDescription(_AM_NEWS_EXPORT_PRUNE_DSC);\n\t$sform->addElement($topiclist,false);\n\t$sform->addElement(new XoopsFormHidden('op', 'launchnewsletter'), false);\n\t$sform->addElement(new XoopsFormRadioYN(_AM_NEWS_REMOVE_BR, 'removebr',1),false);\n\t$button_tray = new XoopsFormElementTray('' ,'');\n\t$submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit');\n\t$button_tray->addElement($submit_btn);\n\t$sform->addElement($button_tray);\n\t$sform->display();\n}", "public function __construct()\n\t{\n\t\tt('lang')->load('sms_gateway_handler/forgot');\n\t}", "function createOld() {\n\t $my\t= JFactory::getUser();\n\n\t $Itemid = $GLOBALS[JNEWS.'itemidAca'];\n\t if(!empty($Itemid)){\n\t\t $item = '&Itemid=' . $Itemid ;\n\t }else{\n\t\t $item = '';\n\t }\n\n\t $this->_addCSS();\n\n\t $hidden = '';\n\t $htmlOK = false;\n\t $HTML = '';\n\t $formname = 'modjnewsForm'.$this->num;\n\t //check if subscription listing is not empty\n\t //if not empty print the module\n\t //else just print the message\n\t \t$HTML .= '<div id=\"jnews_module'.$this->num.'\">';\n\t\t\t\t\t\tswitch( $this->effect ) {\n\t\t\t\t\t\t case 'default':\n\t\t\t\t\t\t $HTML .= '';\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t case 'mootools-slide':\n\t\t\t\t\t\t\t\t$HTML .= $this->_addMootoolsSlide();\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t case 'mootools-modal':\n\t\t\t \t \t$HTML .= $this->_addMootoolsModal();\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t default:\n\t\t\t\t\t\t $HTML .= '';\n\t\t\t\t\t\t}\n\n\t\tif (!empty($this->lists)) {\n\t\t \t$subscriber = '';\n\t\t if ($my->id >0) {\t//login\n\t\t\t $loggedin = true;\n\t\t\t $subscriber = $this->_getSubscriberInfo($my->id);\n\t\t\t if(empty($subscriber)) $loggedin = false;\n\t\t } else {\t//logout\n\t\t\t $loggedin = false;\n\t\t }\n\n\t\t if (!$loggedin && $GLOBALS[JNEWS.'allow_unregistered']) {\n\t\t\t $HTML .= $this->_printscript();\n\t\t }\n\n\t\t if ( !$GLOBALS[JNEWS.'disabletooltip'] ) {\n\t\t\t\tif( version_compare( JVERSION,'3.0.0','<' ) ) {\n\t\t\t\t\tJHTML::_('behavior.tooltip');\n\t\t\t\t} else {\n\t\t\t\t\tJHtml::_('behavior.tooltip');\n\t\t\t\t}\n\t\t }\n\n\t\t $linkForm = 'option='.JNEWS_OPTION;\n\t\t\t$linkForm = jNews_Tools::completeLink( $linkForm, false, false );\n\n\t\t $HTML .= '<form action=\"'.$linkForm.'\" method=\"post\" name=\"modjnewsForm'.$this->num.'\">';\n\n\t\t //pretext\n\t\t if (!empty($this->introtext)) {\n\t\t\t $text = '<span class=\"pretext\">'. $this->introtext .'</span>';\n\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t }\n\n\t\t //subscription list///889\n\t\t $HTML .= $this->_showSubcriptionListOld($subscriber, $loggedin, $item);\n\n\t\t if ( !$loggedin ) {\n\t\t\t if ($GLOBALS[JNEWS.'allow_unregistered']) {\n\t\t\t \t$HTML .= $this->showInputFields();\n\t\t\t } else {\t//required registered\n\t\t\t\t $HTML .= $this->NeedToRegister();\n\t\t\t \t$htmlOK = false;\n\t\t\t }\n\n\t\t\t $HTML .= $this->showReceiveHTML($subscriber);\n\n\t\t\t $HTML .= $this->showTerms($subscriber);\n\n\t\t\t //for captcha\n\t\t\t if($GLOBALS[JNEWS.'level'] > 1){//check the version is plus or pro\n\t\t\t\t if(empty($esc) && $this->enable_captcha){//check if $esc has been initialized\n\t\t\t\t\t $code = jNews_Captcha::generateCode('5');\n\t\t\t\t\t $HTML .= $this->_showCaptcha($code);\n\t\t\t\t\t $hidden .= $this->_showCaptchaHidden($code);\n\t\t\t\t }\n\t\t\t }\n\n\t\t\t $HTML .= $this->_showButton(false);\n\n\t\t } else {\t//login\n\t\t\t\t\t$HTML .= $this->forLoggedIn($Itemid);\n\t\t }\n\n\t\t if (!empty($this->posttext)) {\n\t\t\t $text = '<span class=\"postext\">'. $this->posttext .'</span>';\n\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t }\n\n\t\t\t\tif( version_compare( JVERSION,'3.0.0','<' ) ) {\n\t\t\t\t\t$HTML .= JHTML::_( 'form.token' );\n\t\t\t\t} else {\n\t\t\t\t\t$HTML .= JHtml::_( 'form.token' );\n\t\t\t\t}\n\n\t\t $HTML .= $hidden . '</form>';\n\t } else {\t// no listing\n\t\t $HTML .= '<p class=\"jnews-nolist\">'. _JNEWS_LIST_NOT_AVAIL .'</p>';\n\t }\n\n\t if($this->effect != 'mootools-slide'){\n\t\t \t$HTML .= '<div style=\"display:none; width:50px;\" id=\"message'.$this->num.'\"></div>';\n\t\t \t$HTML .= '<div style=\"display:none; width:50px; padding-top:5px; height:100%\" id=\"ajax_loading'.$this->num.'\"><!--<img alt=\"loader\" src=\"'.JURI::base().'components/'.JNEWS_OPTION.'/images/16/ajax-loader.gif\"/>'._JNEWS_PLEASE_WAIT.'--></div>';\n\t }\n\n\t $HTML .= '';\n\n\t switch ($this->effect) {\n\t\t\t\t\tcase 'mootools-slide':\n\t\t\t\t\t\t$HTML .= '</div></div>';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'mootools-modal':\n\t\t\t\t\t\t$HTML .= '</div></div></div>';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'default':\n\t\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t }\n\n\t\t$HTML .= '</div>';\n\t\t$HTML .= '<div style=\"display:none\" ><a href=\"http://www.joobi.co\">Joomla Extensions</a> powered by Joobi</div>';\n\t return $HTML;\n\n\t}", "function addEmailHandler1() {\n global $inputs;\n\n insert('mail',[\n 'title' => $inputs['title'],\n 'content' => $inputs['content'],\n 'sender_id' => $inputs['sender_id'],\n 'sender' => $inputs['sender_name'],\n 'receiver_id' => $inputs['receiver_id'],\n 'receiver' => $inputs['receiver_name'],\n 'is_read' => 'unread'\n ]);\n\n formatOutput(true, 'add success');\n}", "function sn_load_text_domain() {\n\n\tload_plugin_textdomain( 'dorzki-notifications-to-slack' );\n\n}", "function ajan_core_setup_message() {\n\n\t// Get ActivityNotifications\n\t$ajan = activitynotifications();\n\n\tif ( empty( $ajan->template_message ) && isset( $_COOKIE['ajan-message'] ) ) {\n\t\t$ajan->template_message = stripslashes( $_COOKIE['ajan-message'] );\n\t}\n\n\tif ( empty( $ajan->template_message_type ) && isset( $_COOKIE['ajan-message-type'] ) ) {\n\t\t$ajan->template_message_type = stripslashes( $_COOKIE['ajan-message-type'] );\n\t}\n\n\tadd_action( 'template_notices', 'ajan_core_render_message' );\n\n\tif ( isset( $_COOKIE['ajan-message'] ) ) {\n\t\t@setcookie( 'ajan-message', false, time() - 1000, COOKIEPATH );\n\t}\n\n\tif ( isset( $_COOKIE['ajan-message-type'] ) ) {\n\t\t@setcookie( 'ajan-message-type', false, time() - 1000, COOKIEPATH );\n\t}\n}", "public function addNews(){\n $this->assign('typeList', $this->get_type_list());\n $this->display();\n }", "function addtoTranscript()\r\n {\r\n \r\n }", "function settaNews($cod)\n {\n $this->codice = $cod;\n \n $data=$this->database;\n // chiamata alla funzione di connessione\n $data->connetti();\n // interrogazione della tabella\n $auth = $data->query(\"SELECT * FROM newsletter WHERE codice_news='$this->codice'\");\n\n\n // controllo sul risultato dell'interrogazione\n if(mysql_num_rows($auth)==0)\n {\n //errore newsletter non esiste \n //disconnetto la connessione al database\n $data->disconnetti();\n }\n else\n {\n //recupero i valori del risultato della query\n $iteratore=mysql_fetch_array($auth);\n //imposto i valori delle variabili in base ai valori memorizzati nel database\n $this->codice=$iteratore[0];\n $this->titolo=$iteratore[1];\n $this->cod_utente=$iteratore[2];\n $this->data_news=$iteratore[3];\n $this->testo=$iteratore[4];\n //disconnetto la connessione al database\n $data->disconnetti();\n }\n \n }", "function announces_new ($sess,$chtext,$a_id,$dp,$platn,$chcena,$rub,$pri,$error,$result,$h3) {\r\n\r\n\t$menu= \"ann\";\r\n\t$loc_page = _NEW_ANNOUNCE ;\r\n\tpage_location_announces ($sess,$menu,$rub,$pri,$uoz,$eid,$loc_page);\r\n\r\n\tpage_result_error ($result,$error);\r\n?>\r\n\r\n\t<div class=\"content-border\">\r\n\t <table cellspacing=\"0\" class=\"content-form\">\r\n\t <form name=\"add\" method=\"post\" action=\"index.php?action=form&type=new\">\r\n\t\t<tr>\r\n\t\t\t<td class=\"form-i-name\"><? echo _ANNO_CONTENT ?>:</td>\r\n\t\t\t<td><TEXTAREA NAME=\"text\" COLS=\"30\" ROWS=\"8\"><? echo $chtext; ?></TEXTAREA></td>\r\n\t\t</tr><?\r\n\tif ($dp == \"news\"):?>\r\n\t\t\t<input type=\"hidden\" name=\"a_id\" value=\"<? echo \"$sess[2]\";?>\">\r\n\t\t\t<input type=\"hidden\" name=\"dp\" value=\"news\"><?\r\n\telse:\r\n\t\tif ($sess[5] == \"1\"):?>\r\n\t\t\t<input type=\"hidden\" name=\"a_id\" value=\"<? echo \"$sess[2]\";?>\"><?\r\n\t\telse:?>\r\n\t\t<tr>\r\n\t\t\t<td class=\"form-i-name\"><?\r\n\t\t\t \techo _FROM;?>:\r\n\t\t\t</td>\r\n\t\t\t<td>\r\n\t\t\t\t<select name=\"a_id\">\r\n\t\t\t\t\t\t<OPTION value=\"0\"><? echo _SELECT ?></OPTION><?\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif ($sess[3] == \"lets\" & $a_id == \"\") $a_id = $sess[2];\r\n\t\t\t\t\t$pse = mysql_query(\"SELECT M.*, P.perm_group FROM uniletim_members M\r\n\t\t\t\t\t\t\t\tLEFT JOIN uniletim_perms P ON M.mbr_id = P.perm_member WHERE P.perm_group = '$sess[4]' ORDER BY mbr_login\");\r\n\t\t\t\t\twhile ( $row = mysql_fetch_row($pse)):?>\r\n\t\t\t\t\t\t<OPTION value=\"<? echo \"$row[0]\";?>\"<?if ($row[0] == $a_id) { echo \" selected\";}?>><? echo \"$row[1] - $row[5]\";?></OPTION>\\n\";<?\r\n\t\t\t\t\tendwhile;?>\r\n\t\t\t\t</SELECT>\r\n\t\t\t</td>\r\n\t\t</tr><?\r\n\t\tendif;?>\r\n\t\t<tr>\r\n\t\t\t<td class=\"form-i-name\">\r\n\t\t\t\t<? echo _SUBSECTION ?>:\r\n\t\t\t</td>\r\n\t\t\t<td><?\r\n\t\t$pse = mysql_query(\"SELECT * FROM uniletim_subsections WHERE ul_group = '$sess[4]' ORDER BY sub_section\");\r\n\t\tif (mysql_affected_rows() == 0):\r\n\r\n\t\techo \"<div class=error>\" . _NO_SECTION . \" \" . _NO_SUBSECTION . \" \" . _CREATE_SUB_FIRST . \"</div>\";\r\n\r\n\t\telse:?>\r\n\t\t\t\t<select name=\"pri\">\r\n\t\t\t\t\t\t<OPTION value=\"0\"><? echo _SELECT_SUB ?></OPTION><?\r\n\t\t\t\tif($rubx != \"\"):\r\n\t\t\t\t\t$pse = mysql_query(\"SELECT * FROM uniletim_subsections WHERE sub_section = '$rub' AND ul_group = '$sess[4]' ORDER BY sub_name\");\r\n\t\t\t\t\twhile ( $row = mysql_fetch_row($pse)):?>\r\n\t\t\t\t\t\t<OPTION value=\"<? echo \"$row[0]\";?>\"<?if ($row[0] == $pri) { echo \" selected\";}?>><? echo \"$row[1]\";?></OPTION>\\n\";<?\r\n\t\t\t\t\tendwhile;\r\n\t\t\t\telse:\r\n\t\t\t\t\t$pse = mysql_query(\"SELECT * FROM uniletim_subsections WHERE ul_group = '$sess[4]' ORDER BY sub_section\");\r\n\t\t\t\t\twhile ( $row = mysql_fetch_row($pse)):\r\n\t\t\t\t\t\t$psr = mysql_query(\"SELECT * FROM uniletim_sections WHERE sec_id = '$row[2]' AND ul_group = '$sess[4]'\");\r\n\t\t\t\t\t\t$ror = mysql_fetch_row($psr);?>\r\n\t\t\t\t\t\t<OPTION value=\"<? echo \"$row[0]\";?>\"<?if ($row[0] == $pri) { echo \" selected\";}?>><? echo \"$ror[1] - $row[1]\";?></OPTION>\\n\";<?\r\n\t\t\t\t\tendwhile;\r\n\t\t\t\tendif;\t?>\r\n\t\t\t\t</SELECT><?\r\n\t\tendif;?>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td class=\"form-i-name\">\r\n\t\t\t\t<? echo _VALIDITY ?>:\r\n\t\t\t</td>\r\n\t\t\t<td>\r\n\t\t\t\t<select name=\"platn\">\r\n\t\t\t\t\t<OPTION value=\"2000\"><? echo _TO_CANCEL ?></OPTION>\r\n\t\t\t\t\t<OPTION value=\"7\"<?if ($platn == \"7\") { echo \" selected\";}?>><? echo _WEEK ?></OPTION>\r\n\t\t\t\t\t<OPTION value=\"14\"<?if ($platn == \"14\") { echo \" selected\";}?>><? echo _2WEEKS ?></OPTION>\r\n\t\t\t\t\t<OPTION value=\"31\"<?if ($platn == \"31\") { echo \" selected\";}?>><? echo _MONTH ?></OPTION>\r\n\t\t\t\t\t<OPTION value=\"92\"<?if ($platn == \"92\") { echo \" selected\";}?>><? echo _3MONTHS ?></OPTION>\r\n\t\t\t\t\t<OPTION value=\"183\"<?if ($platn == \"183\") { echo \" selected\";}?>><? echo _6MONTHS ?></OPTION>\r\n\t\t\t\t</SELECT>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td class=\"form-i-name\">&nbsp;</td>\r\n\t\t\t<td>\r\n\t\t\t\t<select name=\"dp\">\r\n\t\t\t\t\t<OPTION value=\"0\"><? echo _SELECT ?></OPTION>\r\n\t\t\t\t\t<OPTION value=\"ponuka\"<?if ($dp == \"ponuka\") echo \" selected\" ?>><? echo _OFFER ?></OPTION>\r\n\t\t\t\t\t<OPTION value=\"dopyt\"<?if ($dp == \"dopyt\") echo \" selected\" ?>><? echo _QUERY ?></OPTION>\r\n\t\t\t\t</SELECT>\r\n\t\t\t</td>\r\n\t\t</tr><?\r\n\t \tif ($sess[3] != \"timebank\"):?>\r\n\t\t<tr>\r\n\t\t\t<td class=\"form-i-name\">\r\n\t\t\t\t<? echo _PRICE ?>:\r\n\t\t\t</td>\r\n\t\t\t<td>\r\n\t\t\t\t<INPUT TYPE=\"text\" NAME=\"cena\" SIZE=\"10\" value=\"<? echo $chcena; ?>\"> <? echo _UNITS ?>\r\n\t\t\t</td>\r\n\t\t</tr><?\r\n \t\tendif;\r\n\tendif;?>\r\n\t\t<tr>\r\n\t\t\t<td class=\"form-i-name\">&nbsp;</td>\r\n\t\t\t<td>\r\n\t\t\t\t<input type=\"hidden\" name=\"ri\" value=\"ri\">\r\n\t\t\t\t<INPUT TYPE=\"submit\" NAME=\"pridaj\" VALUE=\"<? echo _INSERT ?>\">\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</FORM>\r\n\t</TABLE>\r\n\t</div>\r\n\r\n\r\n<?\r\n}", "function translate_bing($data)\n\t {\n\t \t //\n\t \t //print_r($data);\n\t \t $api = 'F0DE0CCB37335B16E7EB0BD3FA2A3C9FD3543DE5';\n\t \t \n\t \t if(empty($data['text']))\n\t\t { \n\t\t return ''; \n\t\t } \n\t\t \n\t\t if($data['orignal_type'] == 'zh')\n\t\t {\n\t\t \t$data['orignal_type'] = 'zh-CHS';\n\t\t }\n\t\t \n\t\t if($data['local_type'] == 'zh')\n\t\t {\n\t\t \t$data['local_type'] = 'zh-CHS';\n\t\t }\n\n\t\t \n\t\t $url = \"http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=\".$api.\"&text=\".urlencode($data['text']) . \"&from=\" . $data['orignal_type'] . \"&to=\" . $data['local_type']; \n\t\t \n\t\t //echo $url;\n\t\t \n\t\t if (function_exists('curl_init')) \n\t\t { \n\t\t $curl = curl_init(); \n\t\t curl_setopt($curl, CURLOPT_URL, $url); \n\t\t curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t\t $res = curl_exec($curl); \n\t\t } \n\t\t else \n\t\t { \n\t\t $res = @file_get_contents($url); \n\t\t }\n\t\t \n\t\t //echo $res;\n\t\t \n\t\t preg_match(\"~<string([^><]*?)>([\\s\\S]*?)<\\/string>~i\", $res, $ostr); \n\t\t //print_r($ostr);\n\t\t if (empty($ostr[2])) \n\t\t { \n\t\t return ''; \n\t\t } \n\t\t else \n\t\t { \n\t\t return htmlspecialchars_decode($ostr[2]); \n\t\t } \n\t }", "private function translate_process($from,$to) {\n $request = $this->baserequest;\n /// ** Define options **//\n $options = $this->options;\n foreach($this->text As $k=>$text) {\n $options = array_merge($options,array('text#'.$k => $text));\n }\n $options = array_merge($options,array('auth_key' => $this->api));\n if ($from != 'auto') {$options = array_merge($options,array('source_lang' => $from));}\n $options = array_merge($options,array('target_lang' => $to));\n /// ** POST / GET -> define parameters **//\n if (strtolower($this->method) == 'post') {\n $optpost = \"\";\n foreach($options As $k => $e) {\n if (count(explode('#',$k)) > 1) {\n $k = explode('#',$k)[0];\n }\n $optpost = $optpost.$k.\"=\".$e.\"&\";\n }\n $optpost = substr($optpost,0,strlen($optpost)-1);\n $res = $this->curlHandler($request,$optpost);\n } else if (strtolower($this->method == 'get')) {\n foreach($options As $k => $e) {\n if (count(explode('#',$k)) > 1) {\n $k = explode('#',$k)[0];\n }\n $request = $request.$k.'='.$e.'&';\n }\n $request = substr($request,0,strlen($request)-1);\n $res = $this->curlHandler($request);\n } else {\n Throw new Exception(\"Method not supported, select POST or GET\");\n }\n $this->addResponse($to,$res);\n }", "function wpsp_send_tour_design() {\n\t\n\tparse_str ($_POST['tours'], $inquiry_info);\n\t\n\twpsp_email_notify( $inquiry_info, true, true );//confirm to operator\n\twpsp_email_notify( $inquiry_info, false, true ); //confirm to traveller\n\t\n\tdie();\n}", "function section_text_nr_comm() {\n\t\t_e('<p>nrelate may need to communicate with you when we release new features or have a problem accessing your website.</br> Check the box, below, to send nrelate the admin email address (under \"General Settings\"). We promise not to overwhelm you with email.<p/>','nrelate');\n}", "function storyEdit($subject, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $aid, $informant, $format_type=0)\n{\n if (empty($format_type)) {\n $format_type = 0;\n }\n\n // Get the format types. 'home' string is bits 0-1, 'body' is bits 2-3.\n $format_type_home = ($format_type%4);\n $format_type_body = (($format_type/4)%4);\n\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n echo '<strong>'._TITLE.'</strong><br />'\n .'<input type=\"text\" name=\"subject\" size=\"50\" value=\"' . pnVarPrepForDisplay($subject) . '\" /><br />';\n buildTopicsMenu($topic);\n SelectCategory($catid);\n echo '<br />';\n puthome($ihome);\n withcomments($comm);\n // new function !\n buildLanguageMenu(true,$alanguage);\n\n $bbcode = array('', '', '');\n if(pnModIsHooked('pn_bbcode', 'Submit_News') && pnModIsHooked('pn_bbcode', 'AddStory') && pnModIsHooked('pn_bbcode', 'News')) {\n $bbcode[0] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'articletext'));\n $bbcode[1] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'extendedtext'));\n $bbcode[2] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'notestext'));\n }\n $bbsmile = array('', '', '');\n if(pnModIsHooked('pn_bbsmile', 'Submit_News') && pnModIsHooked('pn_bbsmile', 'AddStory') && pnModIsHooked('pn_bbsmile', 'News')) {\n pnModAPILoad('pn_bbsmile', 'user');\n $bbsmile[0] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'articletext'));\n $bbsmile[1] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'extendedtext'));\n $bbsmile[2] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'notestext'));\n }\n\n echo '<br /><strong>'._STORYTEXT.'</strong><br />'\n .'<textarea cols=\"80\" rows=\"10\" name=\"hometext\" id=\"articletext\">';\n // Remove br tags only if format of hometext is 'text'.\n if ($format_type_home == 0)\n {\n echo pnVarPrepForDisplay(unnltobr($hometext));\n } else {\n echo pnVarPrepForDisplay($hometext);\n }\n echo '</textarea><br />'\n . $bbcode[0]\n . $bbsmile[0] ;\n\n // Choose format type for hometext.\n buildFormatTypeMenu(\"format_type_home\", $format_type_home);\n\n echo '<br /><strong>'._EXTENDEDTEXT.'</strong><br />'\n .'<textarea cols=\"80\" rows=\"10\" name=\"bodytext\" id=\"extendedtext\">';\n // Remove br tags only if format of bodytext is 'text'\n // The bodytext flag is in bits 2 and 3.\n if ($format_type_body == 0) {\n echo pnVarPrepForDisplay(unnltobr($bodytext));\n } else {\n echo pnVarPrepForDisplay($bodytext);\n }\n echo '</textarea><br />'\n . $bbcode[1]\n . $bbsmile[1]\n . _PAGEBREAK.'<br />';\n // Choose format type for hometext.\n buildFormatTypeMenu(\"format_type_body\", $format_type_body);\n\n echo '<br />'._AREYOUSURE.'<br />';\n if (pnSecAuthAction(0, 'Stories::', \"$subject::\", ACCESS_EDIT)) {\n echo '<strong>'._NOTES.'</strong><br />'\n . '<textarea cols=\"80\" rows=\"5\" name=\"notes\" id=\"notestext\">'\n . pnVarPrepForDisplay(unnltobr($notes)) . '</textarea>'\n . '<br />'\n . $bbcode[2]\n . $bbsmile[2];\n } else {\n echo '<input type=\"hidden\" value=\"' . pnVarPrepForDisplay($notes). '\" />';\n }\n}", "function indexs() {\n\t\n\t/**sendmail(\n\t\tarray (\n\t\t\t'subject' => 'Ma premier newsletter',\n\t\t\t'from' => array (\"[email protected]\" => \"WEBINMOVE\"),\n\t\t\t'to' => array (\"[email protected]\"),\n\t\t\t'layout' => 'news'.DS.'news001'\n\t\t\t\n\t\t)\n\t);\n\t**/\n}", "function addThemengebietes(){\n\t\t$status = $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_topic_detail', array('title'=>htmlentities(t3lib_div::_POST('title'),ENT_QUOTES, 'UTF-8')));\n\t\treturn $status;\n\t}", "function setReply($key,$content,$isNews=false){\n\t$mysql=new MySQL();\n\t$mysql->table(REPLY_TABLE)->where(\"`key`='$key'\")->delete();\n\tif($isNews==false){\t\t//it's a text\n\t\t$mysql->data(array('key'=>$key,'type'=>'text','content'=>$content))->table(REPLY_TABLE)->add();\n\t}else{\n\t\t$mysql->data(array('key'=>$key,'type'=>'news','content'=>$content))->table(REPLY_TABLE)->add();\n\t\t//News message do not content description or now\n\t\t//We can resepon just one NewsMessage now\n\t}\n\t\n\n}", "function autoregister_install()\n {\n // read email template for new autoregister\n $content = file_get_contents( osc_plugins_path() . osc_plugin_folder(__FILE__).'autoregister_new_user_info' );\n $aContent = json_decode($content, true);\n $s_internal_name = 'autoregister_new_user_info';\n $aFields = array('s_internal_name' => $s_internal_name, 'b_indelible' => '1');\n $aFieldsDescription = array();\n\n foreach($aContent as $key => $value) {\n $aFieldsDescription[$key]['s_title'] = $value['title'];\n $aFieldsDescription[$key]['s_text'] = $value['description'];\n }\n // add page as email template\n $page = Page::newInstance()->findByInternalName($s_internal_name);\n if(!isset($page['pk_i_id'])) {\n $result = Page::newInstance()->insert($aFields, $aFieldsDescription) ;\n } else {\n osc_add_flash_error_message(_m(\"Oops! That internal name is already in use. We can't make the changes\", 'autoregister'), 'admin') ;\n }\n }", "function create_newsletter_page() {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-create-newsletter.php\" );\r\n }", "public function welcome_apply_message() {\n global $OUTPUT;\n\n $a = new \\stdClass();\n $a->uploadpage = get_string('tabutemplatepage3', 'mod_surveypro');\n $a->savepage = get_string('tabutemplatepage2', 'mod_surveypro');\n $message = get_string('welcome_utemplateapply', 'mod_surveypro', $a);\n echo $OUTPUT->notification($message, 'notifymessage');\n }", "function meditation() {\n$header = new header();\n$header->music(\"Nhạc thiền\");\n\nif(isset($_REQUEST['id'])){\n\tif($_REQUEST['id']=='nhacphat')\n\t{\n\t\t$url='http://nhacthien.net/nhacphat.htm';\n\t}\n}\n\nelse {\n$path = \"/\";\n$url=\"http://www.nhacthien.net/\";\n}\n$indexpage = \"?nhacthien\"; \n\n$trans= new web_transfer();\n$indexpage='/';\n$base='/';\n$trans->initiate_news ($url,$indexpage); \n$trans->converturl($url,$base);\n$content ='';\n$trans->start_transfer(\"www.nhacthien.net\");\n$trans->getcontent($content);\n\n//start social plugin\n$content=str_replace('<div id=\"controls\">','<div class=\"social\"><a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-lang=\"en\">Tweet</a><div data-size=\"medium\" class=\"g-plusone\"></div><div class=\"fb-like\" data-href=\"http://myweb.pro.vn/music/meditation/\" data-layout=\"button_count\" data-action=\"recommend\" data-show-faces=\"true\" data-share=\"true\"></div></div>',$content);\n//end social plugin\n\n//hide right element\n$content=str_replace('<a href=\"\" class=\"music-button\">','<a href=\"http://myweb.pro.vn/music/meditation/\" class=\"music-button\">',$content);\n$content=str_replace('<a href=\"xem-video.html\" class=\"video-button\">','<a href=\"xem-video.html\" style=\"display:none\" class=\"video-button\">',$content);\n//end\n\n$content=str_replace('<li><a href=\"http://www.cakhucbathu.com\">CA KHÚC BẤT HỦ</a></li>','<li style=\"dislay:none\" id=\"cakhucbathu\"><a href=\"http://www.cakhucbathu.com\">CA KHÚC BẤT HỦ</a></li><script>document.getElementById(\"cakhucbathu\").remove();</script>',$content);\n$content=str_replace('<li><a href=\"http://www.petalia.org\">PETALIA NETWORK</a>','<a style=\"display:none\" id=\"petalia_temp_remove\" href=\"http://www.petalia.org\">PETALIA NETWORK</a></li><script>document.getElementById(\"petalia_temp_remove\").remove();</script>',$content);\n$content=str_replace('<div id=\"social\">','<div id=\"social\" style=\"display:none\">',$content);\n$content=str_replace('style=\"width:100%;display:inline-block;\"','id=\"fb_album_remove\" style=\"display:none\"',$content);\n$content=str_replace('http://www.facebook.com/nhackhongloi','https://www.facebook.com/elearningsocialvn?ref=hl',$content);\n\n//start change the url\n$content=str_replace('<a href=\"http://www.nhacthien.net\">TRỞ LẠI NHẠC THIỀN</a>','<a href=\"http://myweb.pro.vn/music/meditation/\">TRỞ LẠI NHẠC THIỀN</a>',$content);\n$content=str_replace('<a href=\"http://www.mangamnhac.net\">MẠNG ÂM NHẠC</a>','<a href=\"http://myweb.pro.vn/music/general/\">TỔNG HỢP</a>',$content);\n$content=str_replace('Nhạc thiền trên Facebook','Học tập và giải trí',$content);\n$content=str_replace('data-href=\"http://nhacthien.net\"','data-href=\"http://myweb.pro.vn/music/meditation/\"',$content);\n$content=str_replace('www.facebook.com/nhacthien','www.facebook.com/elearningsocialvn?ref=hl',$content);\n$content=str_replace('nhackhongloi.org','myweb.pro.vn/music/nhackhongloi',$content);\n$content=str_replace('www.tinhkhucbathu.com','myweb.pro.vn/music/tinhkhucbathu',$content);\n$content=str_replace('www.nhacphap.com','myweb.pro.vn/music/nhacphap',$content);\n$content=str_replace('http://nhacthien.net/nhacphat.htm','http://myweb.pro.vn/music/meditation?id=nhacphat',$content);\n$content=str_replace('www.nhacdance.net','myweb.pro.vn/music/dance/',$content);\n//end change the url\n\n$content=str_replace('/skins','http://www.nhackhongloi.org/skins/',$content);\n$content=str_replace('</body>','<p class=\"append_footer_iframe\"><p/></body>',$content);\npreg_match_all('/<body>(.*?)<p class=\"append_footer_iframe\">/s',$content,$matches,PREG_SET_ORDER);\nforeach($matches as $key_music);\n$data['content']=$key_music[0];\n//start analytic\n$analytic = new analytic();\n$analytic->myweb('general');\n//end analytic\n$this->load->view('/music/nhacthien',$data);\n}", "function InstallPostMessage() {\n\t\treturn $this->Lang('postinstall');\n\t}", "function _osg_singout_notifier_prep_message($info,$data) {\n global $base_url;\n $message = array();\n $separator = md5(time());\n // carriage return type (we use a PHP end of line constant)\n $eol = PHP_EOL;\n\n //$params['to'] = $record['email'];\n $recipient = $info['first_name'].' '.$info['last_name'].' <[email protected]'.'>';\n $sender = variable_get('site_mail', '[email protected]');\n $message['subject'] = 'These Performances are available for registration.';\n $fudge = count($data) > 2?'s':'';\n $fudge = \"Please visit <a href=\\\"$base_url\\\">\".variable_get('site_name','[Some Cool Site]').\"</a>\"\n .\" and indicate your attendance plan for the following event$fudge:\";\n $data[0] = $fudge;\n $body = implode(\"<br>\",$data);\n\n\n\n $message['body'] = $body;\n\n debug($message,'$message');\n //drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE)\n drupal_mail('osg_singout_notifier'\n , 'registration_needed'\n , $recipient\n , language_default()\n , $message\n , $sender\n );\n\n}", "public function save_newsletter() {\n\t\t$fields = get_option ( 'sarbacane_news_fields' );\n\t\t$users_registred = get_option ( 'sarbacane_newsletter_list', array () );\n\t\t$user_registring = new stdClass ();\n\t\tforeach ( $fields as $field ) {\n\t\t\t$field_label = stripslashes ( $field->label );\n\t\t\t$field_label_html = str_replace ( ' ', '_', $field_label );\n\t\t\t$field_label = strtolower ( $field_label );\n\t\t\tif (isset ( $_POST [$field_label_html] )) {\n\t\t\t\t$fieldValue = sanitize_text_field ( $_POST [$field_label_html] );\n\t\t\t} else {\n\t\t\t\t$fieldValue = \"\";\n\t\t\t}\n\t\t\t$user_registring->$field_label = $fieldValue;\n\t\t}\n\t\t$user_registring->registration_date = gmdate ( 'Y-m-d H:i:s' );\n\t\tarray_push ( $users_registred, $user_registring );\n\t\tupdate_option ( 'sarbacane_newsletter_list', $users_registred );\n\t\t$this->display_registration_message ();\n\t}", "public function Subscribe()\n\t\t{\n\t\t\tif(!isset($_POST['check'])) {\n\t\t\t\t$GLOBALS['SubscriptionHeading'] = GetLang('Oops');\n\t\t\t\t$GLOBALS['Class'] = \"ErrorMessage\";\n\t\t\t\t$GLOBALS['SubscriptionMessage'] = GetLang('NewsletterSpammerVerification');\n\t\t\t}\n\t\t\telse if(isset($_POST['nl_first_name']) && isset($_POST['nl_email'])) {\n\n\t\t\t\t$first_name = $_POST['nl_first_name'];\n\t\t\t\t$email = $_POST['nl_email'];\n\n\t\t\t\t$subscriberFlag = 0; // this variable is used for checking email marketer is checked or not.\n\t\t\t\t// Is Interspire Email Marketer integrated or should we just use the built-in list?\n\t\t\t\tif(GetConfig('MailXMLAPIValid') && GetConfig('UseMailerForNewsletter') && GetConfig('MailNewsletterList') > 0) {\n\t\t\t\t\t// Add them to the Interspire Email Marketer list\n\t\t\t\t\t$GLOBALS['ISC_CLASS_ADMIN_SENDSTUDIO'] = GetClass('ISC_ADMIN_SENDSTUDIO');\n\t\t\t\t\t$result = $GLOBALS['ISC_CLASS_ADMIN_SENDSTUDIO']->AddSubscriberToNewsletter($first_name, $email);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$subscriberFlag = 1;\n\t\t\t\t\t// commented this line as need to insert it into subscriober table everytime.\n\t\t\t\t\t// $result = $this->AddSubscriberToNewsletter($first_name, $email);\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t\tThis below condition is added to check if email marketer is not integrated, then need to pass the values back in \n\t\t\t\t\tvariable $result . Always need to insert it into subscriber table. - starts.\n\t\t\t\t*/\n\t\t\t\tif($subscriberFlag == 1) // if email marketer is not integrated\n\t\t\t\t{\n\t\t\t\t\t$result = $this->AddSubscriberToNewsletter($first_name, $email);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$result_new = $this->AddSubscriberToNewsletter($first_name, $email);\n\t\t\t\t}\n\t\t\t\t/* -- ends -- */\n\n\t\t\t\tif($result['status'] == \"success\") {\n\t\t\t\t\t$GLOBALS['SubscriptionHeading'] = GetLang('NewsletterThanksForSubscribing');\n\t\t\t\t\t$GLOBALS['Class'] = \"\";\n\t\t\t\t\t$GLOBALS['SubscriptionMessage'] = $result['message'] . sprintf(\" <a href='%s'>%s.</a>\", $GLOBALS['ShopPath'], GetLang('Continue'));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['SubscriptionHeading'] = GetLang('Oops');\n\t\t\t\t\t$GLOBALS['Class'] = \"ErrorMessage\";\n\t\t\t\t\t$GLOBALS['SubscriptionMessage'] = $result['message'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(sprintf(\"%s - %s\", GetConfig('StoreName'), GetLang('NewsletterSubscription')));\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"newsletter_subscribe\");\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t\t}", "abstract protected function translator();", "function messager($m){\r\n\t\tif($m['immediacy']){\r\n\t\t\t$this->boinkIt($m['url']);\r\n\t\t}else {\r\n\t\t\tif($m['goon']){\r\n\t\t\t\tif($m['hl'] == '')$m['hl'] = 'hlRed';\r\n\t\t\t\treturn array($m['title'], $m['text'], $m['hl']);\r\n\t\t\t}else {\r\n\t\t\t\t$w = str_replace(\"<%TITLE%>\", $m['title'], $this->skin->wrapMsg);\r\n\t\t\t\t$w = str_replace(\"<%TEXT%>\", $m['text'], $w);\r\n\t\t\t\t$w = str_replace(\"<%URL%>\", $m['url'], $w);\r\n\t\t\t\t$w = str_replace(\"<%SEC%>\", $m['sec'], $w);\r\n\t\t\t\t$this->export($w);\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function newNews ( $mysqli, $newQuery ) {\n \n $title='';\n $intro='';\n $post='';\n \n // Als er NIET ingelogd is, toon onderstaande boodschap.\n if (!isset($_SESSION['email'] )) { \n echo 'U kunt alleen berichten toevoegen als u ingelogd bent.'; \n }\n \n if ( isset( $_SESSION['email'] ) ) {\n \n if ( isset($_POST['title'])) {\n $title = htmlentities ($_POST['title']);\n }\n if ( isset($_POST['intro'])) { \n $intro = htmlentities ($_POST['intro']);\n }\n if ( isset($_POST['post'])) { \n $post = htmlentities ($_POST['post']);\n }\n \n # 1\n \n // Als er WEL ingelogd is, toon formulier.\n echo '<form method=\"post\"><div><label><h3>Titel</h3></label></div>\n <textarea name=\"title\" cols=\"12\" rows=\"2\">' . $title . '</textarea><br>\n <div><label><h3>Inleiding</h3></label></div>\n <textarea name=\"intro\" cols=\"12\" rows=\"4\">' . $intro . '</textarea><br>\n <div><label><h3>Bericht</h3></label></div>\n <textarea name=\"post\" rows=\"15\">' . $post . '</textarea><br>\n <div class=\"btnRow\"><button type=\"submit\" name=\"save\" \n class=\"btn btn-success\">Opslaan</button></div></form>';\n \n # 2\n \n if ( isset($_POST['save'])) {\n \n try {\n if ( empty ( $newQuery ) ) {\n throw new Exception('<div class=\"container\">Helaas bevat het bericht geen inhoud.</div>');\n }\n \n if ( ! $stmt = $mysqli->prepare( $newQuery ) ) {\n throw new Exception('<div class=\"container\">Helaas ging er iets mis...</div>');\n }\n \n if ( $_POST ) {\n sanit_input($title, $intro, $post);\n $stmt->bind_param('sss', $title, $intro, $post);\n }\n\n if(!$stmt->execute()) {\n\t \t \t throw new Exception('<div class=\"container\">Helaas ging er iets mis bij het bewaren van het bericht.</div>');\n }\n \n echo 'Uw bericht is opgeslagen';\n }\n catch (Exception $e) { \n echo $e->getMessage();\n }\n }\n } \n}", "private function yoast_news() {\n\t\t$extra_links = '<li class=\"facebook\"><a href=\"https://www.facebook.com/yoast\">' . __( 'Like Yoast on Facebook', 'helpscout-docs-api' ) . '</a></li>';\n\t\t$extra_links .= '<li class=\"twitter\"><a href=\"https://twitter.com/yoast\">' . __( 'Follow Yoast on Twitter', 'helpscout-docs-api' ) . '</a></li>';\n\t\t$extra_links .= '<li class=\"email\"><a href=\"https://yoast.com/newsletter/\">' . __( 'Subscribe by email', 'helpscout-docs-api' ) . '</a></li>';\n\n\t\t$this->rss_news( 'https://yoast.com/feed/', __( 'Latest news from Yoast', 'helpscout-docs-api' ), $extra_links );\n\t}", "protected function afterInsert() {\r\n // echo 'checking mail todo'.BR;\r\n $lUid = intval($this -> mVal['user_id']);\r\n if (empty($lUid)) {\r\n return;\r\n }\r\n $lSql = 'SELECT val FROM al_usr_pref WHERE uid='.$lUid.' AND code=\"sys.mail.todo\"';\r\n $lVal = CCor_Qry::getStr($lSql);\r\n if (FALSE === $lVal) {\r\n $lSql = 'SELECT val FROM al_sys_pref WHERE code=\"sys.mail.todo\"';\r\n $lVal = CCor_Qry::getStr($lSql);\r\n } \r\n if (smEveryTime == $lVal) {\r\n // mail versenden\r\n $lUsr = CCor_Usr::getInstance();\r\n $lFMail = $lUsr -> getVal('email');\r\n $lFName = $lUsr -> getVal('firstname').' '.$lUsr -> getVal('lastname');\r\n \r\n $lSql = 'SELECT firstname,lastname,email FROM al_usr WHERE id='.intval($lUid);\r\n $lQry = new CCor_Qry($lSql);\r\n if ($lRow = $lQry -> getAssoc()) {\r\n $lToName = $lRow['firstname'].' '.$lRow['lastname'];\r\n $lToMail = $lRow['email'];\r\n $lMsg = 'Dear user,'.LF.LF.'you have a new todo in your todo list:'.LF.LF;\r\n $lMsg.= $this['subject'].LF.LF; \r\n $lCfg = CCor_Cfg::getInstance();\r\n $lUrl = $lCfg -> getVal('base.url').'index.php?act=';\r\n $lMsg.= 'Link: '.$lUrl.$this['ref_link'];\r\n #echo $lMsg;\r\n $lMai = new CApi_Mail_Item($lFMail, $lFName, $lToMail, $lToName, 'Todo: '.$this['subject'], $lMsg);\r\n #$lMai -> send();\r\n $lMai -> insert();\r\n }\r\n } \r\n }", "function bab_pm_initialize_mail()\n{\n // no need to check radio (checked in eop)\n @session_start();\n\n global $listAdminEmail, $headers, $mime_boundary, $bab_pm_PrefsTable, $bab_pm_SubscribersTable, $row, $rs; // $row (list), $rs (article) are global for bab_pm_data\n\n $bab_pm_radio = (!empty($_REQUEST['bab_pm_radio'])) ? gps('bab_pm_radio') : gps('radio');\n\n $sep = IS_WIN ? \"\\r\\n\" : \"\\n\";\n\n include_once txpath.'/publish.php'; // this line is required\n\n // get list data (this is so we only perform the query once)\n $listToEmail = (!empty($_REQUEST['listToEmail'])) ? gps('listToEmail') : gps('list');\n $row = safe_row('*', 'bab_pm_list_prefs', \"listname = '\".doSlash($listToEmail).\"'\");\n\n extract($row); // go ahead and do it because you need several of the variables in initialize\n\n // get article data here, so we only do query one time\n $artID = gps('artID');\n\n if (!empty($artID)) {\n // bypass if this is called from the send screen\n $rs = safe_row(\n \"*, unix_timestamp(Posted) as sPosted,\n unix_timestamp(LastMod) as sLastMod\",\n \"textpattern\",\n \"ID=\".doSlash($artID)\n );\n\n @populateArticleData($rs); // builds $thisarticle (for article context error)\n\n // if no subject line, use article title\n if (empty($listSubjectLine)) {\n $listSubjectLine = $rs['Title'];\n }\n }\n\n $newSubject = gps('subjectLine');\n $subjectLineSource = (!empty($newSubject)) ? 'newSubject' : 'listSubjectLine';\n\n $sendFrom = gps('sendFrom');\n $email_from = empty($sendFrom) ? $listAdminEmail : $sendFrom;\n\n $subject = parse($$subjectLineSource);\n\n // set TOTAL number of subscribers in list (for progress bar calculation)\n if (isset($listID)) {\n $map_table = safe_pfx('bab_pm_subscribers_list');\n $sub_table = safe_pfx('bab_pm_subscribers');\n\n $q = <<<EOSQL\nSELECT COUNT(*)\nFROM `$sub_table` as S inner join `$map_table` as MAP ON S.subscriberID=MAP.subscriber_id\nWHERE MAP.list_id = $listID\nEOSQL;\n $bab_pm_total = getThing($q);\n $bab_pm_total = $bab_pm_total ? $bab_pm_total : 0;\n } else {\n $bab_pm_total = 0;\n }\n\n // set mime boundary, so that only happens once\n $semi_rand = md5(time());\n $mime_boundary = \"Multipart_Boundary_x{$semi_rand}x\";\n\n $headers = array(\n 'From' => $email_from,\n 'Reply-To' => $email_from,\n 'X-Mailer' => 'Textpattern/Postmaster',\n );\n\n // Additional headers required if using regular mail.\n if (!class_exists('PHPMailer\\PHPMailer\\PHPMailer')) {\n $headers['MIME-Version'] = '1.0';\n $headers['Content-Transfer-Encoding'] = '8bit';\n $headers['Content-Type'] = 'text/plain';\n }\n\n // if use override is selected, then overwrite the listEmailForm variable\n if (gps('use_override')) {\n $listEmailForm = gps('override_form');\n }\n\n // set email template(s), so that only happens once\n $listEmailForm = trim($listEmailForm);\n\n if (!empty($listEmailForm)) {\n $theForm = fetch('Form','txp_form','name',\"$listEmailForm\");\n\n if ($theForm) {\n $template = bab_pm_extract($theForm);\n }\n }\n\n // test to confirm that we actually have a form, otherwise use default\n if (empty($template) || !$template) {\n$template['html'] = $template['text'] = $template['combined'] = <<<eop_form\n<txp:author /> has posted a new article at <txp:site_url />.\nRead article at: <txp:bab_pm_data display=\"link\" />\nUnsubscribe: <txp:bab_pm_unsubscribeLink />\neop_form;\n }\n\n //echo $template;\n\n // send all our initialized to bab_pm_bulk_mail\n bab_pm_bulk_mail($bab_pm_total, $bab_pm_radio, $subject, @$thisarticle, $template); // send all info to mail through function\n}", "function newsletters_page() {\r\n //including file for send newsletter\r\n if ( \"send_newsletter\" == $_REQUEST['newsletter_action'] && ( $_REQUEST['newsletter_id'] || $_REQUEST['send_id'] ) ) {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-send-newsletter.php\" );\r\n return;\r\n }\r\n\r\n require_once( $plugin_dir . \"email-newsletter-files/page-newsletters.php\" );\r\n }", "private function notification_make_mail_text($userto, $courses, $publicids){\r\n global $CFG;\r\n\r\n $courses_list = '';\r\n foreach($courses as $course){\r\n if($this->tab == \"course\"){\r\n if($course->course_demourl){\r\n $courses_list .= '- '.$course->fullname.' ('.$course->course_demourl.') (Parcours en démonstration) '.\"\\n\".'';\r\n } else {\r\n $courses_list .= '- '.$course->fullname.' ('.$course->course_url.') '.\"\\n\".'';\r\n }\r\n } else {\r\n if($course->source == 'local'){\r\n $courses_list .= '- '.$course->fullname.' ('.$course->course_url.'?id='.$course->courseid.') '.\"\\n\".'';\r\n } else {\r\n $courses_list .= '- '.$course->fullname.' ('.$course->course_url.') '.\"\\n\".'';\r\n }\r\n }\r\n }\r\n $courses_list .= \"\\n\";\r\n\r\n $data = new stdClass();\r\n $data->username = $userto->firstname .\" \". $userto->lastname;\r\n $data->courses_list = $courses_list;\r\n\r\n $message_intro = get_string('email_message_intro_parcours','local_magistere_offers', $data);\r\n if($this->tab == 'formation'){\r\n $message_intro = get_string('email_message_intro_formation','local_magistere_offers', $data);\r\n }\r\n $message_intro .= \"\\n\";\r\n\r\n $publics_list = '';\r\n foreach($this->get_publics_by_stringids($publicids) as $public){\r\n $publics_list .= '- '.$public->name.''.\"\\n\".'';\r\n }\r\n $publics_list .= \"\\n\";\r\n $publics_message = get_string('email_message_publics','local_magistere_offers', $publics_list).\"\\n\";\r\n\r\n $link_preference = get_string('email_message_preference_link', 'local_magistere_offers').'('.$CFG->wwwroot.'/local/magistere_offers/index.php?v=parcours&action=changepref)'.\"\\n\";\r\n if($this->tab == 'formation'){\r\n $link_preference = get_string('email_message_preference_link', 'local_magistere_offers').'('.$CFG->wwwroot.'/local/magistere_offers/index.php?v=formation&action=changepref)'.\"\\n\";\r\n }\r\n\r\n $message_outro = get_string('email_message_outro', 'local_magistere_offers');\r\n\r\n $posttext = \"\\n---------------------------------------------------------------------\\n\";\r\n $posttext .= $message_intro;\r\n $posttext .= \"---------------------------------------------------------------------\\n\";\r\n $posttext .= $publics_message;\r\n $posttext .= \"---------------------------------------------------------------------\\n\";\r\n $posttext .= $link_preference;\r\n $posttext .= \"---------------------------------------------------------------------\\n\";\r\n $posttext .= $message_outro;\r\n $posttext .= \"\\n\\n\";\r\n\r\n return $posttext;\r\n }", "private function dummyMethodToIncludeTranslatableString(){\n return;\n /** @var TranslatorInterface $translator */\n $translator = $this->container->get('translator');\n if ($translator !== null) {\n $translator->trans('hasFacebook', array(), 'advertise');\n $translator->trans('hasTwitter', array(), 'advertise');\n $translator->trans('hasInstagram', array(), 'advertise');\n }\n unset($translator);\n }", "function wp_get_translation_updates()\n {\n }", "public function addMetaFields()\n {\n // Get some help :-)\n $helper = Metabox::get('lbwp-nl');\n\n // Metabox for settings\n $boxId = 'newsletter-settings';\n $helper->addMetabox($boxId, 'Einstellungen');\n $helper->addInputText('mailSubject', $boxId, 'Betreff', array('required' => true));\n $helper->addInputText('mailSender', $boxId, 'E-Mail Absender', array('required' => true));\n $helper->addInputText('mailSenderName', $boxId, 'Absender-Name', array('required' => true));\n\n // Template selection\n $boxId = 'newsletter-template';\n $helper->addMetabox($boxId, 'Newsletter Design');\n $helper->addField(\n 'templateId',\n $boxId,\n array(),\n array($this, 'displayNewsletterTemplates'),\n array($this, 'saveNewsletterTemplate')\n );\n\n // Metabox for post assignation\n $boxId = 'newsletter-items';\n $helper->addMetabox($boxId, 'Beiträge auswählen');\n $helper->addAssignPostsField('newsletterItems', $boxId, $this->sourceTypes);\n\n // Info box because we schedule sendings at xx:31 with cron\n $boxId = 'newsletter-sendinfo';\n $helper->addMetabox($boxId, 'Versand Information', 'side');\n\n $helper->addField(\n 'sendInfo',\n $boxId,\n array(),\n array($this, 'displaySendInfo'),\n '__return_false'\n );\n\n $boxId = 'newsletter-sendtest';\n $helper->addMetabox($boxId, 'Test-Versand', 'side');\n // Box to mail the current newsletter as a test to an email\n $helper->addField(\n 'sendTest',\n $boxId,\n array(),\n array($this, 'displayTestForm'),\n '__return_false'\n );\n }", "public function localization() {\n\t\t\tload_plugin_textdomain( 'bitlive-custom-codes', false, __DIR__ . '/languages/' );\n\t\t}", "function is_translatable()\n {\n }", "public function translate();", "function notifications_instituerarticle($quoi, $id_article, $options) {\n\t$type = 'article';\n\t// ne devrait jamais se produire\n\tif ($options['statut'] == $options['statut_ancien']) {\n\t\tspip_log(\"statut inchange\",'notifications');\n\t\treturn;\n\t}\n\n\tinclude_spip('inc/texte');\n\n\t$modele = \"\";\n\t$id_secteur = sql_getfetsel('id_secteur','spip_articles','id_article='.intval($id_article));\n\t$diogene = sql_fetsel('*','spip_diogenes','id_secteur='.intval($id_secteur).' AND objet IN (\"article\",\"emballe_media\")');\n\t\n\tif(isset($diogene['id_diogene']) && $diogene['objet'] == 'emballe_media'){\n\t\t$type = 'media';\n\t}\n\tspip_log($type,'test');\n\tif ($options['statut'] == 'publie') {\n\t\tif ($GLOBALS['meta'][\"post_dates\"]=='non'\n\t\t\tAND strtotime($options['date'])>time())\n\t\t\t$modele = \"notifications/\".$type.\"_valide\";\n\t\telse\n\t\t\t$modele = \"notifications/\".$type.\"_publie\";\n\t}\n\tif ($options['statut'] == 'prop' AND $options['statut_ancien'] != 'publie')\n\t\t$modele = \"notifications/\".$type.\"_propose\";\n\tspip_log(test_espace_prive());\n\tspip_log($modele,'test');\n\tif ($modele){\n\t\t$destinataires = array();\n\t\tif ($GLOBALS['meta'][\"suivi_edito\"] == \"oui\")\n\t\t\t$destinataires = explode(',',$GLOBALS['meta'][\"adresse_suivi\"]);\n\n\n\t\t$destinataires = pipeline('notifications_destinataires',\n\t\t\tarray(\n\t\t\t\t'args'=>array('quoi'=>$quoi,'id'=>$id_article,'options'=>$options)\n\t\t\t,\n\t\t\t\t'data'=>$destinataires)\n\t\t);\n\n\t\t$texte = email_notification_objet($id_article, \"article\", $modele);\n\t\tspip_log($texte,'test');\n\t\tnotifications_envoyer_mails($destinataires, $texte);\n\t}\n}", "public function contact()\n {\n\n $lang = $this->data['lang'];\n $user_id = $this->user_id;\n\n $this->data['page'] = 'contact_us' ;\n\n $body = 'contact' ;\n\n $this->load_pages($body,$this->data); \n\n }", "function page_news() {\r\n\t\tglobal $_GET, $_POST, $actual_user_showname, $actual_user_id;\r\n\t\t\r\n\t\t$out = \"\";\r\n\t\t$action = \"\";\r\n\t\t$id = 0;\r\n\t\t$text = \"\";\r\n\t\t$title = \"\";\r\n\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\r\n\t\r\n\t\t\tif(isset($_GET['text']) || isset($_POST['text'])) {\r\n\t\t\t\tif(isset($_GET['text']))\r\n\t\t\t\t\t$text = $_GET['text'];\r\n\t\t\t\telse\r\n\t\t\t\t\t$text = $_POST['text'];\r\n\t\t\t}\r\n\r\n\t\t\tif(isset($_GET['title']) || isset($_POST['title'])) {\r\n\t\t\t\tif(isset($_GET['title']))\r\n\t\t\t\t\t$title = $_GET['title'];\r\n\t\t\t\t\telse\r\n\t\t\t\t\t$title = $_POST['title'];\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\t// delete the selected entrie\r\n\t\t\t//\r\n\t\t\tif($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\r\n\t\t\t\t\tif($sure == 1)\r\n\t\t\t\t\t\tdb_result(\"DELETE FROM \" . DB_PREFIX . \"news 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 . \"news WHERE id=\" . $id);\r\n\t\t\t\t\t$row = mysql_fetch_object($result);\r\n\t\t\t\t\t$out .= \"Den News Eintrag &quot;\" . $row->title . \"&quot; wirklich löschen?<br />\r\n\t\t\t\t<a href=\\\"admin.php?page=news&amp;action=delete&amp;id=\" . $id . \"&amp;sure=1\\\" title=\\\"Wirklich Löschen\\\">ja</a> &nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t\t\t<a href=\\\"admin.php?page=news\\\" title=\\\"Nicht Löschen\\\">nein</a>\";\r\n\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 entrie\r\n\t\t\t//\r\n\t\t\telseif($action == \"new\") {\r\n\t\t\t\tif($text != \"\" && $title != \"\")\r\n\t\t\t\t\tdb_result(\"INSERT INTO \".DB_PREFIX.\"news (title, text, date, userid) VALUES ('\".$title.\"', '\".$text.\"', '\".mktime().\"', '$actual_user_id')\");\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\t// update the selected entrie\r\n\t\t\t//\r\n\t\t\telseif($action == \"update\") { \r\n\t\t\t\tif($text != \"\" && $title != \"\" && $id != 0)\r\n\t\t\t\t\tdb_result(\"UPDATE \".DB_PREFIX.\"news SET title= '\".$title.\"', text= '\".$text.\"' WHERE id=\".$id);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//\r\n\t\t// don't show the add new form if it is sure that the user wants to edit a news entrie\r\n\t\t//\r\n\t\tif($action != \"edit\") {\r\n\t\t\t$out .= \"\\t\\t<form method=\\\"post\\\" action=\\\"admin.php\\\">\r\n\t\t\t<input type=\\\"hidden\\\" name=\\\"page\\\" value=\\\"news\\\" />\r\n\t\t\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"new\\\" />\r\n\t\t\tTitel: <input type=\\\"text\\\" name=\\\"title\\\" maxlength=\\\"60\\\" value=\\\"\\\" /><br />\r\n\t\t\t<textarea cols=\\\"60\\\" rows=\\\"6\\\" name=\\\"text\\\"></textarea><br />\r\n\t\t\tEingelogt als \" . $actual_user_showname . \" &nbsp;<input type=\\\"submit\\\" value=\\\"Senden\\\" /><br />\r\n\t\t</form>\";\r\n\t\t}\r\n\t\t\t$out .= \"\\t\\t<form method=\\\"post\\\" action=\\\"admin.php\\\">\r\n\t\t\t<input type=\\\"hidden\\\" name=\\\"page\\\" value=\\\"news\\\" />\r\n\t\t\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"update\\\" />\r\n\t\t\t<table>\\r\\n\";\r\n\t\t//\r\n\t\t// write all news entries\r\n\t\t//\r\n\t\t$result = db_result(\"SELECT * FROM \".DB_PREFIX.\"news ORDER BY date DESC\");\r\n\t\twhile($row = mysql_fetch_object($result)) {\r\n\t\t\t//\r\n\t\t\t// show an editform for the selected entrie\r\n\t\t\t//\r\n\t\t\tif($id == $row->id && $action == \"edit\") {\r\n\t\t\t\t$out .= \"\\t\\t\\t\\t<tr>\r\n\t\t\t\t\t<td colspan=\\\"2\\\" id=\\\"newsid\" . $row->id . \"\\\">\r\n\t\t\t\t\t\t<input type=\\\"hidden\\\" name=\\\"id\\\" value=\\\"\".$row->id.\"\\\" />\r\n\t\t\t\t\t\t<input type=\\\"submit\\\" value=\\\"Speichern\\\" />\r\n\t\t\t\t\t\t&nbsp;<a href=\\\"admin.php?page=news&amp;action=delete&amp;id=\".$row->id.\"\\\" title=\\\"Löschen\\\">Löschen</a>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<input type=\\\"text\\\" name=\\\"title\\\" value=\\\"\".$row->title.\"\\\" />\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\".date(\"d.m.Y H:i:s\", $row->date).\"\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td colspan=\\\"2\\\">\r\n\t\t\t\t\t\t<textarea name=\\\"text\\\" cols=\\\"60\\\" rows=\\\"6\\\">\".$row->text.\"</textarea>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td colspan=\\\"2\\\">\r\n\t\t\t\t\t\t\" . getUserByID($row->userid) . \"\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\";\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\t// show only the entrie\r\n\t\t\t//\r\n\t\t\telse {\r\n\t\t\t\t$out .= \"\\t\\t\\t\\t<tr>\r\n\t\t\t\t\t<td colspan=\\\"2\\\">\r\n\t\t\t\t\t\t<a id=\\\"newsid\".$row->id.\"\\\" ></a>\r\n\t\t\t\t\t\t<a href=\\\"admin.php?page=news&amp;action=edit&amp;id=\".$row->id.\"#newsid\".$row->id.\"\\\" title=\\\"Bearbeiten\\\">Bearbeiten</a>\r\n\t\t\t\t\t\t&nbsp;<a href=\\\"admin.php?page=news&amp;action=delete&amp;id=\".$row->id.\"\\\" title=\\\"Löschen\\\">Löschen</a>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<b>\".$row->title.\"</b>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\".date(\"d.m.Y H:i:s\", $row->date).\"\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td colspan=\\\"2\\\">\r\n\t\t\t\t\t\t\".nl2br($row->text).\"\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td colspan=\\\"2\\\">\r\n\t\t\t\t\t\t\".getUserByID($row->userid).\"\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out .= \"\\t\\t\\t</table>\r\n\t\t</form>\\r\\n\";\r\n\t\r\n\t\treturn $out;\r\n\t}", "public function responseMsg()\r\n\t{\r\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\r\n\r\n\t\t//extract post data\r\n\t\tif (!empty($postStr)){\r\n\t\t\t\t\r\n\t\t\t\t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\r\n\t\t\t\t$fromUsername = $postObj->FromUserName;\r\n\t\t\t\t$toUsername = $postObj->ToUserName;\r\n\t\t\t\t$keyword = trim($postObj->Content);\r\n\t\t\t\t$time = time();\r\n\r\n\t\t\t\t/*文字回复*/\r\n\t\t\t\t$textTpl = \"<xml>\r\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\r\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\r\n\t\t\t\t\t\t\t</xml>\"; \r\n\r\n\t\t\t\t/*图文回复*/\r\n\t\t\t\t$itemTpl = \"<xml>\r\n\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t<ArticleCount>1</ArticleCount>\r\n\t\t\t\t\t\t<Articles>\r\n\t\t\t\t\t\t<item>\r\n\t\t\t\t\t\t<Title><![CDATA[%s]]></Title> \r\n\t\t\t\t\t\t<Description><![CDATA[%s]]></Description>\r\n\t\t\t\t\t\t<PicUrl><![CDATA[%s]]></PicUrl>\r\n\t\t\t\t\t\t<Url><![CDATA[%s]]></Url>\r\n\t\t\t\t\t\t</item>\r\n\t\t\t\t\t\t</Articles>\r\n\t\t\t\t\t\t</xml>\";\r\n\r\n\r\n\r\n\t\t\t\tif(!empty( $keyword )){\r\n\t\t\t\t\t$keyworde = $this -> FindKeyword($keyword,$fromUsername);\r\n\t\t\t\t\tswitch ($keyworde) {\r\n\t\t\t\t\t\tcase '红包':\r\n\t\t\t\t\t\t\t// $msgType = \"news\";\r\n\t\t\t\t\t\t\t// $contentStr = \"恭喜你获得一个红包!\";\r\n\t\t\t\t\t\t\t// $contentStr2 = \"点击图片领取你的红包!\";\r\n\t\t\t\t\t\t\t// // $PicUrl = \"http://imgsrc.baidu.com/forum/w%3D580/sign=6926f2cad488d43ff0a991fa4d1fd2aa/3e8ad5dcd100baa1583412044510b912c9fc2ea8.jpg\";\r\n\t\t\t\t\t\t\t// $url = \"http://i.shuilaile.com/index.php?s=/Home/Get/pay/openid/\".$fromUsername.\"/code/\".$keyword.\".html\";\r\n\t\t\t\t\t\t\t// $resultStr = sprintf($itemTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr, $contentStr2, $PicUrl, $url);\r\n\t\t\t\t\t\t\t// echo $resultStr;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//执行发红包\r\n\t\t\t\t\t\t\t$this -> pay($fromUsername,$keyword);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t$msgType = \"text\";\r\n\t\t\t\t\t\t\t$contentStr = $keyworde;\r\n\t\t\t\t\t\t\t// $contentStr = \"Welcome to wechat world!\";\r\n\t\t\t\t\t\t\t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\r\n\t\t\t\t\t\t\techo $resultStr;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo \"Input something...\";\r\n\t\t\t\t}\r\n\r\n\t\t}else {\r\n\t\t\techo \"\";\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "function InstallPostMessage()\n {\n return $this->Lang('postinstall');\n }", "function list_translation_updates()\n {\n }", "function addMessage($txt = \"\"){\t$this->mMessages\t.= $txt;\t}", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\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 $msgType = $postObj->MsgType;//消息类型\n $event = $postObj->Event;//时间类型,subscribe(订阅)、unsubscribe(取消订阅)\n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\"; \n \n switch($msgType){\n case \"event\":\n if($event==\"subscribe\"){\n $contentStr = \"最新更新说明:\".\"\\n\".\"A:优化二维码搜索功能,搜索更精准\".\"\\n\".\"B:微信群二维码采集源更新:\".\"\\n\".\"1、百度贴吧\".\"\\n\".\"2、新浪微博\".\"\\n\".\"3、兴趣部落\".\"\\n\".\"4、700+陌陌群\".\"\\n\".\"5、3500+个微信群\".\"\\n\".\"6、1300+个QQ群\".\"\\n\".\"C:支持支付方式:\".\"\\n\".\"1、微信支付\".\"\\n\".\"2、支付宝(敬请期待)\";\n } \n break;\n case \"text\":\n /*switch($keyword){\n case \"1\":\n $contentStr = \"店铺地址:\".\"\\n\".\"杭州市江干艮山西路233号新东升市场地下室第一排.\"; \n break;\n case \"2\":\n $contentStr = \"商品种类:\".\"\\n\".\"杯子、碗、棉签、水桶、垃圾桶、洗碗巾(刷)、拖把、扫把、\"\n .\"衣架、粘钩、牙签、垃圾袋、保鲜袋(膜)、剪刀、水果刀、饭盒等.\";\n break;\n default:\n $contentStr = \"对不起,你的内容我会稍后回复\";\n }*/\n $contentStr = \"对不起,你的内容我会稍后回复\";\n break;\n }\n $msgType = \"text\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else {\n echo \"post str is null\";\n exit;\n }\n }", "function News()\n{\n\t$this->type_moi = \"news\";\n}", "public function textdomain() {\n\t\t\n\t\tload_plugin_textdomain( 'hotlink-no-more', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );\n\t}", "function fantacalcio_send_newsletter($vote_round) {\n drupal_set_title(filter_xss('Risultati ' . $vote_round . '&ordf; giornata'));\n \n global $user;\n \n $sql = \"SELECT * FROM {fanta_rounds_competitions} WHERE round = '%d' AND c_id IN (SELECT c_id FROM {fanta_competitions} WHERE newsletter = 1)\";\n $result = db_query($sql, $vote_round);\n while ($row = db_fetch_object($result)) {\n $rounds[$row->c_id] = $row;\n }\n \n //newsletters\n //TODO //Administation\n $tids = array(1 => 13, 2 => 16);\n \n foreach ($rounds as $c_id => $round) {\n\n $tid = $tids[$c_id];\n\n $body = newsletter_create_body($c_id, $round->competition_round);\n $title = \"Riepilogo \" . (!empty($round->round_label) ? $round->round_label : $round->competition_round . \"a Giornata\");\n\n //create node\n $newsletter = array();\n $newsletter = (object) array('title'=> $title, 'body'=> $body, 'type' => 'simplenews', 'uid' => $user->uid, 'language' => 'it');\n\n //taxonomy\n $newsletter->taxonomy[$tid] = taxonomy_get_term($tid);\n $newsletter->simplenews = array('tid' => $tid, 's_format' => 'html', 'send' => SIMPLENEWS_COMMAND_SEND_NOW);\n\n node_save($newsletter);\n\n module_invoke('simplenews', 'simplenews_nodeapi', $newsletter, 'insert');\n\n }\n \n return \"Newsletter inviate\"; \n}", "function ab_subscribe(){\r\n //debugbreak();\r\n $email = strip_tags($_POST['email']);\r\n if(!is_email($email)){\r\n _e('Email address is not valid',$this->plugin_domain);\r\n exit;\r\n }\r\n $list = $this->aweber_list_name;\r\n $to = $list.'@aweber.com';\r\n $subject = 'subscribe'; \r\n $name = strip_tags(get_bloginfo('name'));\r\n remove_all_filters('wp_mail_from');\r\n $success = wp_mail($to,$subject,'subscribe','From: '.$name.'<'.$email.'>'.\"\\r\\n\"); \r\n if($success){\r\n printf(__('Email %s added to list. please check your inbox for the confirmation link',$this->plugin_domain),$email);\r\n } else {\r\n _e('oh dear! some error happened with sending the subscribe email, you may have to subscribe manually at ComLuv.com',$this->plugin_domain);\r\n } \r\n exit;\r\n }", "function addUser()\n{\n\tglobal $xoopsDB, $myts, $xoopsConfig, $xoopsModule, $dirname, $men_erro,$usa_perf;\n\n\t$user_name = $myts->makeTboxData4Save($_POST['user_name']);\n\t$user_nick = $myts->makeTboxData4Save($_POST['user_nick']);\n\t$user_mail = $myts->makeTboxData4Save($_POST['user_mail']);\n//\t$user_host = $myts->makeTboxData4Save($_SERVER['REMOTE_HOST']);\n\t$user_host = $myts->makeTboxData4Save(gethostbyaddr($_SERVER['REMOTE_ADDR']));\n\n\t$query = \"SELECT * FROM \". $xoopsDB->prefix('xmail_newsletter').\" WHERE user_email='$user_mail' \";\n\t$myarray = $xoopsDB->fetchArray($xoopsDB->query($query));\n\n\t$xoopsMailer =& getMailer();\n\t$xoopsMailer->useMail();\n\t// Herv�\n\t$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/'.$dirname.'/language/'.$xoopsConfig['language'].'/mail_template');\n if($usa_perf) {\n \t$xoopsMailer->setTemplate(\"confirm_email_perf.tpl\");\n }else {\n \t$xoopsMailer->setTemplate(\"confirm_email.tpl\");\n }\n \n \n \n\tif (!$myarray) {\t// New User\n\t\t$better_token = md5(uniqid(rand(), 1));\n\t\t$query = \"INSERT INTO \" . $xoopsDB->prefix('xmail_newsletter') . \" (user_id, user_name, user_nick, user_email, user_host, user_conf, user_time) \";\n\t\t$query .= \"VALUES (0, '$user_name', '$user_nick', '$user_mail', '$user_host', '$better_token', NOW())\";\n\t\t$result = $xoopsDB->queryF($query);\n if(!$result) {\n echo \"erro na inclus�o $query \";\n return ;\n }\n // incluir em xmail_perfil_news $_POST['id_perf']\n // pegar user_id incluso\n $user_id=$xoopsDB->getInsertId();\n\t\t\n // incluir perfil\n\t\tinclude XOOPS_ROOT_PATH.'/modules/xmail/xnews_incperfil.php'; \n \n \n\t\t$confirm_url = XOOPS_URL .'/modules/xmail/include/xmail_ativa.php?id='.$better_token;\n\t\t$xoopsMailer->setToEmails($_POST['user_mail']);\n\t\t$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);\n\t\t$xoopsMailer->setFromName($xoopsConfig['sitename']);\n\t\t$xoopsMailer->setSubject(_MD_XMAIL_CONFIRM_SUBJECT);\n\t\t$xoopsMailer->assign('X_UNAME',$user_name);\n\t\t$xoopsMailer->assign('X_CONTACT_NAME',$xoopsConfig['adminmail']);\n\t\t$xoopsMailer->assign('VALIDATION_URL',$confirm_url);\n\t\t$xoopsMailer->assign('PERFIL_DEF',$perfil_definido);\n\t\t\n\t\tif ($xoopsMailer->send()) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn -2;\n\t\t}\n\n\t} elseif ($myarray['confirmed'] == '0') {\t//Still Needs Confirmation\n\t\t$user_id=$myarray['user_id'];\n\t\t// incluir perfil\n\t\tinclude XOOPS_ROOT_PATH.'/modules/xmail/xnews_incperfil.php'; \n\t\n\t\t$confirm_url = XOOPS_URL .'/modules/xmail/include/xmail_ativa.php?id='.$myarray['user_conf'];\n\t\t$xoopsMailer->setToEmails($myarray['user_email']);\n\t\t$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);\n\t\t$xoopsMailer->setFromName($xoopsConfig['sitename']);\n\t\t$xoopsMailer->setSubject(_MD_XMAIL_CONFIRM_SUBJECT);\n\t\t$xoopsMailer->assign('X_UNAME',$user_name);\n\t\t$xoopsMailer->assign('X_CONTACT_NAME',$xoopsConfig['adminmail']);\n\t\t$xoopsMailer->assign('VALIDATION_URL',$confirm_url);\n\t\t$xoopsMailer->assign('PERFIL_DEF',$perfil_definido);\n\t\tif ($xoopsMailer->send()) {\n\t\t\treturn 2;\n\t\t} else {\n\t\t\treturn -2;\n\t\t}\n\t\n\t} else { // Duplicate Email in db\n\t\treturn -1;\n\t}\n}", "function saveReceptionistNotices($connection,$noticeFor,$noticeDate,$noticeSubject,$noticeText,$receptionistId,$userRole,$userEmailss,$noticeAction,$hiddenNoticeEditId){\n $noticeDate = date('Y-m-d',strtotime($noticeDate));\n if ($noticeAction == \"add\") {\n\n /*\n * Send emails also\n */\n $to = \"[email protected],\" . $userEmailss;\n $subject = \"Notice Board\";\n // Set content-type header for sending HTML email\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\n // Additional headers\n $headers .= 'From: Allen Forum<[email protected]>' . \"\\r\\n\";\n $headers .= 'Cc: [email protected]' . \"\\r\\n\";\n $headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n $message = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <title>Receptionist | Allenhouse</title>\n </head>\n <body style=\"-webkit-text-size-adjust: none; box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; height: 100%; line-height: 1.4; margin: 0; width: 100% !important;\" bgcolor=\"#F2F4F6\"><style type=\"text/css\">\nbody {\nwidth: 100% !important; height: 100%; margin: 0; line-height: 1.4; background-color: #F2F4F6; color: #74787E; -webkit-text-size-adjust: none;\n}\n@media only screen and (max-width: 600px) {\n .email-body_inner {\n width: 100% !important;\n }\n .email-footer {\n width: 100% !important;\n }\n}\n@media only screen and (max-width: 500px) {\n .button {\n width: 100% !important;\n }\n}\n</style>\n <span class=\"preheader\" style=\"box-sizing: border-box; display: none !important; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 1px; line-height: 1px; max-height: 0; max-width: 0; mso-hide: all; opacity: 0; overflow: hidden; visibility: hidden;\">Reception,Allenhouse Institute of Technology informs you that a new Notice shared with you.</span>\n <table class=\"email-wrapper\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0; padding: 0; width: 100%;\" bgcolor=\"#F2F4F6\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table class=\"email-content\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0; padding: 0; width: 100%;\">\n <tr>\n <td class=\"email-masthead\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; padding: 25px 0; word-break: break-word;\" align=\"center\">\n <a href=\"http://allenforum.cubersindia.com\" class=\"email-masthead_name\" style=\"box-sizing: border-box; color: #bbbfc3; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 16px; font-weight: bold; text-decoration: none; text-shadow: 0 1px 0 white;\">\n Notice Board </a>\n </td>\n </tr>\n <tr>\n <td class=\"email-body\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"-premailer-cellpadding: 0; -premailer-cellspacing: 0; border-bottom-color: #EDEFF2; border-bottom-style: solid; border-bottom-width: 1px; border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0; padding: 0; width: 100%; word-break: break-word;\" bgcolor=\"#FFFFFF\">\n <table class=\"email-body_inner\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0 auto; padding: 0; width: 570px;\" bgcolor=\"#FFFFFF\">\n <tr>\n <td class=\"content-cell\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; padding: 35px; word-break: break-word;\">\n <h1 style=\"box-sizing: border-box; color: #2F3133; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 19px; font-weight: bold; margin-top: 0;\" align=\"left\">Hi, Allenits!</h1>\n <p style=\"box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;\" align=\"left\">Greetings of the Day,<br/>\n We hope you actively participating in Allenforum discussion,to resolve doubts of each other. Its a duty to inform you that an important ntoice has been shared with you\n </p> <p>for checking about it login to your <b>Allenforum accunt</b></p>\n <table class=\"body-action\" align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 30px auto; padding: 0; text-align: center; width: 100%;\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif;\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif;\">\n <tr>\n <td style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <a href=\"http://allenforum.cubersindia.com\" class=\"button button--\" target=\"_blank\" style=\"-webkit-text-size-adjust: none; background: #ee5d42; border-color: #ee5d42; border-radius: 3px; border-style: solid; border-width: 10px 18px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16); box-sizing: border-box; color: #FFF; display: inline-block; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; text-decoration: none;\">Check</a>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n <p style=\"box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;\" align=\"left\">Regards\n <br />Allenforum Team</p>\n <img src=\"http://allenforum.cubersindia.com/home/ownImages/other/allenoverflow.png\" alt=\"allenforum\" width=\"200\" height=\"40\"/>\n <table class=\"body-sub\" style=\"border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin-top: 25px; padding-top: 25px;\">\n <tr>\n <td style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <p class=\"sub\" style=\"box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;\" align=\"left\">Please do not reply to this email</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n <tr>\n <td style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table class=\"email-footer\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0 auto; padding: 0; text-align: center; width: 570px;\">\n <tr>\n <td class=\"content-cell\" align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; padding: 35px; word-break: break-word;\">\n <p class=\"sub align-center\" style=\"box-sizing: border-box; color: #AEAEAE; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;\" align=\"center\">© 2018 Allenforum. All rights reserved.</p>\n <p class=\"sub align-center\" style=\"box-sizing: border-box; color: #AEAEAE; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;\" align=\"center\">\n <a href=\"https://cubersindia.com\" target=\"_blank\">Cubersindia</a>\n <br />[email protected]\n <br />Kanpur-208021\n </p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </body>\n</html>\n';\n\n\n // Send email\n @mail($to, $subject, $message, $headers);\n $query = \"INSERT INTO forum_notices SET notice_subject='$noticeSubject',notice='$noticeText',permission='$noticeFor',postedBy='$receptionistId',postedByUserType='$userRole',date_time='$noticeDate' \";\n } else if ($noticeAction == \"edit\"){\n if ($hiddenNoticeEditId) {\n $query = \"UPDATE forum_notices SET notice_subject='$noticeSubject',notice='$noticeText',permission='$noticeFor',postedBy='$receptionistId',postedByUserType='$userRole',date_time='$noticeDate' WHERE notice_id='$hiddenNoticeEditId'\";\n }\n\n }\n\n $result = $connection->query($query);\n return $result;\n }", "function add_translation($suppid, $language) {\r\n\t\t\t\t$title = $this->input->post('title');\r\n\t\t\t\t$desc = $this->input->post('desc');\r\n\t\t\t\t$data = array('trans_title' => $title, 'trans_desc' => $desc, 'trans_extras_id' => $suppid, 'trans_lang' => $language,);\r\n\t\t\t\t$this->db->insert('pt_extras_translation', $data);\r\n\t\t\t\t$this->session->set_flashdata('flashmsgs', 'Changes Saved');\r\n\t\t}", "function chat_link_post_processing($title){\n setLocale(LC_TIME, substr(current_language(), 0, 2));\n $title = preg_replace('/TT_(.*)_TT/e', \"userdate(\\\\1)\", $title);\n return mb_convert_encoding($title, 'UTF-8', 'auto');\n}", "public function isTranslated();", "function simple_login_history_load_textdomain() {\n load_plugin_textdomain('simple-login-history', false, dirname( plugin_basename( __FILE__ )) . '/languages/');\n}", "protected function load_translations() {\n\t\t// load the plugin text domain\n\t\tload_plugin_textdomain( 'mailchimp-for-wp', false, 'mailchimp-for-wp-pro/languages/' );\n\t}", "function kino_load_textdomain() {\n\t\t\t\t\t\t\n\t\t\t// BP group announcements\n\t\t\tload_plugin_textdomain( \n\t\t\t\t'bpga',\n\t\t\t\tfalse, \n\t\t\t\t'kinogeneva-translations/languages/'\n\t\t\t);\n\t\t\t\n\t\t\t// BP group calendar\n\t\t\tload_plugin_textdomain( \n\t\t\t\t'groupcalendar',\n\t\t\t\tfalse, \n\t\t\t\t'kinogeneva-translations/languages/'\n\t\t\t);\n\t\t\t\n\t\t\t// BuddyPress Group Email Subscription\n\t\t\tload_plugin_textdomain( \n\t\t\t\t'bp-ass',\n\t\t\t\tfalse, \n\t\t\t\t'kinogeneva-translations/languages/'\n\t\t\t);\n\t\t\t\n\n}", "public function ajax_save_phrase()\n {\n $translation = ee()->input->post('translation');\n $status = ee()->input->post('publisher_save_status');\n\n // Stop here if false or if the array is empty\n if ( !$translation || empty($translation))\n {\n ee()->publisher_helper->send_ajax_response('failure');\n }\n\n $result = ee()->publisher_phrase->save_translation($translation, $status);\n\n if ($result)\n {\n ee()->publisher_helper->send_ajax_response('success');\n }\n else\n {\n ee()->publisher_helper->send_ajax_response($result);\n }\n }", "public function welcome_import_message() {\n global $OUTPUT;\n\n $a = get_string('tabutemplatepage2', 'mod_surveypro');\n $message = get_string('welcome_utemplateimport', 'mod_surveypro', $a);\n echo $OUTPUT->notification($message, 'notifymessage');\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\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 $dbname = \"zhongwei\";\n $host = \"58.215.187.8\";\n $user = \"zhongwei\";\n $pass = \"623610577\";\n \n \n //如果是新关注用户\n if($postObj->Event == 'subscribe'){\n //send_back(MENU);\n $con = mysql_connect(\"$host\",\"$user\",\"$pass\");\n if (!$con)\n {\n die('Could not connect: ' . mysql_error());\n }\n mysql_select_db(\"$dbname\", $con);\n $result = mysql_query(\"SELECT s.*,sf.* FROM uchome_space s LEFT JOIN uchome_spacefield sf ON s.uid=sf.uid WHERE s.wxkey='\".$toUsername.\"' \");\n mysql_query(\"SET NAMES 'utf8'\");\n if($row = mysql_fetch_array($result)){\n \n \n \n $v5 = mysql_query(\"SELECT a.*,m.* FROM uchome_appset a LEFT JOIN uchome_menuset m ON a.num=m.menusetid WHERE a.uid='$row[uid]' and a.appstatus='1'\");\n while($v52= mysql_fetch_array($v5)){\n $a[] = \"$v52[num]\";\n $b[] = \"$v52[subject]\";\n\n }\n \n \n $msgType = \"news\";\n if($row[name]){\n $name=$row[name];\n }else{\n $name=$row[username];\n }\n $appurl = \"http://v5.home3d.cn/home/capi/space.php?do=app&uid=$row[uid]\";\n $app = file_get_contents($appurl,0,null,null);\n $app_output = json_decode($app);\n $count=$app_output->data->count;\n $zhong2 = mysql_query(\"SELECT * FROM uchome_weixinmenutop WHERE uid='$row[uid]' and type='image'\");\n $wei2 = mysql_fetch_array($zhong2);\n if($wei2){\n $name=$wei2[name];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $result1 = mysql_query(\"SELECT * FROM uchome_weixinmenutop WHERE uid='$row[uid]' and type='frist' \");\n $result2 = mysql_query(\"SELECT * FROM uchome_weixinmenutop WHERE uid='$row[uid]' and type='second' \");\n mysql_query(\"SET NAMES 'utf8'\");\n if($weixin = mysql_fetch_array($result1)){\n $wei=explode(\".\",$weixin['number']);\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=$wei[0]&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=\".$wei[0].\"id&type=\".$wei[0].\"&moblieclicknum=$row[moblieclicknum]\";\n if($wei[0]==\"introduce\"){\n $subject=$app_output->data->introduce->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->introduce->image1url;\n }elseif($wei[0]==\"product\"){\n $subject=$app_output->data->product->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->product->image1url;\n }elseif($wei[0]==\"industry\"){\n $subject=$app_output->data->industry->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->industry->image1url;\n }elseif($wei[0]==\"cases\"){\n $subject=$app_output->data->cases->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->cases->image1url;\n }elseif($wei[0]==\"job\"){\n $subject=$app_output->data->job->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->job->image1url;\n }elseif($wei[0]==\"development\"){\n $subject=$app_output->data->development->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->development->image1url;\n }elseif($wei[0]==\"branch\"){\n $subject=$app_output->data->branch->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->branch->image1url;\n }elseif($wei[0]==\"goods\"){\n $subject=$app_output->data->goods->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->goods->image1url;\n }\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n \n if($weixin = mysql_fetch_array($result2)){\n $wei=explode(\".\",$weixin['number']);\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=$wei[0]&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&wxkey=\".$fromUsername.\"&id=\".$wei[1].\"&uid=$row[uid]&idtype=\".$wei[0].\"id&type=\".$wei[0].\"&moblieclicknum=$row[moblieclicknum]\";\n if($wei[0]==\"introduce\"){\n $subject=$app_output->data->introduce->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->introduce->image1url;\n }elseif($wei[0]==\"product\"){\n $subject=$app_output->data->product->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->product->image1url;\n }elseif($wei[0]==\"industry\"){\n $subject=$app_output->data->industry->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->industry->image1url;\n }elseif($wei[0]==\"cases\"){\n $subject=$app_output->data->cases->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->cases->image1url;\n }elseif($wei[0]==\"job\"){\n $subject=$app_output->data->job->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->job->image1url;\n }elseif($wei[0]==\"development\"){\n $subject=$app_output->data->development->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->development->image1url;\n }elseif($wei[0]==\"branch\"){\n $subject=$app_output->data->branch->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->branch->image1url;\n }elseif($wei[0]==\"goods\"){\n $subject=$app_output->data->goods->subject;\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->goods->image1url;\n }\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n \n }\n }else{\n $appurl = \"http://v5.home3d.cn/home/capi/space.php?do=app&uid=$row[uid]\";\n $app = file_get_contents($appurl,0,null,null);\n $app_output = json_decode($app);\n $count=$app_output->data->count;\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2['imageurl'];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n for($i=0;$i<$count;$i++){\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->app[$i]->english;\n if($app_output->data->app[$i]->newname){\n $subject=$app_output->data->app[$i]->newname;\n }else{\n $subject=$app_output->data->app[$i]->subject;\n }\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->app[$i]->image1url;\n\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n } \n \n if($app_output->data->highapp){\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->highapp[0]->english;\n if($app_output->data->highapp[0]->newname){\n $subject=$app_output->data->highapp[0]->newname;\n }else{\n $subject=$app_output->data->highapp[0]->subject;\n }\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->highapp[0]->image1url;\n\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n include_once( 'weibo/config.php' );\n require_once '../common.php';\n require_once 'wx_common.php';\n include_once( CONNECT_ROOT.'/saetv2.ex.class.php' );\n require_once CONNECT_ROOT.\"/common/jtee.inc.php\";\n require_once CONNECT_ROOT.\"/common/siteUserRegister.class.php\";\n require_once('Weixin.class.php');\n $rst = mysql_query(\"SELECT * FROM uchome_wxkey WHERE wxkey='$fromUsername'\");\n $row1 = mysql_fetch_array($rst);\n $rst1 = mysql_query(\"SELECT * FROM uchome_space WHERE wxkey='$fromUsername'\");\n $row2 = mysql_fetch_array($rst1);\n if($row1||$row2){\n loaducenter();\n //showmessage(\"$row[uid]\");\n //include_once(S_ROOT.'./source/function_cp.php');\n //updateuserstat('hot');\n if($row1){\n $user = uc_get_user($row1['uid'], 1); \n uc_user_synlogin($row1['uid']); \n }\n if($row2){\n $user = uc_get_user($row2['uid'], 1); \n uc_user_synlogin($row2['uid']); \n } \n \n $auth = setSession($user[0],$user[1]);\n $weixinuid=$row['uid'];\n $m_auth=rawurlencode($auth);\n $friendurl = \"http://v5.home3d.cn/home/capi/cp.php?ac=friend&op=add&uid=$weixinuid&gid=0&addsubmit=true&note=微信用户关注&m_auth=$m_auth\";\n $friend = file_get_contents($friendurl,0,null,null);\n $friend_output = json_decode($friend);\n \n \n }else{\n //include_once(S_ROOT.'./source/function_cp.php');\n //updateuserstat('hot');\n $nextuid=$row['uid'];\n $d = get_obj_by_xiaoquid($nextuid);\n $info = $d->getNewWXUser(); \n $fakeid=$info['id'];\n $query = mysql_query(\"SELECT * FROM uchome_space WHERE fakeid='$fakeid'\");\n $value = mysql_fetch_array($query);\n if($value){\n loaducenter();\n //include_once(S_ROOT.'./source/function_cp.php');\n //updateuserstat('hot'); \n $user = uc_get_user($value['uid'], 1); \n uc_user_synlogin($value['uid']);\n $auth = setSession($user[0],$user[1]);\n $weixinuid=$row['uid'];\n $m_auth=rawurlencode($auth);\n $friendurl = \"http://v5.home3d.cn/home/capi/cp.php?ac=friend&op=add&uid=$weixinuid&gid=0&addsubmit=true&note=微信用户关注&m_auth=$m_auth\";\n $friend = file_get_contents($friendurl,0,null,null);\n $friend_output = json_decode($friend);\n inserttable(\"wxkey\",array('wxkey'=>$fromUsername,'fakeid'=>$fakeid,'uid'=>$value['uid']));\n\n }else{\n $username =$fromUsername;\n $name = $fromUsername;\n $password = \"weixin\";\n $email = isemail($_REQUEST['email']) ? $_REQUEST['email'] : $username.\"@v5.com.cn\";\n $data = array();\n require_once CONNECT_ROOT.\"/common/siteUserRegister.class.php\";\n $regClass = new siteUserRegister();\n $uid = $regClass->reg($username, $email, $password);\n \n $nextuid=$row['uid'];\n $d = get_obj_by_xiaoquid($nextuid);\n $info = $d->getNewWXUser(); \n $setarr = array(\n 'name' => $info['nick_name'],\n 'fakeid'=>$info['id'],\n 'namestatus' => '1',\n 'wxkey' => $fromUsername,\n 'fatheruid'=>$nextuid\n );\n updatetable('space', $setarr, array('uid'=>$uid ));\n loaducenter();\n $user = uc_get_user($uid, 1); \n uc_user_synlogin($uid);\n $weixinuid=$row['uid'];\n $auth = setSession($user[0],$user[1]);\n $friendurl = \"http://v5.home3d.cn/home/capi/cp.php?ac=friend&op=add&uid=$row[uid]&gid=0&addsubmit=true&note=微信用户关注&m_auth=$m_auth\";\n $friend = file_get_contents($friendurl,0,null,null);\n $friend_output = json_decode($friend);\n }\n }\n \n\n \n \n }else{\n $contentStr.=\"未填写微信id\";\n $msgType = \"text\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }\n }\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 $eventkey=$postObj->EventKey;\n\n //判断是否已经有帐号\n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\"; \n\n $con = mysql_connect(\"$host\",\"$user\",\"$pass\");\n if (!$con)\n {\n die('Could not connect: ' . mysql_error());\n }\n mysql_select_db(\"$dbname\", $con);\n $result = mysql_query(\"SELECT s.*,sf.* FROM uchome_space s LEFT JOIN uchome_spacefield sf ON s.uid=sf.uid WHERE s.wxkey='\".$toUsername.\"' \");\n mysql_query(\"SET NAMES 'utf8'\");\n if($row = mysql_fetch_array($result)){\n if($eventkey){\n $msgType = \"news\";\n $wei=explode(\".\",$eventkey);\n if($wei[0]==\"introduce\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_introduce\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=$value[introduceid]&uid=$row[uid]&viewuid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=introduceid&type=introduce&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=$wei[0]&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=\".$wei[1].\"&uid=$row[uid]&viewuid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=\".$wei[0].\"id&type=\".$wei[0].\"&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->introduce->subject;\n $message1=$app_output->data->introduce->message1;\n //$message1=strtolower($message1);\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n /* $pic = $matches[1][0];*/\n /* if($app_output->data->introduce->pic){\n $pic =\"http://v5.home3d.cn/home/attachment/\".$app_output->data->introduce->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/attachment/\",\"http://v5.home3d.cn/home/attachment/\",$pic);\n $pic = str_replace(\"http://v5.home3d.cn/home/attachment/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n $pic = str_replace(\"http://v5.home3d.cn/home/attachment/attachment/\",\"http://v5.home3d.cn/home/attachment/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic=\"http://v5.home3d.cn/home/\".$app_output->data->introduce->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }elseif($wei[0]==\"branch\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_branch\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[branchid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=branchid&type=branch&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=branch&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&viewuid=$row[uid]&idtype=branchid&type=branch&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->branch->subject;\n $message1=$app_output->data->branch->message1;\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n //$pic = $matches[1][0];\n /*if($app_output->data->branch->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->branch->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->branch->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n /* if($app_output->data->branch->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->branch->pic;\n }else{\n $pic=\"\";\n }*/\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } elseif($wei[0]==\"industry\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_industry\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[industryid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=industryid&type=industry&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=industry&wxkey=\".$fromUsername.\"&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=\".$wei[1].\"&uid=$row[uid]&viewuid=$row[uid]&idtype=industryid&type=industry&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->industry->subject;\n $message1=$app_output->data->industry->message1;\n $message1=strtolower($message1);\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n //$pic = $matches[1][0];\n /* if($app_output->data->industry->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->industry->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->industry->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n /* if($app_output->data->industry->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->industry->pic;\n }else{\n $pic=\"\";\n }*/\n $articles[] = makeArticleItem($subject, $message2, $pic, $url);\n } \n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } elseif($wei[0]==\"job\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_job\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[jobid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=jobid&type=job&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=job&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=jobid&type=job&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->job->subject;\n $message1=$app_output->data->industry->message1;\n $message1=strtolower($message1);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } elseif($wei[0]==\"product\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_product\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[productid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=productid&type=product&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=product&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=productid&type=product&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->product->subject;\n $message1=$app_output->data->product->message1;\n preg_match_all(\"<src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n //$pic = $matches[1][0];\n /*if($app_output->data->product->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->product->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->product->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }elseif($wei[0]==\"development\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_development\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[developmentid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=developmentid&type=development&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=development&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=developmentid&type=development&moblieclicknum=$row[moblieclicknum]\";\n $message1=$app_output->data->development->message1;\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n //$pic = $matches[1][0];\n /*if($app_output->data->development->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->development->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->development->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n $subject=$app_output->data->development->subject;\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }elseif($wei[0]==\"goods\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_goods\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[goodsid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=goodsid&type=goods&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=goods&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=goodsid&type=goods&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->goods->subject;\n $message1=$app_output->data->goods->message1;\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n /*$pic = $matches[1][0];*/\n /* if($app_output->data->goods->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->goods->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->goods->imageurl;\n $pic = str_replace(\" \",\"%20\",$pic);\n /*if($app_output->data->goods->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->goods->pic;\n }else{\n $pic=\"\";\n }*/\n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } elseif($wei[0]==\"cases\"){\n if($wei[1]=='0'){\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n $table=\"uchome_cases\";\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid] limit 0,3\");\n while($value = mysql_fetch_array($query)){\n $subject=$value['subject'];\n $pic =\"http://v5.home3d.cn/home/\".$value['image1url'];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$value[casesid]&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=casesid&type=cases&moblieclicknum=$row[moblieclicknum]\"; \n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n }else{\n $url1 = \"http://v5.home3d.cn/home/capi/space.php?do=cases&uid=$row[uid]&id=$wei[1]\";\n $app = file_get_contents($url1,0,null,null);\n $app_output = json_decode($app);\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=\".$wei[1].\"&wxkey=\".$fromUsername.\"&uid=$row[uid]&idtype=casesid&type=cases&moblieclicknum=$row[moblieclicknum]\";\n $subject=$app_output->data->cases->subject;\n $message1=$app_output->data->cases->message1;\n preg_match_all(\"<img src=\\\"(.*)\\\">\",$message1,$matches);\n $message2=strip_tags($message1);\n $message2 = str_replace(\"&nbsp;\",\"\",$message2);\n $arr = explode(\"。\",$message2);\n $arr1 = explode(\".\",$arr[0]);\n $message2 =$arr1[0].\"...\";\n /* $pic = $matches[1][0];*/\n /*if($app_output->data->cases->pic){\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->cases->pic;\n $pic = str_replace(\"http://v5.home3d.cn/home/http://v5.home3d.cn/home/\",\"http://v5.home3d.cn/home/\",$pic);\n }else{\n $pic=\"\";\n }*/\n $pic =\"http://v5.home3d.cn/home/\".$app_output->data->cases->imageurl;\n\n $pic = str_replace(\" \",\"%20\",$pic); \n $articles[] = makeArticleItem($subject, $message2, $pic, $url); \n }\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n } \n \n \n\n \n }\n \n }else{\n $contentStr.=\"$toUsername\";\n $msgType = \"text\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }\n \n \n if(!empty( $keyword ))\n { \n \n if ($keyword=='Hello2BizUser'){ \n \n $contentStr.=\"过期的通知方式\";\n \n \n \n \n \n \n \n \n $msgType = \"text\";\n \n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n \n }elseif($keyword==\"绑定\"){\n $msgType = \"news\";\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=bind&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"\";\n $subject=\"输入帐号密码与微信进行绑定\";\n $pic = \"\";\n $articles[] = makeArticleItem($subject, $subject, $pic, $url);\n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }elseif($keyword==\"z\"){\n $msgType = \"text\";\n $contentStr.=\"$fromUsername\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }elseif($keyword==\"w\"){\n $msgType = \"text\";\n $contentStr.=\"$toUsername\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n $zhong = mysql_query(\"SELECT a.*,m.* FROM uchome_appset a LEFT JOIN uchome_menuset m ON a.num=m.menusetid WHERE a.uid='$row[uid]'and a.num='$keyword'\");\n $wei = mysql_fetch_array($zhong);\n \n $result = mysql_query(\"SELECT s.*,sf.* FROM uchome_space s LEFT JOIN uchome_spacefield sf ON s.uid=sf.uid WHERE s.wxkey='\".$toUsername.\"' \");\n $row = mysql_fetch_array($result);\n $msgType = \"news\";\n if($row[name]){\n $name=$row[name];\n }else{\n $name=$row[username];\n }\n $appurl = \"http://v5.home3d.cn/home/capi/space.php?do=app&uid=$row[uid]\";\n $app = file_get_contents($appurl,0,null,null);\n $app_output = json_decode($app);\n $count=$app_output->data->count;\n $zhong2 = mysql_query(\"SELECT * FROM uchome_recommend WHERE uid='$row[uid]'\");\n $wei2 = mysql_fetch_array($zhong2);\n $name=$wei2[subject];\n if($wei2['recommendlink']){\n $url = \"$wei2[recommendlink]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=home&uid=\".$row[uid];\n }\n $pic = \"http://v5.home3d.cn/home/\".$wei2[imageurl];\n $articles[] = makeArticleItem($name, $name, $pic, $url);\n if($count>7){\n $count='7';\n $more='1';\n }\n for($i=0;$i<$count;$i++){ \n \n //$url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->app[$i]->english;\n $menusetcount=$app_output->data->app[$i]->count;\n if($menusetcount=='1'){\n $idtype=$app_output->data->app[$i]->english;\n $idtypeid=$idtype.\"id\";\n $table=\"uchome_\".$idtype;\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid]\");\n $value = mysql_fetch_array($query);\n $id=$value[\"$idtypeid\"];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$id&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=$idtypeid&type=$idtype&moblieclicknum=$row[moblieclicknum]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->app[$i]->english; \n }\n /* if($menusetcount=='1'){\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->app[$i]->english;\n }else{\n $id=$app_output->data->app[$i]->id;\n $idtype=$app_output->data->app[$i]->english;\n $idtypeid=$idtype.\"id\";\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&id=$id&uid=$row[uid]&idtype=$idtypeid&type=$idtype&moblieclicknum=$row[moblieclicknum]\"; \n }*/\n if($app_output->data->app[$i]->newname){\n $subject=$app_output->data->app[$i]->newname;\n }else{\n $subject=$app_output->data->app[$i]->subject;\n }\n \n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->app[$i]->image1url;\n\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n } \n \n if($app_output->data->highapp){\n $menusetcount=$app_output->data->highapp[$i]->count;\n if($menusetcount=='1'){\n $idtype=$app_output->data->highapp[$i]->english;\n $idtypeid=$idtype.\"id\";\n $table=\"uchome_\".$idtype;\n $query = mysql_query(\"SELECT * FROM \".$table.\" WHERE uid=$row[uid]\");\n $value = mysql_fetch_array($query);\n $id=$value[\"$idtypeid\"];\n $url = \"http://v5.home3d.cn/home/wx/wx.php?do=detail&viewuid=$row[uid]&id=$id&uid=$row[uid]&wxkey=\".$fromUsername.\"&idtype=$idtypeid&type=$idtype&moblieclicknum=$row[moblieclicknum]\"; \n }else{\n $url = \"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=feed&num=rand()&wxkey=\".$fromUsername.\"&uid=\".$row[uid].\"&idtype=\".$app_output->data->highapp[0]->english;\n }\n \n if($app_output->data->highapp[0]->newname){\n $subject=$app_output->data->highapp[0]->newname;\n }else{\n $subject=$app_output->data->highapp[0]->subject;\n }\n $pic = \"http://v5.home3d.cn/home/\".$app_output->data->highapp[0]->image1url;\n\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n }\n if(!empty($more)){\n $subject=\"更多\";\n $url=\"http://v5.home3d.cn/home/wx/wx.php?uid=$row[uid]&do=home&num=rand()&wxkey=\".$fromUsername;\n $pic=\"http://v5.home3d.cn/home/./upload/menuset/small/menuset1379386329communicate.jpg\";\n $articles[] = makeArticleItem($subject, $subject, $pic, $url); \n } \n \n \n \n \n \n \n \n $resultStr = makeArticles($fromUsername, $toUsername, $time, $msgType, $name,$articles); \n echo $resultStr;\n }\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }\n }", "function newsletters_subscribe_page() {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-subscribe.php\" );\r\n }", "function pntresmailer_init(){\n $dbconn =& pnDBGetConn(true);\n $pntable = pnDBGetTables();\n\n// nl_arch_subscriber\n $nl_arch_subscribertable = $pntable['nl_arch_subscriber'];\n $nl_arch_subscribercolumn = &$pntable['nl_arch_subscriber_column'];\n\n $sql = \"CREATE TABLE $nl_arch_subscribertable (\n $nl_arch_subscribercolumn[arch_mid] int(11) NOT NULL default '0',\n $nl_arch_subscribercolumn[sub_reg_id] int(11) NOT NULL default '0',\n $nl_arch_subscribercolumn[arch_date] int(25) NOT NULL default '0',\n $nl_arch_subscribercolumn[arch_read] int(25) NOT NULL default '0')\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_archive\n $nl_archivetable = $pntable['nl_archive'];\n $nl_archivecolumn = &$pntable['nl_archive_column'];\n\n $sql = \"CREATE TABLE $nl_archivetable (\n $nl_archivecolumn[arch_mid] int(11) NOT NULL auto_increment,\n $nl_archivecolumn[arch_issue] tinytext NOT NULL,\n $nl_archivecolumn[arch_message] longtext NOT NULL,\n $nl_archivecolumn[arch_date] int(25) NOT NULL default '0',\n PRIMARY KEY(arch_mid))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_archive_txt\n $nl_archive_txttable = $pntable['nl_archive_txt'];\n $nl_archive_txtcolumn = &$pntable['nl_archive_txt_column'];\n\n $sql = \"CREATE TABLE $nl_archive_txttable (\n $nl_archive_txtcolumn[arch_mid] int(11) NOT NULL,\n $nl_archive_txtcolumn[arch_issue] tinytext NOT NULL,\n $nl_archive_txtcolumn[arch_message] longtext NOT NULL,\n $nl_archive_txtcolumn[arch_date] int(25) NOT NULL default '0',\n PRIMARY KEY(arch_mid))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_modules\n $nl_modulestable = $pntable['nl_modules'];\n $nl_modulescolumn = &$pntable['nl_modules_column'];\n\n $sql = \"CREATE TABLE $nl_modulestable (\n $nl_modulescolumn[mod_id] int(11) NOT NULL auto_increment,\n $nl_modulescolumn[mod_pos] int(11) NOT NULL default '0',\n $nl_modulescolumn[mod_file] tinytext NOT NULL,\n $nl_modulescolumn[mod_name] tinytext NOT NULL,\n $nl_modulescolumn[mod_function] tinytext NOT NULL,\n $nl_modulescolumn[mod_descr] tinytext NOT NULL,\n $nl_modulescolumn[mod_version] tinytext NOT NULL,\n $nl_modulescolumn[mod_multi_output] int(5) NOT NULL default '0',\n $nl_modulescolumn[mod_qty] int(5) NOT NULL default '1',\n $nl_modulescolumn[mod_edit] int(5) NOT NULL default '0',\n $nl_modulescolumn[mod_data] mediumtext NOT NULL,\n PRIMARY KEY(mod_id))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_subscriber\n $nl_subscribertable = $pntable['nl_subscriber'];\n $nl_subscribercolumn = &$pntable['nl_subscriber_column'];\n\n $sql = \"CREATE TABLE $nl_subscribertable (\n $nl_subscribercolumn[sub_reg_id] int(11) NOT NULL auto_increment,\n $nl_subscribercolumn[sub_uid] int(11) NOT NULL default '0',\n $nl_subscribercolumn[sub_name] tinytext NOT NULL,\n $nl_subscribercolumn[sub_email] tinytext NOT NULL,\n $nl_subscribercolumn[sub_last_date] int(25) NOT NULL default '0',\n PRIMARY KEY(sub_reg_id))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_unsubscribe\n $nl_unsubscribetable = $pntable['nl_unsubscribe'];\n $nl_unsubscribecolumn = &$pntable['nl_unsubscribe_column'];\n\n $sql = \"CREATE TABLE $nl_unsubscribetable (\n $nl_unsubscribecolumn[unsub_reg_id] int(11) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_uid] int(11) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_name] tinytext NOT NULL,\n $nl_unsubscribecolumn[unsub_email] tinytext NOT NULL,\n $nl_unsubscribecolumn[unsub_last_date] int(25) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_date] int(25) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_received] int(5) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_remote_addr] tinytext NOT NULL,\n $nl_unsubscribecolumn[unsub_user_agent] tinytext NOT NULL,\n $nl_unsubscribecolumn[unsub_who] int(11) NOT NULL default '0')\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_var\n $nl_vartable = $pntable['nl_var'];\n $nl_varcolumn = &$pntable['nl_var_column'];\n\n $sql = \"CREATE TABLE $nl_vartable (\n $nl_varcolumn[nl_var_id] int(11) NOT NULL default '0',\n $nl_varcolumn[nl_header] mediumtext NOT NULL,\n $nl_varcolumn[nl_footer] mediumtext NOT NULL,\n $nl_varcolumn[nl_subject] tinytext NOT NULL,\n $nl_varcolumn[nl_name] tinytext NOT NULL,\n $nl_varcolumn[nl_email] tinytext NOT NULL,\n $nl_varcolumn[nl_url] tinytext NOT NULL,\n $nl_varcolumn[nl_tpl_html] tinytext NOT NULL,\n $nl_varcolumn[nl_tpl_text] tinytext NOT NULL,\n $nl_varcolumn[nl_issue] int(11) NOT NULL default '0',\n $nl_varcolumn[nl_bulk_count] int(5) NOT NULL default '500',\n $nl_varcolumn[nl_loop_count] int(5) NOT NULL default '5',\n $nl_varcolumn[nl_mail_server] tinytext NOT NULL,\n $nl_varcolumn[nl_unreg] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_system] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_popup] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_popup_days] int(5) NOT NULL default '10',\n $nl_varcolumn[nl_sample] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_personal] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_resub] int(5) NOT NULL default '1',\n PRIMARY KEY(nl_var_id))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n $sql = \"INSERT INTO $nl_vartable VALUES (1,'Here is this weeks newsletter.','Thanks for checking out our news.\\r\\n\\r\\nsincerely,\\r\\nme','Our Newsletter','Your Site Name','[email protected]','http://www.yoursite.com','default/html.tpl','default/text.tpl',1,500,5,'localhost',0,0,0,10,0,0,1)\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n return true;\n}", "function m_dspemails()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_EMAIL_FILE\",$this->emailTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_EMAIL_BLK\", \"email_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MESSAGE_BLK\", \"message_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MSG_BLK1\", \"msg_blk1\");\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SALESURL\",SITE_URL.\"sales/\");\n\n\t\t#INTAILIZING ***\n\t\t$this->ObTpl->set_var(\"email_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"message_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk1\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk2\",\"\");\t\n\n\t\t$this->request['msg']=$this->libFunc->ifSet($this->request,\"msg\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",\"\");\n\n\t\t#DATABASE QUERY\n\t\t$this->obDb->query = \"SELECT * FROM \".EMAILS;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$campaigncount = $this->obDb->record_count;\n\t\tif($this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_INSERTED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==3)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_DELETED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==5)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_SENT);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\n\t\tif($campaigncount>0)\n\t\t{\n\t\t\t#PARSING DISCOUNT BLOCK\n\t\t\tfor($j=0;$j<$campaigncount;$j++)\n\t\t\t{\t\t\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iMailid_PK);\n\t\t\t\tif ($queryResult[$j]->vUserList==\"All\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".CUSTOMERS.\" WHERE iStatus=1 AND iMailList !=0\";\n }else{ \n $this->obDb->query = \"SELECT count(*) as cnt FROM \".LEADLIST.\" WHERE iLeadId_FK='\". $queryResult[$j]->vUserList.\"'\";\n }\n\t\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t\t\n\t\t\t\tif ($queryResult[$j]->vVisitorList==\"1\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".NEWSLETTERS;\n\t\t\t\t $qryVs = $this->obDb->fetchQuery();\n\t\t\t\t $qryRs[0]->cnt = $qryRs[0]->cnt + $qryVs[0]->cnt;\n }\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_USERCOUNT\",$qryRs[0]->cnt);\n \n $this->ObTpl->set_var(\"TPL_VAR_SUBJECT\",$this->libFunc->m_displayContent($queryResult[$j]->vSubject));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SID\",$this->libFunc->m_displayContent($queryResult[$j]->vSid));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BUILDDATE\",$this->libFunc->dateFormat2($queryResult[$j]->tmBuildDate));\t\n\t\t\t\t$sentDate=$this->libFunc->dateFormat2($queryResult[$j]->tmSentDate);\n\t\t\t\tif(empty($sentDate))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",\"Send now\");\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View/Sent\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",$sentDate);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View\");\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"email_blk\",\"TPL_EMAIL_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$campaigncount.\" records found\");\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",MSG_NOEMAILS);\n\t\t\t$this->ObTpl->parse(\"message_blk\",\"TPL_MESSAGE_BLK\");\n\t\t}\n\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_EMAIL_FILE\"));\n\t}", "function squirrelmail_plugin_init_mail_fetch() {\n global $squirrelmail_plugin_hooks;\n\n $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['mail_fetch'] = 'mail_fetch_link';\n $squirrelmail_plugin_hooks['login_verified']['mail_fetch'] = 'mail_fetch_setnew';\n $squirrelmail_plugin_hooks['left_main_before']['mail_fetch'] = 'mail_fetch_login';\n $squirrelmail_plugin_hooks['optpage_register_block']['mail_fetch'] = 'mailfetch_optpage_register_block';\n $squirrelmail_plugin_hooks['rename_or_delete_folder']['mail_fetch'] = 'mail_fetch_folderact';\n}", "function wpsp_send_tour_inquiry() {\n\t\n\tparse_str ($_POST['tours'], $inquiry_info);\n\t\n\twpsp_email_notify( $inquiry_info, true, false ); //confirm to operator\n\twpsp_email_notify( $inquiry_info, false, false ); //confirm to traveller\n\t\n\tdie();\n}", "function wpcf7_knews_subscription ($WPCF7_ContactForm) {\n\t\n\t$submission = WPCF7_Submission::get_instance();\n\t$posted_data =& $submission->get_posted_data();\t \n\n\tif(isset($posted_data['knews-subscription'])) {\n\n\t\t$email = $posted_data['email'];\n\t\t\n\t\t$id_list_news = $posted_data['knews-subscription'];\n\t\t$lang = ICL_LANGUAGE_CODE;\n\t\t$lang_locale = get_locale();\n\t\t\n\t\t$extra_fields = $posted_data;\n\t\t$custom_fields = array();\n\t\t\tforeach ($extra_fields as $field) {\n\t\t\t\t$custom_fields[1]=$posted_data['name'];\n\t\t\t\t$custom_fields[2]=$posted_data['surname'];\n\t\t\t}\n\t\n\t\t$bypass_confirmation = true;\n\t\t\n\t\tapply_filters('knews_add_user_db', 0, $email, $id_list_news, $lang, $lang_locale, $custom_fields, $bypass_confirmation);\n\t\t\t\n\t}\t\n}", "function MyApp_Mail_Init()\n {\n if ($this->Mail)\n {\n $this->MailInfo=$this->ReadPHPArray($this->MailSetup);\n $unit=$this->Unit();\n if (!empty($unit[ \"ID\" ]))\n {\n foreach ($this->Unit2MailInfo as $key)\n {\n if (empty($this->MailInfo[ $key ])) { $this->MailInfo[ $key ]=\"\"; }\n \n if (!empty($unit[ $key ]))\n {\n $this->MailInfo[ $key ]=$unit[ $key ];\n }\n }\n }\n $event=array();\n if ($this->CGI_GETint(\"Event\")>0)\n {\n $event=$this->Event();\n }\n\n if (!empty($event[ \"ID\" ]))\n {\n foreach ($this->Event2MailInfo as $key)\n {\n if (empty($this->MailInfo[ $key ])) { $this->MailInfo[ $key ]=\"\"; }\n \n if (!empty($event[ $key ]))\n {\n $this->MailInfo[ $key ]=$event[ $key ];\n }\n }\n }\n }\n }", "private function activateMailChimpNewsletter()\n\t{\n\t\t$service = MailChimp_Newsletter::instance();\n\n\t\tif ($this->is_configured && $service->isConfigured()) {\n\n\t\t\t$service->setEnvironment($this->environment);\n\t\t\t$service->setVersion($this->version);\n\n\t\t\t// adding the ability to render the checkbox on another screen of the checkout page.\n\t\t\t$render_on = $service->getOption('mailchimp_checkbox_action', 'woocommerce_after_checkout_billing_form');\n\n\t\t\t$this->loader->add_action($render_on, $service, 'applyNewsletterField', 10);\n\n\t\t\t$this->loader->add_action('woocommerce_ppe_checkout_order_review', $service, 'applyNewsletterField', 10);\n\t\t\t$this->loader->add_action('woocommerce_register_form', $service, 'applyNewsletterField', 10);\n\n\t\t\t$this->loader->add_action('woocommerce_checkout_order_processed', $service, 'processNewsletterField', 10, 2);\n\t\t\t$this->loader->add_action('woocommerce_ppe_do_payaction', $service, 'processPayPalNewsletterField', 10, 1);\n\t\t\t$this->loader->add_action('woocommerce_register_post', $service, 'processRegistrationForm', 10, 3);\n\t\t}\n\t}", "public function sendSMSNotificationToTranslator($job);", "function mme_success_notice(){\n\t$msg = \"Email Id saved successfully\";\n\t?>\n\t <div class=\"updated\" style=\"margin:5px 2px 2px\">\n <p><?php _e( $msg, 'my-text-domain' ); ?></p>\n </div>\n\t<?\n\n}", "function bot_wtc_gTxt($what) {\nglobal $event;\nif($event !== 'article') {\n\treturn;\n}\n\tglobal $language;\n\n\t$en_us = array(\n\t\t'install_message' => 'bot_wtc is not yet properly initialized. Use the button below to create the preferences table.',\n\t\t'upgrade_message' => 'bot_wtc must be upgraded. Use the button below to add the new fields to the preferences table.',\n\t\t'uninstall' => 'Uninstall',\n\t\t'uninstall_message' => 'Using the button below will remove all preferences from the db. <br />Use before a complete uninstall or to reset all preferences. ',\n\t\t'uninstall_confirm' => 'Are you sure you want to delete the preferences table?',\n\t\t'td_warning' => 'Columns cannot be moved relative to single items and vice-versa',\n\t\t'same_item_warning' => 'Oops! You are trying to move an item relative to itself',\n\t\t'combo_warning' => 'Oops! You tried to insert an incomplete rule',\n\t\t);\n\n\t$lang = array(\n\t\t'en-us' => $en_us\n\t\t);\n\n\t\t$language = (isset($lang[$language])) ? $language : 'en-us';\n\t\t$msg = (isset($lang[$language][$what])) ? $lang[$language][$what] : $what;\n\t\treturn $msg;\n}", "public function wplt_ajax_response(){\n global $sitepress;\n $sitepress->switch_lang('all');\n }", "function tn_prepare_messages() {\n\n\t$_messages = TN_Messages::get_instance();\n\n\t$messages = $_messages->get_messages();\n\n\tif( $messages ) :\n\n\t\tadd_action( 'tn_messages', function() use ( $messages ) { \n\n\t\t\tforeach( $messages as $key => $message ) {\n\t\t\t\t// we add data-message - useful if element is eg cloned to pull it downscreen\n\t\t\t\tif( isset( $message['success'] ) ) : ?>\n\t\t\t\t\t<div data-message=\"<?php echo ++$key; ?>\" class=\"tn_message success\"><?php echo $message['success']; ?></div>\n\t\t\t\t<?php elseif ( isset( $message['error'] ) ) : ?>\n\t\t\t\t\t<div data-message=\"<?php echo ++$key; ?>\" class=\"tn_message error\"><?php echo $message['error']; ?></div>\t\n\t\t\t\t<?php endif; \n\t\t\t}\n\n\t\t});\n\n\tendif;\n}", "function news_view() {\n // retrieve response object\n $response = responseObject();\n\n $locale = get_var( 'locale', 'en' );\n\n // response data\n $data = array();\n\n // language str\n $locale_str = array(\n 'en' => array(\n 'title' => 'englishtitle',\n 'detail' => 'englishdetails',\n 'dir' => 'ltr'\n ),\n 'ar' => array(\n 'title' => 'arabictitle',\n 'detail' => 'arabicdetails',\n 'dir' => 'rtl'\n ),\n 'fr' => array(\n 'title' => 'frenchtitle',\n 'detail' => 'frenchdetails',\n 'dir' => 'ltr'\n )\n );\n\n $data['locale'] = $locale;\n $data['dir'] = $locale_str[$locale]['dir'];\n $data['title'] = $locale_str[$locale]['title'];\n $data['detail'] = $locale_str[$locale]['detail'];\n\n // news id from request\n $id = get_var( 'id' );\n\n // fetch news data\n $news = db_row( 'news', '*', 'newsid', $id );\n\n if( $news == null ) {\n $response->isTemplate( false );\n $response->Send( '404.html' );\n return;\n }\n\n $data['news'] = $news;\n\n $response->send( 'views/news_view.php', $data );\n}", "function snoc_save_marquee_meta_fields( $post_id ) {\r\n if (!isset($_POST['wpse_our_nonce']) || !wp_verify_nonce($_POST['wpse_our_nonce'], basename(__FILE__)))\r\n return 'nonce not verified';\r\n $marquee_news_check = sanitize_text_field( $_POST['marquee_news_check'] );\r\n update_post_meta( $post_id, '_marquee_latest_news', $marquee_news_check );\r\n\r\n}", "function og_simplenews_manager_save_emails($form, &$form_state) {\n foreach ($form_state['values']['newsletters'] as $tid => $values) {\n if ($tid && is_numeric($tid)) {\n og_simplenews_save_subscriptions($tid, $values['emails']);\n }\n }\n}", "function postcountdown_textdomain() {\n\tload_plugin_textdomain( 'postcountdown', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );\n\t#load_plugin_textdomain( 'postcountdown', false, plugins_url( '/languages/', __FILE__ ) );\n}", "function tn_messages() {\n\tdo_action( 'tn_messages' );\n}" ]
[ "0.60821956", "0.6044135", "0.6018612", "0.5988313", "0.5932511", "0.5881662", "0.58302015", "0.5825458", "0.5799679", "0.57918113", "0.5788206", "0.5777349", "0.57611394", "0.57611394", "0.57527363", "0.57365483", "0.57190454", "0.5717192", "0.5715659", "0.5710406", "0.5659814", "0.5637904", "0.56088537", "0.5602737", "0.5602295", "0.5593909", "0.5592709", "0.5561601", "0.5560694", "0.55477905", "0.55432755", "0.5541628", "0.5530249", "0.5524502", "0.55190796", "0.5512092", "0.55090797", "0.549292", "0.5467849", "0.5467353", "0.5453658", "0.5452878", "0.54479796", "0.5428614", "0.5428297", "0.5427193", "0.5424645", "0.542449", "0.54233176", "0.5421815", "0.5404444", "0.5388451", "0.53794825", "0.53778756", "0.5369737", "0.5366115", "0.53653365", "0.5364699", "0.5362957", "0.5355136", "0.5352604", "0.5350521", "0.534362", "0.53426814", "0.53384453", "0.5334628", "0.53343415", "0.5333089", "0.533221", "0.53303814", "0.5330164", "0.5329915", "0.5325856", "0.5323787", "0.53180015", "0.531378", "0.5310484", "0.5308922", "0.53088635", "0.5308433", "0.530342", "0.53030604", "0.52958405", "0.5295411", "0.528605", "0.5285624", "0.5280858", "0.52777296", "0.5268778", "0.5266851", "0.5265598", "0.5265057", "0.5258484", "0.5257181", "0.52555233", "0.52543527", "0.5253608", "0.5249504", "0.5246986", "0.5245515", "0.52454484" ]
0.0
-1
The cache name that should be referred to for the item. It should be unique.
public function getCacheName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cacheKey(): string {\n return self::CACHE_PREFIX . $this->id\n . ($this->revisionId ? '_r' . $this->revisionId : '');\n }", "public function cache_filename()\n {\n return $this->_name . '_' . $this->id() . '.' . $this->_type;\n }", "public function name()\n {\n return $this->getFromCache(\n ['type' => 'name']\n );\n }", "protected static function getCacheName()\n\t{\n\t\tstatic $strCacheName;\n\t\tif (!isset($strCacheName))\n\t\t{\n\t\t\t$strCacheName = __CLASS__;\n\t\t}\n\t\treturn $strCacheName;\n\t}", "public function cacheName()\n\t\t{\n\t\t\treturn $GLOBALS[\"ID\"] . \"_call.xml\";\n\t\t}", "private function getCacheKey(): string\n {\n return $this->webserviceId.$this->cacheKey;\n }", "private function getCacheId()\n\t{\n\t\treturn self::CACHE_ID_PREFIX . '_' . $this->exportId . '_' . $this->type;\n\t}", "function getCacheId() {\n return get_class($this).\"_\".$this->id;\n }", "public function getCacheKey()\n {\n return $this->cacheKey;\n }", "public function getCacheKey()\n {\n return $this->CacheKey;\n }", "protected function cacheKey() : string\n {\n return $this->cacheKey ?? $this->cacheKeyHash();\n }", "protected static function getCacheIdentifier() {}", "public function getCacheKey() {\n return $this->_cacheKey;\n }", "public function getCacheName($name){\n if($this->is_mobile)\n $name .= '_mobile';\n return $name;\n }", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->module() . '_' . $this->unique() );\n\t}", "private function cacheKey()\n {\n return sprintf('contact-permissons-%s', $this->client->patientContactId);\n }", "protected function cacheKey()\n {\n return md5($this->gridField->Link());\n }", "private function generateCacheName(): string\n\t{\n\t\t$get = implode('-', $_GET);\n\t\t$name = $this->_resizeMode . $this->_imagePath . $this->_oldWidth . $this->_oldHeight . $this->_newWidth . $this->_newHeight . $get;\n\t\treturn md5($name) . '.' . $this->_extension;\n\t}", "private function getCacheKey($storage_name){\n return $storage_name.'_'.$this->media_type.'_'.$this->media_id;\n }", "private function _cacheName() {\n $file = APPLICATION_PATH . '/application/settings/restapi_caching_url.php';\n if (file_exists($file)) {\n $enableCacheUrl = include $file;\n } else {\n return '';\n }\n $viewer = Engine_Api::_()->user()->getViewer();\n $front = Zend_Controller_Front::getInstance();\n $request = $front->getRequest();\n $params = array();\n $params['module'] = $request->getModuleName();\n $params['controller'] = $request->getControllerName();\n $params['action'] = $request->getActionName();\n $parameters = $request->getParams();\n $language = $parameters['language'];\n $cacheName = implode(\"_\", $params);\n $key_val = '';\n $cacheName = str_replace('-', '_', $cacheName);\n if (!isset($enableCacheUrl[$cacheName]) || empty($enableCacheUrl[$cacheName]))\n return;\n $getRequestUri = htmlspecialchars($_SERVER['REQUEST_URI']);\n $urlarray = explode(\"?\", $getRequestUri);\n $trimData = trim($urlarray[0], \"/\");\n $cachName = str_replace(\"/\", \"_\", $trimData);\n $viewerId = 0;\n $keys = array_keys($parameters);\n $matched = preg_grep('/_id|_type$/', $keys);\n $matched = array_flip($matched);\n $matched = array_intersect_key($parameters, $matched);\n $key_val = implode('_', $matched);\n\n if ($enableCacheUrl[$cacheName] == 'member_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->level_id : 0;\n } elseif ($enableCacheUrl[$cacheName] == 'user_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->getIdentity() : 0;\n }\n\n $cachName = $cachName . '_' . $language . '_' . $key_val . '_' . $viewerId;\n $cachName = str_replace('-', '_', $cachName);\n $cachName = str_replace('.', '_', $cachName);\n return $cachName;\n }", "private function get_cache_id() {\n $handlername = get_class($this);\n if($this->id)\n $cache_id = '_cache_' . $handlername . '_' . $this->id;\n else \n $cache_id = '_cache_' . $handlername . '_all'; \n return $cache_id;\n\t}", "abstract function get_cache_prefix(): string;", "public function getCacheKey(): string\n {\n $customerGroupId = 0;\n\n if ($this->hasCustomerGroupId()) {\n $customerGroupId = $this->getCustomerGroupId();\n }\n\n return sprintf('%d-%d-%d', $this->getWebsiteId(), $customerGroupId, $this->getStoreId());\n }", "protected function getCacheKey()\r\n {\r\n if (null == $this->cacheKey) {\r\n $this->cacheKey = get_class($this)\r\n . $this->getParent()->getEnvironment()\r\n . $this->getHttpHost();\r\n }\r\n return $this->cacheKey;\r\n }", "public function getCacheId() {\n\t\treturn parent::getCacheId();\n\t}", "protected function getCacheName(){\n\t\tif(is_null($this->param)) {\n\t\t\tthrow new \\Exception('Call \"setParameters\" first!');\n\t\t}\n\n\t\t// Change character when making incompatible changes to prevent loading\n\t\t// errors due to incompatible file contents \\|/\n\t\treturn hash('md5', http_build_query($this->param) . 'A') . '.cache';\n\t}", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "protected function prefix($name)\r\n {\r\n return self::CACHE_PREFIX . $name;\r\n }", "protected function getCacheKey() {\n $plugin_id = hash('sha256', $this->getPluginId());\n $uri = $this->config('uri');\n\n return $plugin_id . ':' . $uri;\n }", "protected function _getFileName() {\n\n\t\t\treturn \t$this->_cacheFolder.$this->_getHash($this->_cacheFile).$this->_cacheExtension;\n\n\t\t}", "public static function getCacheName($imageID = NULL)\n\t{\n\t\t$returnValue = NULL;\n\n\t\tif ($imageID) {\n\t\t\t$returnValue = strlen($imageID) . '_' . md5($imageID);\n\t\t}\n\n\t\treturn $returnValue;\n\t}", "public function cacheKey() {\n $params = $this->getParameters();\n $ret = '';\n $this->make_cache_key($params, $ret);\n\n return md5($ret);\n }", "protected function getConfigNameWithCacheSettings(): string {\n $configs = $this->getEditableConfigNames();\n return reset($configs);\n }", "public function getCacheKey()\n {\n return md5('SprainCurrencyConverter_' . $this->getName() . $this->baseCurrency . $this->targetCurrency);\n }", "function getCacheFilename() {\n\t\treturn 'cache/fc-categories.php';\n\t}", "protected function _getActualKey($cacheName, $key = NULL)\n\t{\n\t\t$return = $this->_prefix . '_' . $cacheName;\n\n\t\t!is_null($key) && $return .= '_' . md5($key);\n\n\t\treturn $return;\n\t}", "protected function _getAdditionalCacheId()\n\t{\n\t\treturn md5('CONTAINER_ORDERS_' . $this->_placeholder->getAttribute('cache_id'));\n\t}", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "public function getCacheKey($name)\n {\n return $this->findTemplate($name) . '_' . $this->scope;\n }", "function _CacheFileName($key) {\n\t\t$FileName = $this->CacheDir . '/' . $this->_CleanKey($key);\n\n\t\treturn $FileName;\n\t}", "protected function cacheName($file){\n $hash = sha1($file);\n return \"$this->cache/$hash.php\";\n }", "public function getCacheKey(Request $request): string;", "protected function GetCacheKey()\n\t{\n\t\treturn (isset($this->params['hashbase']) ? $this->params['hashbase'] : '') . '|' . (isset($this->params['hash']) ? $this->params['hash'] : '') . '|' . (isset($this->params['file']) ? sha1($this->params['file']) : '');\n\t}", "protected function getCacheSuffix() {\n return '';\n }", "public function ElementCacheKey()\n {\n $fragments = [\n 'elemental_block',\n $this->owner->ID,\n $this->owner->LastEdited\n ];\n return implode('-_-', $fragments);\n }", "public function getCacheKey()\n {\n return md5($this->formId . ':' . implode(',', $this->fieldIds));\n }", "public function getCachePrefix(): string\n {\n if ($this->cachePrefix === null) {\n $this->cachePrefix = hash('md4', $this->connection->getHost().'-'.$this->connection->getPort().'-'.$this->connection->getDatabase().'-'.$this->connection->getDriver()->getName());\n }\n\n return $this->cachePrefix;\n }", "public function getCacheId()\n {\n return 'wsdl_config_global_' . md5($this->getServiceUrl('*/*/*'));\n }", "public function getCacheKey() {\n $key = $this->getUrl ();\n\n if (isset ( $this->accessKey )) {\n $key .= $this->accessKey;\n }\n\n if (isset ( $this->requestHeaders ['authorization'] )) {\n $key .= $this->requestHeaders ['authorization'];\n }\n\n return md5 ( $key );\n }", "public static function cached($_name) {\n\t\t$_name=self::resolve($_name);\n\t\t$_hash='var.'.self::hashCode(self::remix($_name));\n\t\treturn Cache::cached($_hash);\n\t}", "protected function GetCacheKey()\n\t{\n\t\treturn $this->params['page'];\n\t}", "protected function _getAssetName()\n {\n $k = $this->_tbl_key;\n return 'com_userinvites.userinvites.'.(int) $this->$k;\n }", "protected function getCacheKey($itemkey) {\n\t\t$key = 'Rate';\n\t\t\n\t\t// Add global identifier\n\t\tif($this->policy('rate_lock_byitem')) {\n\t\t\t$key .= '_' . md5($itemkey);\n\t\t}\n\t\t\n\t\t// Add user-specific identifier\n\t\tif($this->policy('rate_lock_byuserip') && Controller::has_curr()) {\n\t\t\t$ip = Controller::curr()->getRequest()->getIP();\n\t\t\t$key .= '_' . md5($ip);\n\t\t}\n\t\t\n\t\treturn $key;\n\t}", "public function getCacheType(): string\n\t{\n\t\treturn $this->cacheType;\n\t}", "public function getCachePrefix($widgetName)\n {\n return Widget::CACHE_PREFIX . $widgetName . '-';\n }", "function cache_key(Repository $repo) {\n return \"ms_\" . md5($repo->user . $repo->name);\n}", "public function getConfigCacheKey() \n {\n return (string) $this->configCacheKey;\n }", "public function getPrefix()\n\t{\n\t\treturn $this->royalcms['config']['cache.prefix'];\n\t}", "final protected function getCacheKey($cacheId = array())\n\t{\n\t\tif(!is_array($cacheId))\n\t\t\t$cacheId = array((string) $cacheId);\n\n\t\t$cacheId['SITE_ID'] = SITE_ID;\n\t\t$cacheId['LANGUAGE_ID'] = LANGUAGE_ID;\n\t\t// if there are two or more caches with the same id, but with different cache_time, make them separate\n\t\t$cacheId['CACHE_TIME'] = intval($this->arResult['CACHE_TIME']);\n\n\t\tif(defined(\"SITE_TEMPLATE_ID\"))\n\t\t\t$cacheId['SITE_TEMPLATE_ID'] = SITE_TEMPLATE_ID;\n\n\t\treturn implode('|', $cacheId);\n\t}", "protected function cacheKey()\n {\n return json_encode($this);\n }", "public function getItemName();", "public function getCacheId()\n {\n return md5(serialize($this->params));\n }", "private function _getCachePath() {\n return DIR_PUBLIC_CACHE_SEARCHES . $this->_id . '.json';\n }", "private function getCacheKey($url) {\n\t\treturn 'amo_api_' . md5($url);\n\t}", "public function setCacheKey($var)\n {\n GPBUtil::checkString($var, True);\n $this->CacheKey = $var;\n\n return $this;\n }", "public function getCalculationsCacheKeyAttribute()\n {\n return 'shop_' . $this->table . '_' . $this->attributes['id'] . '_calculations';\n }", "public function getCacheKey($key)\r\n {\r\n\t\treturn self::CACHE_KEY_PREFIX .\r\n\t\t\tstrtolower($this->getName()) . '_' . $key;\r\n }", "public function cacheNameSuffix (Request $request): string {\n\t\t$sortCached = rand(1,20);\n\t\t$rootSuffix = $request->getHost() .'.'. $sortCached;\n\t\tif (Auth::check()) {\n\t\t\treturn $rootSuffix . Auth::user()->id;\n\t\t}\n\t\treturn $rootSuffix;\n\t}", "protected function _renumber_cache_prefix() {\n\t $editionId = Hash::get($this->request->getQueryParams(), 'edition', null);\n\t\treturn $this->contextUser()->artistId() . '-' . $editionId;\n\t}", "private function getTableCacheKey(){\n return $this->dataCacheKeyPrefix .'.' . strtoupper($this->table);\n }", "protected function _getAssetName()\n\t{\n\t\t$k = $this->_tbl_key;\n\n\t\treturn 'com_labgenevet.clinic.' . (int) $this->$k;\n\t}", "public function get($cache_name);", "function cacheKey( $key )\n\t{\n\t\treturn $key.\"_\".MANUFACTURER_ID.getFirstSubDomain();\n\t}", "protected function _getAssetName()\n\t{\n\t\t$k = $this->_tbl_key;\n\n\t\treturn 'com_content.article.' . (int) $this->$k;\n\t}", "public function get_cache_filename($url)\n {\n }", "protected function _getAssetName()\n\t{\n\t\t$k = $this->_tbl_key;\n\t\treturn 'com_groups.group.' . (int) $this->$k;\n\t}", "function getCacheFileName($eventData)\n {\n global $serendipity;\n\n if (!isset($eventData['email']) && !isset($eventData['email_md5']) && !isset($eventData['url'])) {\n return null;\n }\n $email_md5 = '';\n if (isset($eventData['email_md5'])) {\n $email_md5 = $eventData['email_md5'];\n }\n else if (isset($eventData['email'])) {\n $email_md5 = md5(strtolower($eventData['email']));\n }\n\n $author_md5= isset($eventData['author'])? md5($eventData['author']) : '';\n $url_md5 = isset($eventData['url'])? md5($eventData['url']) : '' ;\n\n return $url_md5 . '_' . $email_md5 . '_' . $author_md5;\n }", "public function getCookieName()\n {\n return Mage::helper('fastlycdn')->generateCookieName(\n Fastly_CDN_Model_Esi_Tag_Reports_Product_Viewed::COOKIE_NAME\n );\n }", "protected function getCacheName($name) {\n $name = strtolower($name);\n $name = trim($name);\n $name = urlencode($name);\n if (strlen($name) < 3) {\n return implode('/', str_split($name, 1)) . '.json';\n }\n return substr($name, 0, 1) . '/' . substr($name, 1, 1) . '/' . substr($name, 2, 1) . '/' . substr($name, 3) . '.json';\n }", "private static function getCacheKeyName($key = null, $options = array())\n\t{\n\t\t$cacheKey = $key;\n\n\t\t//If no key was passed in\n\t\tif(is_null($cacheKey))\n\t\t{\n\t\t\t$cacheKey = strtolower(get_called_class());\n\t\t}\n\n\t\t//If a user id was passed in the options, add it to the key name\n\t\tif(isset($options['user_id']))\n\t\t{\n\t\t\t$options['user_id'] = $options['user_id']*1;\n\t\t\t$cacheKey = $cacheKey.'-'.hash(Config::get('constants.default_hash_algorithm'), json_encode($options));\n\t\t}\n\n\t\treturn $cacheKey;\n\t}", "public function getItemName() {\n return $this->itemName;\n }", "public function label()\n\t{\n\t\treturn __('Redis', 'xlii-cache');\n\t}", "protected function calculateCacheKey()\n {\n if ($this->_cacheKey === null) {\n $key = [__CLASS__, Yii::$app->requestedRoute];\n if (is_array($this->variations)) {\n foreach ($this->variations as $value) {\n $key[] = $value;\n }\n }\n $this->_cacheKey = $key;\n }\n \n return $this->_cacheKey;\n }", "public function getCacheId()\n {\n return sha1($_SERVER['QUERY_STRING'] . ':' . (int) $this->acceptsGzip());\n }", "public static function getCacheKey($scope, $name)\n {\n if (empty(self::$cacheStorage)) {\n return;\n }\n\n if (empty($scope) || empty($name)) {\n return;\n }\n\n // Check if this variable is suitable for caching\n if (!(self::checkCachingRules($scope, $name))) {\n return;\n }\n\n // CHECKME: use cacheCode and/or namespace instead ?\n // Answer: unlike for output caching, no external factors should influence this (user, theme, locale, url params, ...)\n //self::$cacheCode = md5($factors);\n //self::$cacheStorage->setCode(self::$cacheCode);\n // CHECKME: what about variable scope and/or name that isn't OS compliant ?\n // Answer: this must be handled by the cacheStorage if necessary\n // cache storage typically only works with a single cache namespace, so we add our own scope prefix here\n // Note: the cacheStorage may add its own namespace internally to take into account the host, site, ...\n return $scope.':'.$name;\n }", "public function CacheFileName()\n {\n $parts = pathinfo($this->pathToImage);\n $this->fileExtension = $parts['extension'];\n $this->saveAs = is_null($this->saveAs) ? $this->fileExtension : $this->saveAs;\n $quality_ = is_null($this->quality) ? null : \"_q{$this->quality}\";\n $cropToFit_ = is_null($this->cropToFit) ? null : \"_cf\";\n $sharpen_ = is_null($this->sharpen) ? null : \"_s\";\n $dirName = preg_replace('/\\//', '-', dirname($this->src));\n $cacheFileName = CACHE_PATH . \"-{$dirName}-{$parts['filename']}_{$this->newWidth}_{$this->newHeight}{$quality_}{$cropToFit_}{$sharpen_}.{$this->saveAs}\";\n $cacheFileName = preg_replace('/^a-zA-Z0-9\\.-_/', '', $cacheFileName);\n\n if($this->verbose) { self::verbose(\"Cache file is: {$cacheFileName}\"); }\n return $cacheFileName;\n }", "protected function getCacheVersionKey(): string\n {\n return $this->prefix.'.version';\n }", "public function getCache(): string\n {\n return $this->cache;\n }", "public function generateCacheKey() {\n $key = array(\n 'connection' => $this->connection->getName(),\n 'collection' => $this->collection->getName(),\n 'wheres' => $this->wheres,\n 'columns' => $this->columns,\n 'groups' => $this->groups,\n 'orders' => $this->orders,\n 'offset' => $this->offset,\n 'aggregate' => $this->aggregate,\n );\n\n return md5(serialize(array_values($key)));\n }", "public function getCacheFilename($uri)\n {\n return $this->getDirectory() . DIRECTORY_SEPARATOR . md5(serialize($uri)) . '.cache';\n }", "protected function _getAssetName()\n {\n $k = $this->_tbl_key;\n return 'com_svglink.message.' . (int)$this->$k;\n }", "private function getCacheId($prefix = 'minify') {\n $md5 = md5($this->filepath);\n return \"{$prefix}_less_{$md5}\";\n }", "public function getCachePathString()\n\t{\n\t\treturn \"rs-\".$this->_maxWidth.\"-\".$this->_maxHeight.\"-\".$this->_maintainAspectRatio.\"-\".$this->_scaleUp;\n\t}", "protected function getCacheFile(){\n\t\treturn $this->getPath() . $this->getCacheName();\n\t}", "public function getItemName() : ItemName\n\t{\n\t\treturn $this->itemName;\n\t}", "public function get_name() {\n\t\treturn 'ih_elementor_list_item';\n\t}", "public function getCacheActionsName () {\n return $this->cacheActionsName; \n }", "protected function _getAssetName()\n\t{\n\t\t$k = $this->_tbl_key;\n\n\t\treturn 'com_hecmailing.message.' . (int) $this->$k;\n\t}" ]
[ "0.7451736", "0.7366291", "0.72203255", "0.71150684", "0.70588547", "0.70418394", "0.699582", "0.69731706", "0.69584334", "0.6934476", "0.6910383", "0.6909009", "0.6880617", "0.68594784", "0.67945385", "0.6749157", "0.6722326", "0.6696027", "0.6692169", "0.6685893", "0.6669904", "0.6662813", "0.6643766", "0.6591973", "0.65578306", "0.65393007", "0.642854", "0.642854", "0.6383514", "0.6375974", "0.6367451", "0.63246703", "0.62984586", "0.6285701", "0.62815773", "0.62677217", "0.62647796", "0.62514627", "0.62198925", "0.62198925", "0.621521", "0.6211735", "0.6176432", "0.6165142", "0.61480117", "0.6146984", "0.613996", "0.6116579", "0.6113368", "0.6111914", "0.610213", "0.60987693", "0.6094396", "0.6058215", "0.6055898", "0.605053", "0.60433555", "0.60192007", "0.59998333", "0.59973717", "0.5930536", "0.59186786", "0.59167403", "0.5914347", "0.58911765", "0.5877566", "0.5877048", "0.5873821", "0.58626795", "0.5862397", "0.5849768", "0.5846807", "0.5828136", "0.5823792", "0.5823143", "0.5821449", "0.58213747", "0.5811108", "0.58049095", "0.58039325", "0.5800329", "0.5796981", "0.579221", "0.5792088", "0.57850945", "0.57715255", "0.5770623", "0.57693636", "0.576788", "0.57668424", "0.5756713", "0.57506096", "0.57500684", "0.57485646", "0.57371", "0.5725582", "0.57104075", "0.57097155", "0.569948", "0.569641" ]
0.7475258
0
The cache type of the item, such as the class name or something else.
public static function getCacheType();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCacheType(): string\n\t{\n\t\treturn $this->cacheType;\n\t}", "static protected function discoverCacheType()\n\t{\n\t\t$cache_config = Config::getInstance()->getConfig( 'cache' );\n\n\t\tif ( true !== $cache_config['active'] || !isset( $cache_config['client'] ) )\n\t\t{\n\t\t\treturn self::CACHE_TYPE_DISK;\n\t\t}\n\n\t\tif ( 'Memcached' === $cache_config['client'] )\n\t\t{\n\t\t\treturn self::CACHE_TYPE_MEMCACHED;\n\t\t}\n\n\t\tif ( 'Memcache' === $cache_config['client'] )\n\t\t{\n\t\t\treturn self::CACHE_TYPE_MEMCACHE;\n\t\t}\n\n\t\treturn 'unknown';\n\t}", "function wp_get_cache_type() {\n\tglobal $_wp_using_ext_object_cache, $wp_object_cache;\n\n\tif ( ! empty( $_wp_using_ext_object_cache ) ) {\n\t\t// Test for Memcached PECL extension memcached object cache (https://github.com/tollmanz/wordpress-memcached-backend)\n\t\tif ( isset( $wp_object_cache->m ) && is_a( $wp_object_cache->m, 'Memcached' ) ) {\n\t\t\t$message = 'Memcached';\n\n\t\t// Test for Memcache PECL extension memcached object cache (http://wordpress.org/extend/plugins/memcached/)\n\t\t} elseif ( isset( $wp_object_cache->mc ) ) {\n\t\t\t$is_memcache = true;\n\t\t\tforeach ( $wp_object_cache->mc as $bucket ) {\n\t\t\t\tif ( ! is_a( $bucket, 'Memcache' ) )\n\t\t\t\t\t$is_memcache = false;\n\t\t\t}\n\n\t\t\tif ( $is_memcache )\n\t\t\t\t$message = 'Memcache';\n\n\t\t// Test for Xcache object cache (http://plugins.svn.wordpress.org/xcache/trunk/object-cache.php)\n\t\t} elseif ( is_a( $wp_object_cache, 'XCache_Object_Cache' ) ) {\n\t\t\t$message = 'Xcache';\n\n\t\t// Test for WinCache object cache (http://wordpress.org/extend/plugins/wincache-object-cache-backend/)\n\t\t} elseif ( class_exists( 'WinCache_Object_Cache' ) ) {\n\t\t\t$message = 'WinCache';\n\n\t\t// Test for APC object cache (http://wordpress.org/extend/plugins/apc/)\n\t\t} elseif ( class_exists( 'APC_Object_Cache' ) ) {\n\t\t\t$message = 'APC';\n\n\t\t// Test for Redis Object Cache (https://github.com/alleyinteractive/wp-redis)\n\t\t} elseif ( isset( $wp_object_cache->redis ) && is_a( $wp_object_cache->redis, 'Redis' ) ) {\n\t\t\t$message = 'Redis';\n\n\t\t} else {\n\t\t\t$message = 'Unknown';\n\t\t}\n\t} else {\n\t\t$message = 'Default';\n\t}\n\treturn $message;\n}", "abstract protected function getCacheClass();", "public function getTypeOfItem()\n {\n return $this->type;\n }", "public function type(): string\n {\n return $this->item['type'];\n }", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "public function get_type() {\n\t\treturn isset( $this->item['type'] ) ? esc_attr( $this->item['type'] ) : false;\n\t}", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType() {\n\t\treturn self::DEBUG_ITEM_MEMORY_USAGE_MILESTONE;\n\t}", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "public function getType() {\n\t\treturn self::$_type;\n\t}", "public function meta_type()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}", "public function get_type();", "private function get_type(){\n\t\treturn $this->_type;\n\t}", "function getType() {\n\t\treturn $this->_type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->get('type');\n\t}", "public function type()\n {\n return $this->_type;\n }", "private function get_type() {\n\n\t}", "public function type() {\n\t\t\treturn $this->_type;\n\t\t}", "function getType() { \n\t\treturn $this->_type; \n\t}", "public function get_type(){\n\t\treturn $this->_type;\n\t}", "protected function _getItemType()\n {\n return $this->getItemType()\n ? $this->getItemType()\n : $this->getConfig()->getDefaultItemType($this->getStoreId());\n }", "public function getType()\n {\n return $this->metadata->type;\n }", "function getType () {\n\t\treturn $this->type;\n\t}", "function getType() {\n\t\treturn $this->_Type;\n\t}", "function getType() { return $this->_type; }", "public function get_type() {\n\t\treturn $this->type;\n\t}", "function type () {\r\n return $this->_type;\r\n }", "public function getType()\n\t{\n\t\treturn $this->_type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->_type;\n\t}", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "public function type()\n {\n return $this->type;\n }", "public function type()\n {\n return $this->type;\n }", "public function type()\n {\n return $this->type;\n }", "protected function get_meta_type() {\n\t\tif ( $current_filter = current_filter() ) {\n\t\t\treturn papi_get_meta_type( explode( '_', $current_filter )[1] );\n\t\t}\n\n\t\treturn papi_get_meta_type();\n\t}", "public function get_type() {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "function getType() {\n\t\treturn $this->type;\n\t}", "final protected function get_type() {\n return $this->type;\n }", "public function getType()\n {\n\t\treturn $this->rules->getFirstItem()->getType();\n\t}", "public function getType()\r\n {\r\n return $this->_type;\r\n }", "public function getType() {\n return $this->_type;\n }", "public function getType() {\n return $this->_type;\n }", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function type()\n {\n return $this->session->get('izime.type');\n }", "public function meta_type();", "public function getType()\n {\n return parent::getValue('type');\n }", "public function getType()\r\n {\r\n return $this->m_type;\r\n }", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getType()\n\t\t{\n\t\t\treturn $this->type;\n\t\t}", "public function get_type() {\n return $this->type;\n }", "public function getType()\n {\n return $this->getProperty('type');\n }", "public function getType()\n { return $this->get('type'); }", "public function getType() \n {\n return $this->_type;\n }", "public function getType()\n {\n\treturn $this->type;\n }", "public function get_type(): string {\n\t\treturn $this->type;\n\t}", "function getType()\n {\n return $this->getAttribute(\"type\");\n }", "public function getType() {\n return $this->shareData[\"type\"];\n }", "public function getType()\n\t{\n\t\treturn $this->getObject('type', null, 'type');\n\t}", "public function getType()\n {\n return $this->_Type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }" ]
[ "0.8212201", "0.7347926", "0.7108819", "0.6658575", "0.6586114", "0.654358", "0.6515891", "0.6465846", "0.63899", "0.63899", "0.63899", "0.63899", "0.63899", "0.63899", "0.63899", "0.63899", "0.63899", "0.63899", "0.6388832", "0.6388832", "0.6388832", "0.6369468", "0.6360707", "0.63335055", "0.6331367", "0.62953395", "0.62813455", "0.62708056", "0.62530357", "0.6252795", "0.6251135", "0.6238152", "0.6221553", "0.6206287", "0.6205777", "0.6203245", "0.61926025", "0.61807364", "0.6179818", "0.6179141", "0.61751", "0.6161466", "0.6161466", "0.61614424", "0.61614424", "0.61501175", "0.61501175", "0.61501175", "0.61475974", "0.61417305", "0.6135286", "0.6135286", "0.6135286", "0.6135286", "0.6135286", "0.6135286", "0.6135286", "0.6132658", "0.6123319", "0.6116927", "0.61114883", "0.6107436", "0.6107436", "0.6104783", "0.6104783", "0.6104783", "0.6104783", "0.61023915", "0.6102073", "0.6088501", "0.6086668", "0.6080191", "0.6080191", "0.6080191", "0.6080191", "0.6080191", "0.6080191", "0.6080191", "0.6080191", "0.6080191", "0.6080191", "0.6080191", "0.6080191", "0.6073622", "0.60722816", "0.60722345", "0.6070511", "0.6066713", "0.6060644", "0.60569865", "0.60450745", "0.603779", "0.60314405", "0.6028588", "0.6023818", "0.6023818", "0.6023818", "0.6023818", "0.6023818", "0.6023818" ]
0.8111389
1
Set stack trace for this span
public function addStacktrace(Stacktrace $stacktrace) { $this->stacktrace[] = $stacktrace; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setThrowable(\\Throwable $exception) : void\n {\n $this->exception = null;\n $this->throwable = $exception;\n }", "public function getColorfulText()\n {\n $output = \"\\033[1;31m--[ Agile Toolkit Exception ]---------------------------\\n\";\n $output .= get_class($this).\": \\033[47m\".$this->getMessage().\"\\033[0;31m\".\n ($this->getCode() ? ' [code: '.$this->getCode().']' : '');\n\n foreach ($this->params as $key => $val) {\n $key = str_pad($key, 19, ' ', STR_PAD_LEFT);\n $output .= \"\\n\".$key.': '.$this->toString($val);\n }\n\n $output .= \"\\n\\033[0mStack Trace: \";\n\n $in_atk = true;\n $escape_frame = false;\n\n foreach ($this->getMyTrace() as $call) {\n if (!isset($call['file'])) {\n $call['file'] = '';\n } elseif (\n $in_atk &&\n strpos($call['file'], '/data/src/') === false &&\n strpos($call['file'], '/core/src/') === false &&\n strpos($call['file'], '/dsql/src/') === false\n ) {\n $escape_frame = true;\n $in_atk = false;\n }\n\n $file = str_pad(substr($call['file'], -40), 40, ' ', STR_PAD_LEFT);\n\n $line = str_pad(@$call['line'], 4, ' ', STR_PAD_LEFT);\n\n $output .= \"\\n\\033[0;34m\".$file.\"\\033[0m\";\n $output .= \":\\033[0;31m\".$line.\"\\033[0m\";\n\n if (isset($call['object'])) {\n $name = (!isset($call['object']->name)) ? get_class($call['object']) : $call['object']->name;\n $output .= \" - \\033[0;32m\".$name.\"\\033[0m\";\n }\n\n $output .= \" \\033[0;32m\";\n\n if (isset($call['class'])) {\n $output .= $call['class'].'::';\n }\n\n if ($escape_frame) {\n $output .= \"\\033[0,31m\".$call['function'];\n $escape_frame = false;\n\n $args = [];\n foreach ($call['args'] as $arg) {\n $args[] = $this->toString($arg);\n }\n\n $output .= \"\\n\".str_repeat(' ', 20).\"\\033[0,31m(\".implode(', ', $args);\n } else {\n $output .= \"\\033[0,33m\".$call['function'].'(';\n }\n\n $output .= ')';\n }\n\n if ($p = $this->getPrevious()) {\n $output .= \"\\n\\033[0mCaused by Previous Exception:\\n\";\n $output .= \"\\033[1;31m\".get_class($p).': '.$p->getMessage().\"\\033[0;31m\".\n ($p->getCode() ? ' [code: '.$p->getCode().']' : '');\n }\n\n // next print params\n\n $output .= \"\\n\\033[1;31m--------------------------------------------------------\\n\";\n\n return $output.\"\\033[0m\";\n }", "abstract public function wrapStackTrace($html, $title);", "public function setException(Throwable $exception) {\n $this->exception= $exception;\n }", "public function stacktrace() {\n\n if ( true === WP_DEBUG ) {\n\n $e = new \\Exception;\n $this->log( $e->getTraceAsString() );\n }\n }", "public function setTrace($cat) {\n $this->cat= $cat;\n }", "public function setTrace($cat) {\n $this->cat= $cat;\n }", "public function setBacktraceRenderer(\\Closure $backtraceRenderer);", "public function addStacktraces(array $stacktraces)\n {\n $this->stacktrace = $stacktraces;\n }", "public function setError($error, $line=-1) {\n \t$debug = debug_backtrace();\n \t$caller = next($debug);\n \t$this->error = sprintf('[%s::%s - %s] %s', basename($caller['file']), $caller['function'], ($line > 0) ? $line : $caller['line'], $error);\n }", "public function setCallStackLimit(int $limit): void {\n\n\t\tif ($limit < 0) {\n\t\t\tthrow new EngineError('Callstack limit must be positive or zero');\n\t\t}\n\n\t\t$this->callStackLimit = $limit;\n\n\t}", "public static function addBackTrace($type = 2){\r\n\t}", "private function _err($trace) {\n\t\t\t$this->error_count++;\n\t\t\ttrigger_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t'The method <code>%1$s()</code> cannot be chained in <b>%2$s</b> on line <b>%3$s</b>. Error triggered',\n\t\t\t\t\t$trace[0]['function'],\n\t\t\t\t\t$trace[0]['file'],\n\t\t\t\t\t$trace[0]['line']\n\t\t\t\t),\n\t\t\t\tE_USER_NOTICE\n\t\t\t);\n\t\t}", "public function getStacktrace()\n {\n return $this->stacktrace;\n }", "public static function setTraceIssues(?string $level): void\n {\n self::$trace_issues = \\is_string($level) ? \\strtolower($level) : null;\n }", "public function addStackFrame(\\google\\tracing\\v1\\StackTrace\\StackFrame $value){\n return $this->_add(1, $value);\n }", "public function init_trace()\n {\n }", "public function setError($error) {\n \t$dbg = debug_backtrace();\n $caller = next($dbg);\n \t$this->error = sprintf('[%s::%s - %s] %s', basename($caller['file']), $caller['function'], $caller['line'], $error);\n }", "function captureException(Th $t, array $data):void {\n\t\t$tOriginal = $t; /** @var Th $tOriginal */\n\t\tdo {\n\t\t\t$isDFE = $t instanceof DFE; /** @var bool $isDFE */\n\t\t\t$dataI = [\n\t\t\t\t'type' => $isDFE ? $t->sentryType() : get_class($t)\n\t\t\t\t,'value' => $this->serializer->serialize(df_xtsd($t))\n\t\t\t];\n\t\t\t$trace = $t->getTrace();\n\t\t\t$needAddCurrentFrame = !self::needSkipFrame($trace[0]); /** @var bool $needAddCurrentFrame */\n\t\t\twhile (self::needSkipFrame($trace[0])) {\n\t\t\t\tarray_shift($trace);\n\t\t\t}\n\t\t\tif ($needAddCurrentFrame) {\n\t\t\t\tarray_unshift($trace, ['file' => $t->getFile(), 'line' => $t->getLine()]);\n\t\t\t}\n\t\t\t$dataI['stacktrace'] = ['frames' => Trace::info($trace)];\n\t\t\t$exceptions[] = $dataI;\n\t\t} while ($t = $t->getPrevious());\n\t\t$data['exception'] = ['values' => array_reverse($exceptions)];\n\t\tif (empty($data['level'])) {\n\t\t\tif (method_exists($tOriginal, 'getSeverity')) {\n\t\t\t\t/** 2020-06-28 @uses \\ErrorException::getSeverity() */\n\t\t\t\t$data['level'] = $this->translateSeverity($tOriginal->getSeverity());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$data['level'] = self::ERROR;\n\t\t\t}\n\t\t}\n\t\t$this->capture($data, $trace);\n\t}", "public function setException(Exception $e)\r\n {\r\n \r\n $result = new Blerby_TestRunner_Result();\r\n \r\n $trace = $e->getTrace();\r\n \r\n if (isset($trace[0]['args'][0])) {\r\n $file = $trace[0]['args'][0];\r\n \r\n } else {\r\n $file = Blerby_TestRunner_Util::cleanPath($e->getFile()); \r\n }\r\n \r\n $result->set('status',Blerby_TestRunner_Status::ERROR);\r\n $result->set('file',Blerby_TestRunner_Util::cleanPath($file));\r\n $result->set(\"message\",$e->getMessage());\r\n \r\n preg_match(\"/on line ([0-9]+)/\",$result->get(\"message\"),$matches);\r\n \r\n if (isset($matches[1])) {\r\n \r\n $result->set('line',$matches[1]);\r\n } else {\r\n $result->set('line',\"???\");\r\n }\r\n \r\n $this->addResult($file,$result);\r\n }", "public function setThrowException($value)\n {\n $this->provider->throwExceptionInError = $value;\n }", "public function trace()\n {\n if (!$this->cfg['collect']) {\n return;\n }\n $args = \\func_get_args();\n $meta = $this->internal->getMetaVals(\n $args,\n array(\n 'caption' => 'trace',\n 'channel' => $this->cfg['channelName'],\n 'columns' => array('file','line','function'),\n )\n );\n $backtrace = $this->errorHandler->backtrace();\n // toss \"internal\" frames\n for ($i = 1, $count = \\count($backtrace)-1; $i < $count; $i++) {\n $frame = $backtrace[$i];\n $function = isset($frame['function']) ? $frame['function'] : '';\n if (!\\preg_match('/^'.\\preg_quote(__CLASS__).'(::|->)/', $function)) {\n break;\n }\n }\n $backtrace = \\array_slice($backtrace, $i-1);\n // keep the calling file & line, but toss ->trace or ::_trace\n unset($backtrace[0]['function']);\n $this->appendLog('trace', array($backtrace), $meta);\n }", "public function trace($message)\n {\n }", "public function getHTMLText()\n {\n $output = \"--[ Agile Toolkit Exception ]---------------------------\\n\";\n $output .= get_class($this).\": <font color='pink'><b>\".$this->getMessage().'</b></font>'.\n ($this->getCode() ? ' [code: '.$this->getCode().']' : '');\n\n foreach ($this->params as $key => $val) {\n $key = str_pad($key, 19, ' ', STR_PAD_LEFT);\n $output .= \"\\n\".$key.': '.$this->toString($val);\n }\n\n $output .= \"\\nStack Trace: \";\n\n $in_atk = true;\n $escape_frame = false;\n\n foreach ($this->getMyTrace() as $call) {\n if (!isset($call['file'])) {\n $call['file'] = '';\n } elseif (\n $in_atk &&\n strpos($call['file'], '/data/src/') === false &&\n strpos($call['file'], '/core/src/') === false &&\n strpos($call['file'], '/dsql/src/') === false\n ) {\n $escape_frame = true;\n $in_atk = false;\n }\n\n $file = str_pad(substr($call['file'], -40), 40, ' ', STR_PAD_LEFT);\n\n $line = str_pad(@$call['line'], 4, ' ', STR_PAD_LEFT);\n\n $output .= \"\\n<font color='cyan'>\".$file.'</font>';\n $output .= \":<font color='pink'>\".$line.'</font>';\n\n if (isset($call['object'])) {\n $name = (!isset($call['object']->name)) ? get_class($call['object']) : $call['object']->name;\n $output .= \" - <font color='yellow'>\".$name.'</font>';\n }\n\n $output .= \" <font color='gray'>\";\n\n if (isset($call['class'])) {\n $output .= $call['class'].'::';\n }\n $output .= '</font>';\n\n if ($escape_frame) {\n $output .= \"<font color='pink'>\".$call['function'].'</font>';\n $escape_frame = false;\n\n $args = [];\n foreach ($call['args'] as $arg) {\n $args[] = $this->toString($arg);\n }\n\n $output .= \"\\n\".str_repeat(' ', 20).\"<font color='pink'>(\".implode(', ', $args);\n } else {\n $output .= \"<font color='gray'>\".$call['function'].'(';\n }\n\n $output .= ')</font>';\n }\n\n if ($p = $this->getPrevious()) {\n $output .= \"\\n\\nCaused by Previous Exception:\\n\";\n $output .= get_class($p).\": <font color='pink'>\".$p->getMessage().'</font>'.\n ($p->getCode() ? ' [code: '.$p->getCode().']' : '');\n }\n\n // next print params\n\n $output .= \"\\n--------------------------------------------------------\\n\";\n\n return $output;\n }", "public function setErrorFromException(\\Exception $exception)\n {\n $this->error = $exception->__toString();\n }", "public function profilingCollectBacktrace($value): self\n {\n $this->profilingCollectBacktrace = $value;\n \n return $this;\n }", "public static function setException($v)\n {\n self::$exception = $v;\n }", "function trace(SpanInterface $span, Closure $closure, iterable $args = [])\n{\n $s = $span;\n $c = $closure;\n $a = $args;\n unset($span, $closure, $args);\n\n $scope = $s->activate();\n\n try {\n /** @psalm-suppress InvalidArgument */\n return $c(...$a, ...($a = []));\n } catch (Throwable $e) {\n $s->setStatus(StatusCode::STATUS_ERROR, $e->getMessage());\n $s->recordException($e, ['exception.escaped' => true]);\n\n throw $e;\n } finally {\n $scope->detach();\n $s->end();\n }\n}", "public function setException($exception)\n {\n $this->exception = $exception;\n }", "function exception_handler($exception)\r\n{\r\n?>\r\n<script type=\"text/javascript\">\r\nfunction toggleLayer( whichLayer )\r\n{\r\n var elem;\r\n if( document.getElementById ) elem = document.getElementById( whichLayer );\r\n else if( document.all ) elem = document.all[whichLayer];\r\n else if( document.layers ) elem = document.layers[whichLayer];\r\n if(elem.style.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined) elem.style.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';\r\n elem.style.display = (elem.style.display==''||elem.style.display=='block')?'none':'block';\r\n}\r\n</script>\r\n<?php\r\n echo \"<pre>\";\r\n $tolog=\"\";\r\n $stacktrace=\"\";\r\n $stacktrace.=\"Application raised an exception class <b>\".get_class($exception).\"</b> with message <b>'\".$exception->getMessage().\"'</b>\\n\";\r\n $msg=strip_tags($stacktrace).\"|\";\r\n $stack=array_reverse($exception->getTrace());\r\n reset($stack);\r\n $tab=\"\";\r\n $c=\"\";\r\n $stacktrace.='<a href=\"javascript:toggleLayer(\\'callstack\\');\">Click for detailed information</a><div id=\"callstack\" style=\"display:none;\">';\r\n while (list($k,$v)=each($stack))\r\n {\r\n $stacktrace.=$tab.$c.\"Callstack #$k File: <b><A HREF=\\\"rphp://$v[file],$v[line]\\\">\".$v['file'].\"</A></b> Line: <b>\".$v['line'].\"</b>\\n\";\r\n $tolog.=$v['line'].\"@\".$v['file'].'@'.$msg;\r\n $tab.=\" \";\r\n $c=\"|_\";\r\n }\r\n echo $stacktrace;\r\n echo '</div>';\r\n echo \"</pre>\";\r\n error_log($tolog);\r\n}", "protected function setErrorClassAttribute() {}", "public function setException(bool $shouldThrow = true, \\Exception $exception = null) :void{\n\t\t$this->shouldThrow = $shouldThrow;\n\t\t$this->exceptionToThrow = $exception;\n\t}", "protected function getDebugBacktrace() {}", "protected function updateLastTrace() {\n $this->last_trace = time();\n }", "public function setTraceLevel($value): static\n\t{\n\t\tPrado::getLogger()->setTraceLevel(TPropertyValue::ensureInteger($value));\n\n\t\treturn $this;\n\t}", "private function setError($value) {\r\n $this->debug('setError() was called with value: ' . $value);\r\n $this->error = $value;\r\n }", "protected static function renderStackTrace(array $stackTrace)\n {\n $render = \"\";\n $num = count($stackTrace) - 1;\n $numLength = strlen($num);\n\n foreach ($stackTrace as $event) {\n $funcName = array_key_exists(\"class\", $event) ? \"{$event['class']}{$event['type']}{$event['function']}\" : \"{$event['function']}\";\n $file = array_key_exists(\"file\", $event) ? $event['file'] : \"-\";\n $line = array_key_exists(\"line\", $event) ? $event['line'] : \"-\";\n $rawArgs = array_key_exists(\"args\", $event) ? $event['args'] : array();\n $args = array();\n\n foreach ($rawArgs as $k => $arg) {\n $args[$k] = \"object\" == gettype($arg) ? get_class($arg) : gettype($arg);\n }\n\n $args = implode(\", \", $args);\n $numString = str_pad($num, $numLength, \"0\", STR_PAD_LEFT);\n $funcName = \"<strong>$funcName(</strong><em>$args</em><strong>)</strong>\";\n $render .= \"#$numString $funcName\\n\";\n $render .= \" <strong>File :</strong> $file\\n\";\n $render .= \" <strong>Line :</strong> $line\\n\";\n $num--;\n }\n\n $html = \"<span class='debugToggleStackTrace' title='Show/hide stack trace'>Stack trace</span> \";\n $html .= \"<span class='debugToggleIndicator'>&rtrif;</span>\";\n $html .= \"<span class='debugStackTraceDetails'>\\n\\n$render</span>\";\n return $html;\n }", "public final function fillInStackTrace() {\n return null;\n }", "public function setException($err) {\n $this->exception = $err;\n }", "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}", "function trace_log()\n {\n $messages = func_get_args();\n\n foreach ($messages as $message) {\n $level = 'info';\n\n if ($message instanceof Exception) {\n $level = 'error';\n }\n elseif (is_array($message) || is_object($message)) {\n $message = print_r($message, true);\n }\n\n Log::$level($message);\n }\n }", "public function setException(\\TYPO3\\Flow\\Mvc\\Controller\\Exception $exception) {\n\t\t$this->exception = $exception;\n\t}", "private function formatStackTrace($trace)/*{{{*/\n {\n // remove the first 2 entries in the array as they \n // refer to this file and the base.class.php that\n // called it\n $junk=array_shift($trace);\n $junk=array_shift($trace);\n $caller=array_shift($trace);\n $op=\"\";\n if($this->tracelevel>-1){\n if(isset($caller[\"function\"])){\n $op=\"In: \" . $caller[\"function\"];\n if(isset($caller[\"class\"]) && strlen($caller[\"class\"])){\n $op.=\" in class: \" . $caller[\"class\"];\n }\n $op.=\" Line: \" . $caller[\"line\"];\n $op.=\" file: \" . $caller[\"file\"] . PHP_EOL;\n $cn=count($trace);\n if($cn && $this->tracelevel>1){\n foreach($trace as $k=>$v){\n if(isset($v[\"class\"])){\n $op.=\" func: \" . $v[\"function\"] . \" class: \" . $v[\"class\"] . \" line: \" . $v[\"line\"] . \" file: \" . $v[\"file\"] . PHP_EOL;\n }else{\n $op.=\" func: \" . $v[\"function\"] . \" line: \" . $v[\"line\"] . \" file: \" . $v[\"file\"] . PHP_EOL;\n }\n }\n }\n }\n }\n return $op;\n }", "private function jTraceEx($exception, $seen = null)\n\t{\n\t\t$starter = ($seen) ? 'Caused by: ' : '';\n\t\t$result = array();\n\n\t\tif (!$seen) $seen = array();\n\n\t\t$trace = $exception->getTrace();\n\t\t$prev = $exception->getPrevious();\n\n\t\t$result[] = sprintf('%s%s: %s', $starter, get_class($exception), $exception->getMessage());\n\n\t\t$file = $exception->getFile();\n\t\t$line = $exception->getLine();\n\n\t\twhile (true) {\n\t\t\t$current = \"$file:$line\";\n\t\t\tif (is_array($seen) && in_array($current, $seen)) {\n\t\t\t\t$result[] = sprintf(' ... %d more', count($trace) + 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$result[] = sprintf(' at %s%s%s(%s%s%s)',\n\t\t\t\tcount($trace) && array_key_exists('class', $trace[0]) ? str_replace('\\\\', '.', $trace[0]['class']) : '',\n\t\t\t\tcount($trace) && array_key_exists('class', $trace[0]) && array_key_exists('function', $trace[0]) ? '.' : '',\n\t\t\t\tcount($trace) && array_key_exists('function', $trace[0]) ? str_replace('\\\\', '.', $trace[0]['function']) : '(main)',\n\t\t\t\t($line === null) ? $file : basename($file),\n\t\t\t\t($line === null) ? '' : ':',\n\t\t\t\t($line === null) ? '' : $line);\n\t\t\tif (is_array($seen))\n\t\t\t\t$seen[] = \"$file:$line\";\n\t\t\tif (!count($trace))\n\t\t\t\tbreak;\n\t\t\t$file = array_key_exists('file', $trace[0]) ? $trace[0]['file'] : 'Unknown Source';\n\t\t\t$line = (array_key_exists('file', $trace[0]) && array_key_exists('line', $trace[0]) && $trace[0]['line']) ? $trace[0]['line'] : null;\n\t\t\tarray_shift($trace);\n\t\t}\n\n\t\t$result = join(\"\\n\", $result);\n\n\t\tif ($prev)\n\t\t\t$result .= \"\\n\" . $this->jTraceEx($prev, $seen);\n\n\t\treturn $result;\n\t}", "protected function returnStackTrace() {\n\t\ttry {\n\t\t\tthrow new \\Exception();\n\t\t} catch (\\Exception $e) {\n\t\t\treturn $e->getTrace();\n\t\t}\n\t}", "public function setTrace(bool $trace): void\n {\n if ($this->tracer !== null) {\n $this->removeParseListener($this->tracer);\n }\n\n if ($trace) {\n $this->tracer = new ParserTraceListener($this);\n $this->addParseListener($this->tracer);\n }\n }", "public static function stack($msg = \"\")\n {\n if (!dmContext::hasInstance())\n {\n return self::simpleStack($msg);\n }\n\n dmContext::getInstance()->getConfiguration()->loadHelpers(array('Javascript', 'Tag'));\n\n $result = \"\";\n $trace = debug_backtrace();\n $traceId = \"pkSimpleBacktrace\" . dmString::random();\n $traceIdShow = $traceId . \"Show\";\n $traceIdHide = $traceId . \"Hide\";\n $result .= \"<div class='pkSimpleBacktrace'>stack $msg\" .\n link_to_function(\"&gt;&gt;&gt;\",\n \"document.getElementById('$traceId').style.display = 'block'; \" .\n \"document.getElementById('$traceId').style.display = 'block'; \" .\n \"document.getElementById('$traceIdShow').style.display = 'none'; \" .\n \"document.getElementById('$traceIdHide').style.display = 'inline'\",\n array(\"id\" => $traceIdShow)) .\n link_to_function(\"&lt;&lt;&lt;\",\n \"document.getElementById('$traceId').style.display = 'none'; \" .\n \"document.getElementById('$traceIdHide').style.display = 'none'; \" .\n \"document.getElementById('$traceIdShow').style.display = 'inline'\",\n array(\"id\" => $traceIdHide, \"style\" => 'display: none'));\n $result .= \"</div>\";\n $result .= \"<pre id='$traceId' style='display: none'>\\n\";\n $first = true;\n foreach ($trace as $element)\n {\n if ($first)\n {\n $first = false;\n }\n else\n {\n $result .= \"File: \" . $lastFile . \" function: \" . $element['function'] . \" line: \" .$lastLine . \"\\n\";\n }\n $lastFile = dmArray::get($element, 'file');\n $lastLine = dmArray::get($element, 'line');\n }\n $result .= \"</pre>\\n\";\n echo $result;\n }", "public static function trace()\n\t{\n\t\tob_start();\n\t\tdebug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$trace = ob_get_clean();\n\t\t$trace = str_replace('#','<br/><div><b><u>',$trace);\n\t\t$trace = str_replace('called at [','called at : </u></b><ul><li>File : ',$trace);\n\t\t$trace = preg_replace('/:([0-9]*)\\]/','</li><li>Ligne : $1</li></ul></div>',$trace);\n\t\techo $trace;\n\t\treturn $trace;\n\t}", "protected function setErrorException(\\Exception $e) {\n\t\t$this->lastException = $e;\n\t\treturn $this;\n\t}", "public function __toString() {\n\n\t\t# Get backtrace\n\t\t$backtrace = debug_backtrace();\n\t\t$traceData = \"\";\n\n\t\t# Format backtrace\n\t\tforeach($backtrace as $trace) {\n\t\t\tif(!empty($trace[\"line\"])) {\n\t\t\t\tif(isset($trace[\"file\"]) && $trace[\"file\"] == $this->file && ($trace[\"line\"] == $this->line || $trace[\"line\"] == ($this->line + 1)))\n\t\t\t\t\t$traceData .= \">>>\";\n\t\t\t\t$traceData .= \"\\t line: {$trace[\"line\"]} \\t file: {$trace[\"file\"]}\";\n\t\t\t\t$traceData .= \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\t# Convert\n\t\treturn @date(\"d.m.Y H:i\") . \"\\nException($this->type, $this->line): $this->message\" . \";\\n$traceData\\n\\n\";\n\n\t}", "public function setException(Throwable $e)\n {\n $this->_exceptions[] = $e;\n return $this;\n }", "private function backTraceError()\n {\n //Set up backtrace variables\n $backtraceStarted = null;\n $rawBacktrace = debug_backtrace();\n $cleanBacktrace = $backtraceSeparator = '';\n $i = 0;\n\n //Loop through the backtrace\n foreach ( $rawBacktrace as $a_key => $a_value )\n {\n //If a file or line is not set, skip this iteration\n if ( ! isset($a_value['file']) || ! isset($a_value['line']) )\n {\n continue;\n }\n\n //Start saving the backtrace from the file the error occurred in, skip the rest\n if ( ! isset($backtraceStarted) && basename($a_value['file']) != $this->failedOnFile )\n {\n continue;\n }\n else\n {\n $backtraceStarted = true;\n }\n\n //Add this file to the backtrace\n $cleanBacktrace .= $backtraceSeparator . basename($a_value['file']) . ' [' . $a_value['line'] . ']';\n\n //Set the separator for the next iteration\n $backtraceSeparator = ' < ';\n\n //Increment the counter\n $i ++;\n }\n\n //Return the backtrace\n return $cleanBacktrace;\n }", "function setError($message)\n{\n\t$args = array_slice(func_get_args(), 1) ;\n\t$message = vsprintf($this->t($message), $args);\n\n\tif ($this->throwsExceptions) {\n\t\tthrow new AuthException($message);\n\t}\n\telse {\n\t\t$this->errors[] = $message;\n\t\t$this->onError($message);\n\t}\n}", "public function setExceptions($val)\n {\n $this->_propDict[\"exceptions\"] = $val;\n return $this;\n }", "public function setExceptions($val)\n {\n $this->_propDict[\"exceptions\"] = $val;\n return $this;\n }", "function addXmlBacktrace($parent)\n\t{\n\t\t$backtrace = $parent->addChild('backtrace');\n\t\t$line_node = $backtrace->addChild('line');\n\t\t$line_node->addAttribute('file', $this->file);\n\t\t$line_node->addAttribute('number', $this->line);\n\n\t\tforeach ($this->trace as $entry) {\n\t\t\tif (isset($entry['class']) && $entry['class'] == get_class($this)) continue;\n\n\t\t\t$line_node = $backtrace->addChild('line');\n\t\t\tif(isset($entry['file'])) $line_node->addAttribute('file', $entry['file']);\n\t\t\tif(isset($entry['line'])) $line_node->addAttribute('number', $entry['line']);\n\t\t\t$line_node->addAttribute('method', $entry['function']);\n\t\t}\n\t}", "public function __construct(\n $message = \"\",\n $code = 500,\n $severity = 1,\n $filename = __FILE__,\n $lineno = __LINE__,\n \\Exception $previous = null\n ) {\n if ($previous != null) {\n $this->debug = $message;\n $message = \"\";\n }\n\n parent::__construct($message, $code, $severity, $filename, $lineno, $previous);\n }", "function tideways_fatal_backtrace()\n{\n}", "protected function renderTrace(array $frames): WriterContract\n {\n $this->render('<comment>Exception trace:</comment>');\n foreach ($frames as $i => $frame) {\n if ($i > static::VERBOSITY_NORMAL_FRAMES && $this->output->getVerbosity(\n ) < OutputInterface::VERBOSITY_VERBOSE) {\n $this->render('<info>Please use the argument <fg=red>-v</> to see more details.</info>');\n break;\n }\n\n $file = $frame->getFile();\n $line = $frame->getLine();\n $class = empty($frame->getClass()) ? '' : $frame->getClass().'::';\n $function = $frame->getFunction();\n $args = $this->argumentFormatter->format($frame->getArgs());\n $pos = str_pad($i + 1, 4, ' ');\n\n $this->render(\"<comment><fg=cyan>$pos</>$class$function($args)</comment>\");\n $this->render(\" <fg=green>$file</> : <fg=green>$line</>\", false);\n }\n\n return $this;\n }", "public static function setError($message) {\n self::$_class = \"Example\\\\Excel\\\\Controllers\\\\Error\";\n throw new \\Exception($message);\n }", "private function stackTraceValid( $trace ) {\r\n return true;\r\n }", "private function set_error( $key )\n\t{\n\t\tglobal $path;\n\t\tif( isset($this->err_code[$key]) && isset($this->err_code[$key]) )\n\t\t{\t\n\t\t\t$this->arr_error[].= $this->err_label[$key]; // => array_push\n\t\t\t// DEV -->\n\t\t\t$this->num_error += $this->err_code[$key];\n\t\t\t// <-- DEV\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttrigger_error( $key . ' undefined');\n\t\t\texit;\n\t\t}\n\t}", "public function offsetSet($offset, $value)\r\n {\r\n throw new \\BadMethodCallException(\"Immutable stack, cannot set element\");\r\n }", "public function setException($exception, $reassign = false);", "public function printStackTrace()\n\t{\n\t\t$exception = null === $this->wrappedException ? $this : $this->wrappedException;\n\n\t\t$response = sfContext::getInstance()->getResponse();\n\t\t\n\t\tif (sfConfig::get('sf_debug'))\n\t\t{\n\t\t\tif (null === $response)\n\t\t\t{\n\t\t\t\t$response = new sfWebResponse(sfContext::getInstance()->getEventDispatcher());\n\t\t\t\tsfContext::getInstance()->setResponse($response);\n\t\t\t}\n\n\t\t\t$response->setStatusCode($this->httpCode);\n\n\t\t\treturn parent::printStackTrace();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// log all exceptions in php log\n\t\t\tif (!sfConfig::get('sf_test'))\n\t\t\t{\n\t\t\t\terror_log($this->getMessage());\n\t\t\t}\n\n\t\t\tif(isset($this->params['module']) && isset($this->params['action']))\n\t\t\t{\n\t\t\t\tsfContext::getInstance()->getController()->forward($this->params['module'], $this->params['action']);\n\t\t\t}\n\t\t\telseif(sfContext::getInstance()->getController()->actionExists('httpErrors', 'http' . $code))\n\t\t\t{\n\t\t\t\tsfContext::getInstance()->getController()->forward('httpErrors', 'http' . $code);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$module = sfConfig::get(sprintf('sf_error_%s_module', $this->httpCode));\n\t\t\t\t$action = sfConfig::get(sprintf('sf_error_%s_action', $this->httpCode));\n\t\t\t\tif($module && $action)\n\t\t\t\t{\n\t\t\t\t\tsfContext::getInstance()->getRequest()->setAttribute('http_code', $this->httpCode);\n\t\t\t\t\tsfContext::getInstance()->getController()->forward($module, $action);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$response->setStatusCode($this->httpCode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function _err($type, $trace, $name) {\n\t\t\t$fmt = 'Undifined property via <code>%1$s::%2$s()</code>: Property <code>%3$s</code> cannot be unset in <b>%4$s</b> on line <b>%5$s</b>. Error triggered';\n\t\t\tif ($type == 'FORBIDDEN') {\n\t\t\t\t$fmt = 'Forbidden property via <code>%1$s::%2$s()</code>: Property <code>%3$s</code> cannot be unset in <b>%4$s</b> on line <b>%5$s</b>. Error triggered';\n\t\t\t} elseif($type == 'CLONE') {\n\t\t\t\t$fmt = 'Invalid clone in <b>%4$s</b> on line <b>%5$s</b>. Because of how cloning works, and how references are configured within the class, extensions of %1$s cannot be cloned. Please make a new instance instead, like so: <code>$clone = new \\\\uri($original->str()); $clone->input = $original->input;</code>. Error triggered';\n\t\t\t}\n\t\t\t\n\t\t\ttrigger_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t$fmt,\n\t\t\t\t\t$trace[0]['class'],\n\t\t\t\t\t$trace[0]['function'],\n\t\t\t\t\t$name,\n\t\t\t\t\t$trace[0]['file'],\n\t\t\t\t\t$trace[0]['line']\n\t\t\t\t),\n\t\t\t\tE_USER_NOTICE\n\t\t\t);\n\t\t}", "public function setDebugInfo($file,$line)\n\t{\n\t\t$this->file = $file;\n\t\t$this->line = $line;\n\t}", "public function setSpan( $span )\n\t{\n\t\t$this->setAttribute( \"span\", $span );\n\t}", "public function setTraces($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\NetworkManagement\\V1\\Trace::class);\n $this->traces = $arr;\n\n return $this;\n }", "function _trace($message) {\n if ($trace = TRUE) {\n _log($message);\n } \n}", "function ez_print_stacktrace( Exception $e ) {\n\techo ez_format_stacktrace($e);\n}", "public function setException(\\Exception $exception)\r\n\t{\r\n\t\t$this->_exception = $exception;\r\n\t\t$this->_status = false;\r\n\t\treturn $this;\r\n\t}", "public function analyzeCallStack() {\r\n $this->_analyzator->analyze();\r\n\r\n return $this;\r\n }", "protected function generateCallTrace()\n {\n $e = new \\Exception();\n $trace = explode(\"\\n\", $this->getExceptionTraceAsString($e));\n // reverse array to make steps line up chronologically\n $trace = array_reverse($trace);\n array_shift($trace); // remove {main}\n array_pop($trace); // remove call to this method\n array_pop($trace); // remove call to log_debug_result method\n $length = count($trace);\n $result = [];\n for ($i = 0; $i < $length; $i++) {\n // replace '#someNum' with '$i)', set the right ordering\n $result[] = ($i + 1) . ')' . substr($trace[$i], strpos($trace[$i], ' '));\n }\n\n return \"\\t\" . implode(\"\\n\\t\", $result) . \"\\n\\n\";\n }", "public function parseLogStackTrace(?string $stackTrace) : array;", "private static function _stackTrace( $stack_trace_data = NULL )\n\t{\n\t\tif( is_null( $stack_trace_data ) ) {\n\t\t\t$stack_trace_data = debug_backtrace();\n\t\t\tarray_shift( $stack_trace_data ); //remove the call to _stackTrace\n\t\t}\n\t\t/* Prepare backtrace array */\n\t\t$stack_trace_array = array_reverse( $stack_trace_data );\n\t\t//pull off last 2 items, since they are internal\n\t\t//array_pop( $stack_trace_array );\n\t\t\n\t\t/* Create backtrace string */\n\t\t$strack_trace_string_array = \"\";\n\t\tforeach( $stack_trace_array as $stack_trace ) {\n\t\t\tif( array_key_exists( \"file\", $stack_trace ) && array_key_exists( \"line\", $stack_trace ) ) {\n\t\t\t\t$strack_trace_string_array[] = sprintf( \n\t\t\t\t\t\"%s( %s line %s )\",\n\t\t\t\t\tCommon::safeArrayAccess( \"function\", $stack_trace, \"\" ),\n\t\t\t\t\tstr_replace( LOCAL_DOCUMENT_ROOT, \"\", $stack_trace[\"file\"] ),\n\t\t\t\t\t(string)$stack_trace[\"line\"]\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$strack_trace_string_array[] = sprintf( \n\t\t\t\t\t\"%s( internal )\",\n\t\t\t\t\t$stack_trace[\"function\"]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn implode( \" -> \", $strack_trace_string_array );\n\t}", "public function setException(){\n $this->dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }", "function paintError($message) {\n parent::paintError($message);\n\t\t\t\t\t\tprint \"<div><span class=\\\"red\\\">Exception:</span> <strong>\";\n\t\t\t\t\t\t$breadcrumb = $this->getTestList();\n\t\t\t\t\t\tarray_shift($breadcrumb);\n\t\t\t\t\t\tprint implode(\" -&gt; \", $breadcrumb);\n\t\t\t\t\t\tprint \"</strong><br />\\n<span class=\\\"exception\\\">\" . $this->_htmlEntities($message) . \"</span></div>\\n\";\n\t\t\t\t}", "public function __set($key, $value)\n {\n $this->stack[$key] = $value;\n }", "public function setErrorLevel($level){\n\t\t$this->error_level = $level;\t\n\t}", "protected function setError($msg)\n {\n $this->error_count++;\n if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {\n $lasterror = $this->smtp->getError();\n if (!empty($lasterror['error'])) {\n $msg .= $this->lang('smtp_error') . $lasterror['error'];\n if (!empty($lasterror['detail'])) {\n $msg .= ' Detail: '. $lasterror['detail'];\n }\n if (!empty($lasterror['smtp_code'])) {\n $msg .= ' SMTP code: ' . $lasterror['smtp_code'];\n }\n if (!empty($lasterror['smtp_code_ex'])) {\n $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];\n }\n }\n }\n $this->ErrorInfo = $msg;\n }", "static function getTraces(Exception $exception, $format = 'txt'){\r\n\t\t$traceData = $exception->getTrace();\r\n\t\tarray_unshift($traceData, array(\r\n 'function' => '',\r\n 'file' => $exception->getFile() != null ? $exception->getFile() : null,\r\n 'line' => $exception->getLine() != null ? $exception->getLine() : null,\r\n 'args' => array(),\r\n\t\t));\r\n\t\t$traces = array();\r\n\t\tif ($format == 'html'){\r\n\t\t\t$lineFormat = 'at <strong>%s%s%s</strong>(%s)<br />in <em>%s</em> line %s <a href=\"#\" onclick=\"toggle(\\'%s\\'); return false;\">...</a><br /><ul class=\"code\" id=\"%s\" style=\"display: %s\">%s</ul>';\r\n\t\t}else{\r\n\t\t\t$lineFormat = 'at %s%s%s(%s) in %s line %s';\r\n\t\t}\r\n\t\tfor ($i = 0, $count = count($traceData); $i < $count; $i++){\r\n\t\t\t$line = isset($traceData[$i]['line']) ? $traceData[$i]['line'] : null;\r\n\t\t\t$file = isset($traceData[$i]['file']) ? $traceData[$i]['file'] : null;\r\n\t\t\t$args = isset($traceData[$i]['args']) ? $traceData[$i]['args'] : array();\r\n\t\t\t$traces[] = sprintf($lineFormat,\r\n\t\t\t\t(isset($traceData[$i]['class']) ? $traceData[$i]['class'] : ''),\r\n\t\t\t\t(isset($traceData[$i]['type']) ? $traceData[$i]['type'] : ''),\r\n\t\t\t\t$traceData[$i]['function'],\r\n\t\t\t\tself::formatArgs($args, false, $format),\r\n\t\t\t\tself::formatFile($file, $line, $format, null === $file ? 'n/a' : $file),\r\n\t\t\t\tnull === $line ? 'n/a' : $line,\r\n\t 'trace_'.$i,\r\n\t 'trace_'.$i,\r\n\t\t\t\t$i == 0 ? 'block' : 'none',\r\n\t\t\t\tself::fileExcerpt($file, $line)\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $traces;\r\n\t}", "public static function setErrorHandler($iNumber, $sMessage, $sFile, $iLine)\n\t{\n\t\tself::showError(array('code' => $iNumber, 'message' => $sMessage, 'line' => $iLine, 'file' => $sFile));\n\t\tself::showDebugBacktrace(debug_backtrace());\n\t}", "public function get_errorLogTrace($output_profile, $log_silo_profile = CRNRSTN_LOG_ALL, $line_num = NULL, $method = NULL, $file = NULL, $output_profile_override_meta = NULL){\n\n try{\n\n if($this->CRNRSTN_debugMode<2){\n\n //\n // HOOOSTON...VE HAF PROBLEM!\n //throw new Exception('Unable to retrieve log trace data due to CRNRSTN being in configuration of CRNRSTN_debugMode=\"'.$this->CRNRSTN_debugMode.'\"...which setting does not authorize resource allocation enabling aggregation of error log data in server memory.');\n\n }else{\n\n if(!isset($method)){\n\n $method = __METHOD__;\n\n }\n\n if(!isset($line_num)){\n\n $line_num = __LINE__;\n\n }\n\n if(!isset($output_profile)){\n\n $output_profile = $this->return_loggingProfile();\n\n }else{\n\n $output_profile = trim(strtoupper($output_profile));\n switch($output_profile){\n case CRNRSTN_LOG_EMAIL:\n case CRNRSTN_LOG_EMAIL_PROXY:\n case CRNRSTN_LOG_FILE:\n case CRNRSTN_LOG_SCREEN_TEXT:\n case CRNRSTN_LOG_SCREEN:\n case CRNRSTN_LOG_SCREEN_HTML:\n case CRNRSTN_LOG_SCREEN_HTML_HIDDEN:\n case CRNRSTN_LOG_DEFAULT:\n break;\n default:\n\n //\n // HOOOSTON...VE HAF PROBLEM!\n throw new Exception('The provided logging output profile, \"'.$output_profile.'\", is not supported by CRNRSTN ::. Please choose between the following options :: [EMAIL, FILE, SCREEN_TEXT, SCREEN, SCREEN_HTML, SCREEN_HTML_HIDDEN, DEFAULT]');\n\n break;\n\n }\n\n }\n\n $this->oLogger->get_errorLogTrace($output_profile, $output_profile_override_meta, $log_silo_profile, $line_num, $method, $file, $this);\n\n }\n\n } catch( Exception $e ) {\n\n //\n // LET CRNRSTN :: HANDLE THIS PER THE LOGGING PROFILE CONFIGURATION FOR THIS SERVER\n $this->catchException($e, LOG_ERR, __METHOD__, __NAMESPACE__);\n\n return false;\n\n }\n\n return NULL;\n\n }", "public function __construct()\n {\n $this->addStyle('info', new Style('yellow'));\n $this->addStyle('error', new Style('white', 'red'));\n\n $this->stack = new Stack();\n $this->stack->setEmptyStyle(new Style());\n }", "final public function getTraceAsString()\n {\n return 'trace';\n }", "public function setErrorCode(?string $value): void {\n $this->getBackingStore()->set('errorCode', $value);\n }", "public function setErr($value)\n {\n return $this->set(self::ERR, $value);\n }", "public function setErr($value)\n {\n return $this->set(self::ERR, $value);\n }", "function trace( $message )\n{\n\t$registry = Registry::getInstance();\n\tif ( $registry->keyExists( 'trace_messages' ) )\n\t{\n\t\t$trace_messages = $registry->get( 'trace_messages' );\n\t}\n\t$trace_messages[] = $message;\n\t$registry->set( \"trace_messages\", $trace_messages );\n}", "function renderStackTrace($trace, $sanitize = true) {\n\n\t$traceString = '';\n\n\tforeach ($trace as $i => $stackFrame) {\n\t\t$file = isset($stackFrame['file']) ? $stackFrame['file'] : '[internal function]' ;\n\t\t$lineNum = isset($stackFrame['line']) ? '(' . $stackFrame['line'] . ')' : '';\n\t\t$classAndFunction = $stackFrame['class'] . $stackFrame['type'] . $stackFrame['function'];\n\t\t$args = array();\n\n\t\tif (!$sanitize) {\n\t\t\tforeach ($stackFrame['args'] as $arg) {\n\t\t\t\tif (is_string($arg)) {\n\t\t\t\t\t\t$args[] = \"'\" . $arg . \"'\";\n\t\t\t\t} elseif (is_array($arg)) {\n\t\t\t\t\t\t$args[] = 'Array';\n\t\t\t\t} elseif (is_null($arg)) {\n\t\t\t\t\t\t$args[] = 'NULL';\n\t\t\t\t} elseif (is_bool($arg)) {\n\t\t\t\t\t\t$args[] = ($arg) ? 'true' : 'false';\n\t\t\t\t} elseif (is_object($arg)) {\n\t\t\t\t\t\t$args[] = get_class($arg);\n\t\t\t\t} elseif (is_resource($arg)) {\n\t\t\t\t\t\t$args[] = get_resource_type($arg);\n\t\t\t\t} else {\n\t\t\t\t\t\t$args[] = $arg;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$args = join(', ', $args);\n\t\t$traceString .= \"#{$i} {$file}{$lineNum}: {$classAndFunction}({$args})\\n\";\n\n\t\tif ($i === count($trace) - 1) {\n\t\t\t$traceString .= '#' . count($trace) . ' {main}';\n\t\t}\n\t}\n\n\treturn $traceString;\n}", "protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')\n {\n $this->error = array(\n 'error' => $message,\n 'detail' => $detail,\n 'smtp_code' => $smtp_code,\n 'smtp_code_ex' => $smtp_code_ex\n );\n }", "function __set_error($error_code = null, $error_message = null,\n $error_details = null) {\n\n $this->error_code = $error_code;\n $this->error_message = $error_message;\n $this->error_details = $error_details;\n\n}", "public function testSettingInvalidTs()\n {\n $this->expectException(\\InvalidArgumentException::class);\n $groupsMark = new GroupsMark();\n $groupsMark->setTs(null);\n }", "protected function setError($message, $type, $line = null)\n {\n isset($line) or $line = $this->line;\n\n $this->errors[(int) $line][] = array(\n 'type' => $type,\n 'message' => $message,\n 'line' => (int) $line,\n 'parser' => get_class($this),\n );\n }", "public function setFrame($value) {}", "function texc($x)\r\n{\r\n\tthrow new \\Exception('Debug: ' . $x);\r\n}", "public static function exception($value)\n {\n self::$logs .= '[' . date('Y-m-d H:i:s', time()) . '] Exception ' . $value . \"\\n\";\n }", "public function __construct(\\Exception $priorException=null, $errorDetail=''){\n $this->errorDetail = $errorDetail;\n $this->priorException = $priorException;\n parent::__construct($errorDetail);\n }", "protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')\n {\n }" ]
[ "0.5554058", "0.5520527", "0.5505888", "0.5487589", "0.5484404", "0.543009", "0.543009", "0.5400799", "0.5378587", "0.5372434", "0.529956", "0.5287297", "0.5277981", "0.5267071", "0.5238786", "0.5197832", "0.51898795", "0.5161664", "0.514765", "0.51379913", "0.5121927", "0.50654316", "0.5007852", "0.49844962", "0.4971373", "0.49659768", "0.49563998", "0.49006453", "0.48893732", "0.48746836", "0.48702788", "0.48628294", "0.48622665", "0.48315138", "0.4831124", "0.48293415", "0.48279774", "0.4822361", "0.48074266", "0.47952467", "0.4795013", "0.477931", "0.47660694", "0.475364", "0.4752109", "0.47206962", "0.46867958", "0.46864575", "0.46838853", "0.46808866", "0.46725607", "0.46656826", "0.46652684", "0.46630666", "0.46630666", "0.46581438", "0.465222", "0.46438178", "0.464251", "0.46409005", "0.4624614", "0.46233687", "0.4611464", "0.46093515", "0.46079224", "0.46026137", "0.46019784", "0.46004617", "0.45952842", "0.45831236", "0.45725554", "0.45674303", "0.45629856", "0.45612276", "0.45545548", "0.4544432", "0.45405087", "0.4538752", "0.45343646", "0.45229036", "0.45227557", "0.45218772", "0.4520574", "0.45085597", "0.45074156", "0.4499457", "0.4496473", "0.44937634", "0.44937634", "0.44821236", "0.44778186", "0.44756696", "0.44594032", "0.44571245", "0.4452278", "0.44511622", "0.44414273", "0.44372836", "0.44296956", "0.44274223" ]
0.51370627
20
Set stack traces for this span
public function addStacktraces(array $stacktraces) { $this->stacktrace = $stacktraces; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setTraceIssues(?string $level): void\n {\n self::$trace_issues = \\is_string($level) ? \\strtolower($level) : null;\n }", "public function setTraces($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\NetworkManagement\\V1\\Trace::class);\n $this->traces = $arr;\n\n return $this;\n }", "public function setTrace($cat) {\n $this->cat= $cat;\n }", "public function setTrace($cat) {\n $this->cat= $cat;\n }", "public function setBacktraceRenderer(\\Closure $backtraceRenderer);", "public function getColorfulText()\n {\n $output = \"\\033[1;31m--[ Agile Toolkit Exception ]---------------------------\\n\";\n $output .= get_class($this).\": \\033[47m\".$this->getMessage().\"\\033[0;31m\".\n ($this->getCode() ? ' [code: '.$this->getCode().']' : '');\n\n foreach ($this->params as $key => $val) {\n $key = str_pad($key, 19, ' ', STR_PAD_LEFT);\n $output .= \"\\n\".$key.': '.$this->toString($val);\n }\n\n $output .= \"\\n\\033[0mStack Trace: \";\n\n $in_atk = true;\n $escape_frame = false;\n\n foreach ($this->getMyTrace() as $call) {\n if (!isset($call['file'])) {\n $call['file'] = '';\n } elseif (\n $in_atk &&\n strpos($call['file'], '/data/src/') === false &&\n strpos($call['file'], '/core/src/') === false &&\n strpos($call['file'], '/dsql/src/') === false\n ) {\n $escape_frame = true;\n $in_atk = false;\n }\n\n $file = str_pad(substr($call['file'], -40), 40, ' ', STR_PAD_LEFT);\n\n $line = str_pad(@$call['line'], 4, ' ', STR_PAD_LEFT);\n\n $output .= \"\\n\\033[0;34m\".$file.\"\\033[0m\";\n $output .= \":\\033[0;31m\".$line.\"\\033[0m\";\n\n if (isset($call['object'])) {\n $name = (!isset($call['object']->name)) ? get_class($call['object']) : $call['object']->name;\n $output .= \" - \\033[0;32m\".$name.\"\\033[0m\";\n }\n\n $output .= \" \\033[0;32m\";\n\n if (isset($call['class'])) {\n $output .= $call['class'].'::';\n }\n\n if ($escape_frame) {\n $output .= \"\\033[0,31m\".$call['function'];\n $escape_frame = false;\n\n $args = [];\n foreach ($call['args'] as $arg) {\n $args[] = $this->toString($arg);\n }\n\n $output .= \"\\n\".str_repeat(' ', 20).\"\\033[0,31m(\".implode(', ', $args);\n } else {\n $output .= \"\\033[0,33m\".$call['function'].'(';\n }\n\n $output .= ')';\n }\n\n if ($p = $this->getPrevious()) {\n $output .= \"\\n\\033[0mCaused by Previous Exception:\\n\";\n $output .= \"\\033[1;31m\".get_class($p).': '.$p->getMessage().\"\\033[0;31m\".\n ($p->getCode() ? ' [code: '.$p->getCode().']' : '');\n }\n\n // next print params\n\n $output .= \"\\n\\033[1;31m--------------------------------------------------------\\n\";\n\n return $output.\"\\033[0m\";\n }", "public function init_trace()\n {\n }", "protected function renderTrace(array $frames): WriterContract\n {\n $this->render('<comment>Exception trace:</comment>');\n foreach ($frames as $i => $frame) {\n if ($i > static::VERBOSITY_NORMAL_FRAMES && $this->output->getVerbosity(\n ) < OutputInterface::VERBOSITY_VERBOSE) {\n $this->render('<info>Please use the argument <fg=red>-v</> to see more details.</info>');\n break;\n }\n\n $file = $frame->getFile();\n $line = $frame->getLine();\n $class = empty($frame->getClass()) ? '' : $frame->getClass().'::';\n $function = $frame->getFunction();\n $args = $this->argumentFormatter->format($frame->getArgs());\n $pos = str_pad($i + 1, 4, ' ');\n\n $this->render(\"<comment><fg=cyan>$pos</>$class$function($args)</comment>\");\n $this->render(\" <fg=green>$file</> : <fg=green>$line</>\", false);\n }\n\n return $this;\n }", "function trace_log()\n {\n $messages = func_get_args();\n\n foreach ($messages as $message) {\n $level = 'info';\n\n if ($message instanceof Exception) {\n $level = 'error';\n }\n elseif (is_array($message) || is_object($message)) {\n $message = print_r($message, true);\n }\n\n Log::$level($message);\n }\n }", "public function addStacktrace(Stacktrace $stacktrace)\n {\n $this->stacktrace[] = $stacktrace;\n }", "public function trace()\n {\n if (!$this->cfg['collect']) {\n return;\n }\n $args = \\func_get_args();\n $meta = $this->internal->getMetaVals(\n $args,\n array(\n 'caption' => 'trace',\n 'channel' => $this->cfg['channelName'],\n 'columns' => array('file','line','function'),\n )\n );\n $backtrace = $this->errorHandler->backtrace();\n // toss \"internal\" frames\n for ($i = 1, $count = \\count($backtrace)-1; $i < $count; $i++) {\n $frame = $backtrace[$i];\n $function = isset($frame['function']) ? $frame['function'] : '';\n if (!\\preg_match('/^'.\\preg_quote(__CLASS__).'(::|->)/', $function)) {\n break;\n }\n }\n $backtrace = \\array_slice($backtrace, $i-1);\n // keep the calling file & line, but toss ->trace or ::_trace\n unset($backtrace[0]['function']);\n $this->appendLog('trace', array($backtrace), $meta);\n }", "abstract public function wrapStackTrace($html, $title);", "public function setCallStackLimit(int $limit): void {\n\n\t\tif ($limit < 0) {\n\t\t\tthrow new EngineError('Callstack limit must be positive or zero');\n\t\t}\n\n\t\t$this->callStackLimit = $limit;\n\n\t}", "function captureException(Th $t, array $data):void {\n\t\t$tOriginal = $t; /** @var Th $tOriginal */\n\t\tdo {\n\t\t\t$isDFE = $t instanceof DFE; /** @var bool $isDFE */\n\t\t\t$dataI = [\n\t\t\t\t'type' => $isDFE ? $t->sentryType() : get_class($t)\n\t\t\t\t,'value' => $this->serializer->serialize(df_xtsd($t))\n\t\t\t];\n\t\t\t$trace = $t->getTrace();\n\t\t\t$needAddCurrentFrame = !self::needSkipFrame($trace[0]); /** @var bool $needAddCurrentFrame */\n\t\t\twhile (self::needSkipFrame($trace[0])) {\n\t\t\t\tarray_shift($trace);\n\t\t\t}\n\t\t\tif ($needAddCurrentFrame) {\n\t\t\t\tarray_unshift($trace, ['file' => $t->getFile(), 'line' => $t->getLine()]);\n\t\t\t}\n\t\t\t$dataI['stacktrace'] = ['frames' => Trace::info($trace)];\n\t\t\t$exceptions[] = $dataI;\n\t\t} while ($t = $t->getPrevious());\n\t\t$data['exception'] = ['values' => array_reverse($exceptions)];\n\t\tif (empty($data['level'])) {\n\t\t\tif (method_exists($tOriginal, 'getSeverity')) {\n\t\t\t\t/** 2020-06-28 @uses \\ErrorException::getSeverity() */\n\t\t\t\t$data['level'] = $this->translateSeverity($tOriginal->getSeverity());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$data['level'] = self::ERROR;\n\t\t\t}\n\t\t}\n\t\t$this->capture($data, $trace);\n\t}", "public function setTrace(bool $trace): void\n {\n if ($this->tracer !== null) {\n $this->removeParseListener($this->tracer);\n }\n\n if ($trace) {\n $this->tracer = new ParserTraceListener($this);\n $this->addParseListener($this->tracer);\n }\n }", "public static function addBackTrace($type = 2){\r\n\t}", "public function stacktrace() {\n\n if ( true === WP_DEBUG ) {\n\n $e = new \\Exception;\n $this->log( $e->getTraceAsString() );\n }\n }", "public function setThrowable(\\Throwable $exception) : void\n {\n $this->exception = null;\n $this->throwable = $exception;\n }", "function trace(SpanInterface $span, Closure $closure, iterable $args = [])\n{\n $s = $span;\n $c = $closure;\n $a = $args;\n unset($span, $closure, $args);\n\n $scope = $s->activate();\n\n try {\n /** @psalm-suppress InvalidArgument */\n return $c(...$a, ...($a = []));\n } catch (Throwable $e) {\n $s->setStatus(StatusCode::STATUS_ERROR, $e->getMessage());\n $s->recordException($e, ['exception.escaped' => true]);\n\n throw $e;\n } finally {\n $scope->detach();\n $s->end();\n }\n}", "protected static function renderStackTrace(array $stackTrace)\n {\n $render = \"\";\n $num = count($stackTrace) - 1;\n $numLength = strlen($num);\n\n foreach ($stackTrace as $event) {\n $funcName = array_key_exists(\"class\", $event) ? \"{$event['class']}{$event['type']}{$event['function']}\" : \"{$event['function']}\";\n $file = array_key_exists(\"file\", $event) ? $event['file'] : \"-\";\n $line = array_key_exists(\"line\", $event) ? $event['line'] : \"-\";\n $rawArgs = array_key_exists(\"args\", $event) ? $event['args'] : array();\n $args = array();\n\n foreach ($rawArgs as $k => $arg) {\n $args[$k] = \"object\" == gettype($arg) ? get_class($arg) : gettype($arg);\n }\n\n $args = implode(\", \", $args);\n $numString = str_pad($num, $numLength, \"0\", STR_PAD_LEFT);\n $funcName = \"<strong>$funcName(</strong><em>$args</em><strong>)</strong>\";\n $render .= \"#$numString $funcName\\n\";\n $render .= \" <strong>File :</strong> $file\\n\";\n $render .= \" <strong>Line :</strong> $line\\n\";\n $num--;\n }\n\n $html = \"<span class='debugToggleStackTrace' title='Show/hide stack trace'>Stack trace</span> \";\n $html .= \"<span class='debugToggleIndicator'>&rtrif;</span>\";\n $html .= \"<span class='debugStackTraceDetails'>\\n\\n$render</span>\";\n return $html;\n }", "static function getTraces(Exception $exception, $format = 'txt'){\r\n\t\t$traceData = $exception->getTrace();\r\n\t\tarray_unshift($traceData, array(\r\n 'function' => '',\r\n 'file' => $exception->getFile() != null ? $exception->getFile() : null,\r\n 'line' => $exception->getLine() != null ? $exception->getLine() : null,\r\n 'args' => array(),\r\n\t\t));\r\n\t\t$traces = array();\r\n\t\tif ($format == 'html'){\r\n\t\t\t$lineFormat = 'at <strong>%s%s%s</strong>(%s)<br />in <em>%s</em> line %s <a href=\"#\" onclick=\"toggle(\\'%s\\'); return false;\">...</a><br /><ul class=\"code\" id=\"%s\" style=\"display: %s\">%s</ul>';\r\n\t\t}else{\r\n\t\t\t$lineFormat = 'at %s%s%s(%s) in %s line %s';\r\n\t\t}\r\n\t\tfor ($i = 0, $count = count($traceData); $i < $count; $i++){\r\n\t\t\t$line = isset($traceData[$i]['line']) ? $traceData[$i]['line'] : null;\r\n\t\t\t$file = isset($traceData[$i]['file']) ? $traceData[$i]['file'] : null;\r\n\t\t\t$args = isset($traceData[$i]['args']) ? $traceData[$i]['args'] : array();\r\n\t\t\t$traces[] = sprintf($lineFormat,\r\n\t\t\t\t(isset($traceData[$i]['class']) ? $traceData[$i]['class'] : ''),\r\n\t\t\t\t(isset($traceData[$i]['type']) ? $traceData[$i]['type'] : ''),\r\n\t\t\t\t$traceData[$i]['function'],\r\n\t\t\t\tself::formatArgs($args, false, $format),\r\n\t\t\t\tself::formatFile($file, $line, $format, null === $file ? 'n/a' : $file),\r\n\t\t\t\tnull === $line ? 'n/a' : $line,\r\n\t 'trace_'.$i,\r\n\t 'trace_'.$i,\r\n\t\t\t\t$i == 0 ? 'block' : 'none',\r\n\t\t\t\tself::fileExcerpt($file, $line)\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $traces;\r\n\t}", "public function setExceptions($val)\n {\n $this->_propDict[\"exceptions\"] = $val;\n return $this;\n }", "public function setExceptions($val)\n {\n $this->_propDict[\"exceptions\"] = $val;\n return $this;\n }", "private function _err($trace) {\n\t\t\t$this->error_count++;\n\t\t\ttrigger_error(\n\t\t\t\tsprintf(\n\t\t\t\t\t'The method <code>%1$s()</code> cannot be chained in <b>%2$s</b> on line <b>%3$s</b>. Error triggered',\n\t\t\t\t\t$trace[0]['function'],\n\t\t\t\t\t$trace[0]['file'],\n\t\t\t\t\t$trace[0]['line']\n\t\t\t\t),\n\t\t\t\tE_USER_NOTICE\n\t\t\t);\n\t\t}", "public function set_group_exceptions($cmarray) {\n $this->groupexceptions = $cmarray;\n }", "public function sanitize_resolver_trace(array $trace)\n {\n }", "public function profilingCollectBacktrace($value): self\n {\n $this->profilingCollectBacktrace = $value;\n \n return $this;\n }", "public function __construct()\n {\n $this->addStyle('info', new Style('yellow'));\n $this->addStyle('error', new Style('white', 'red'));\n\n $this->stack = new Stack();\n $this->stack->setEmptyStyle(new Style());\n }", "public function setException(Throwable $exception) {\n $this->exception= $exception;\n }", "protected function updateLastTrace() {\n $this->last_trace = time();\n }", "public function analyzeCallStack() {\r\n $this->_analyzator->analyze();\r\n\r\n return $this;\r\n }", "public function setSpan( $span )\n\t{\n\t\t$this->setAttribute( \"span\", $span );\n\t}", "public function addStackFrames(array $stackFrames)\n {\n foreach ($stackFrames as $stackFrame) {\n $this->addStackFrame($stackFrame);\n }\n }", "public function testTracerFlushedWhenSpanLimitExceeded()\n {\n $traces = $this->tracesFromWebRequest(function () {\n $response = $this->call(GetSpec::create('Root', '/'));\n // We explicitly assert the configured value of 'DD_TRACE_SPANS_LIMIT' echoed by the web app\n // because if we add tests to this test case that require a larger limit the current test would still pass\n // but would not test the specific edge case.\n TestCase::assertSame('1', $response);\n });\n\n $this->assertFlameGraph($traces, [\n SpanAssertion::exists('web.request')\n ->withChildren([\n SpanAssertion::exists('my_span')\n ]),\n ]);\n }", "public function parseLogStackTrace(?string $stackTrace) : array;", "public function trace($message)\n {\n }", "public function __construct()\n {\n $this->stack = array();\n }", "public function setExceptions(bool $value)\n {\n $this->exceptions = $value;\n }", "protected function setErrorClassAttribute() {}", "private function formatStackTrace($trace)/*{{{*/\n {\n // remove the first 2 entries in the array as they \n // refer to this file and the base.class.php that\n // called it\n $junk=array_shift($trace);\n $junk=array_shift($trace);\n $caller=array_shift($trace);\n $op=\"\";\n if($this->tracelevel>-1){\n if(isset($caller[\"function\"])){\n $op=\"In: \" . $caller[\"function\"];\n if(isset($caller[\"class\"]) && strlen($caller[\"class\"])){\n $op.=\" in class: \" . $caller[\"class\"];\n }\n $op.=\" Line: \" . $caller[\"line\"];\n $op.=\" file: \" . $caller[\"file\"] . PHP_EOL;\n $cn=count($trace);\n if($cn && $this->tracelevel>1){\n foreach($trace as $k=>$v){\n if(isset($v[\"class\"])){\n $op.=\" func: \" . $v[\"function\"] . \" class: \" . $v[\"class\"] . \" line: \" . $v[\"line\"] . \" file: \" . $v[\"file\"] . PHP_EOL;\n }else{\n $op.=\" func: \" . $v[\"function\"] . \" line: \" . $v[\"line\"] . \" file: \" . $v[\"file\"] . PHP_EOL;\n }\n }\n }\n }\n }\n return $op;\n }", "public function setLogExceptions($flag) {\n\t\t$this->logExceptions = (bool) $flag;\n\t\treturn $this;\n\t}", "public function setException(array $exception = [])\n {\n $this->exception = [];\n if ([] === $exception) {\n return $this;\n }\n foreach($exception as $v) {\n if ($v instanceof FHIRCoding) {\n $this->addException($v);\n } else {\n $this->addException(new FHIRCoding($v));\n }\n }\n return $this;\n }", "public function addStackFrame(\\google\\tracing\\v1\\StackTrace\\StackFrame $value){\n return $this->_add(1, $value);\n }", "protected function setSystemErrors(){\r\n // errors\r\n if($this->error->isErrors()){\r\n $errors = $this->error->getError();\r\n array_walk($errors, function(&$value){$value = array('text' => $value, 'class' => 'danger');});\r\n $this->parser->sys_errors = $errors;\r\n $this->parser->is_sys_errors = true;\r\n }else{\r\n $this->parser->is_sys_errors = false;\r\n }\r\n\r\n // messages\r\n if($this->error->isMessages()){\r\n $errors = $this->error->getError(true);\r\n array_walk($errors, function(&$value){$value = array('text' => $value, 'class' => 'success');});\r\n $this->parser->sys_messages = $errors;\r\n $this->parser->is_sys_messages = true;\r\n }else{\r\n $this->parser->is_sys_messages = false;\r\n }\r\n\r\n $this->error->clearError(true);\r\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 getHTMLText()\n {\n $output = \"--[ Agile Toolkit Exception ]---------------------------\\n\";\n $output .= get_class($this).\": <font color='pink'><b>\".$this->getMessage().'</b></font>'.\n ($this->getCode() ? ' [code: '.$this->getCode().']' : '');\n\n foreach ($this->params as $key => $val) {\n $key = str_pad($key, 19, ' ', STR_PAD_LEFT);\n $output .= \"\\n\".$key.': '.$this->toString($val);\n }\n\n $output .= \"\\nStack Trace: \";\n\n $in_atk = true;\n $escape_frame = false;\n\n foreach ($this->getMyTrace() as $call) {\n if (!isset($call['file'])) {\n $call['file'] = '';\n } elseif (\n $in_atk &&\n strpos($call['file'], '/data/src/') === false &&\n strpos($call['file'], '/core/src/') === false &&\n strpos($call['file'], '/dsql/src/') === false\n ) {\n $escape_frame = true;\n $in_atk = false;\n }\n\n $file = str_pad(substr($call['file'], -40), 40, ' ', STR_PAD_LEFT);\n\n $line = str_pad(@$call['line'], 4, ' ', STR_PAD_LEFT);\n\n $output .= \"\\n<font color='cyan'>\".$file.'</font>';\n $output .= \":<font color='pink'>\".$line.'</font>';\n\n if (isset($call['object'])) {\n $name = (!isset($call['object']->name)) ? get_class($call['object']) : $call['object']->name;\n $output .= \" - <font color='yellow'>\".$name.'</font>';\n }\n\n $output .= \" <font color='gray'>\";\n\n if (isset($call['class'])) {\n $output .= $call['class'].'::';\n }\n $output .= '</font>';\n\n if ($escape_frame) {\n $output .= \"<font color='pink'>\".$call['function'].'</font>';\n $escape_frame = false;\n\n $args = [];\n foreach ($call['args'] as $arg) {\n $args[] = $this->toString($arg);\n }\n\n $output .= \"\\n\".str_repeat(' ', 20).\"<font color='pink'>(\".implode(', ', $args);\n } else {\n $output .= \"<font color='gray'>\".$call['function'].'(';\n }\n\n $output .= ')</font>';\n }\n\n if ($p = $this->getPrevious()) {\n $output .= \"\\n\\nCaused by Previous Exception:\\n\";\n $output .= get_class($p).\": <font color='pink'>\".$p->getMessage().'</font>'.\n ($p->getCode() ? ' [code: '.$p->getCode().']' : '');\n }\n\n // next print params\n\n $output .= \"\\n--------------------------------------------------------\\n\";\n\n return $output;\n }", "public function setThrowException($value)\n {\n $this->provider->throwExceptionInError = $value;\n }", "public function getStacktrace()\n {\n return $this->stacktrace;\n }", "public function setException(bool $shouldThrow = true, \\Exception $exception = null) :void{\n\t\t$this->shouldThrow = $shouldThrow;\n\t\t$this->exceptionToThrow = $exception;\n\t}", "function addXmlBacktrace($parent)\n\t{\n\t\t$backtrace = $parent->addChild('backtrace');\n\t\t$line_node = $backtrace->addChild('line');\n\t\t$line_node->addAttribute('file', $this->file);\n\t\t$line_node->addAttribute('number', $this->line);\n\n\t\tforeach ($this->trace as $entry) {\n\t\t\tif (isset($entry['class']) && $entry['class'] == get_class($this)) continue;\n\n\t\t\t$line_node = $backtrace->addChild('line');\n\t\t\tif(isset($entry['file'])) $line_node->addAttribute('file', $entry['file']);\n\t\t\tif(isset($entry['line'])) $line_node->addAttribute('number', $entry['line']);\n\t\t\t$line_node->addAttribute('method', $entry['function']);\n\t\t}\n\t}", "public static function stack($msg = \"\")\n {\n if (!dmContext::hasInstance())\n {\n return self::simpleStack($msg);\n }\n\n dmContext::getInstance()->getConfiguration()->loadHelpers(array('Javascript', 'Tag'));\n\n $result = \"\";\n $trace = debug_backtrace();\n $traceId = \"pkSimpleBacktrace\" . dmString::random();\n $traceIdShow = $traceId . \"Show\";\n $traceIdHide = $traceId . \"Hide\";\n $result .= \"<div class='pkSimpleBacktrace'>stack $msg\" .\n link_to_function(\"&gt;&gt;&gt;\",\n \"document.getElementById('$traceId').style.display = 'block'; \" .\n \"document.getElementById('$traceId').style.display = 'block'; \" .\n \"document.getElementById('$traceIdShow').style.display = 'none'; \" .\n \"document.getElementById('$traceIdHide').style.display = 'inline'\",\n array(\"id\" => $traceIdShow)) .\n link_to_function(\"&lt;&lt;&lt;\",\n \"document.getElementById('$traceId').style.display = 'none'; \" .\n \"document.getElementById('$traceIdHide').style.display = 'none'; \" .\n \"document.getElementById('$traceIdShow').style.display = 'inline'\",\n array(\"id\" => $traceIdHide, \"style\" => 'display: none'));\n $result .= \"</div>\";\n $result .= \"<pre id='$traceId' style='display: none'>\\n\";\n $first = true;\n foreach ($trace as $element)\n {\n if ($first)\n {\n $first = false;\n }\n else\n {\n $result .= \"File: \" . $lastFile . \" function: \" . $element['function'] . \" line: \" .$lastLine . \"\\n\";\n }\n $lastFile = dmArray::get($element, 'file');\n $lastLine = dmArray::get($element, 'line');\n }\n $result .= \"</pre>\\n\";\n echo $result;\n }", "private function setExceptionData()\n {\n $data = [\n 'exception' => $this->classShortName,\n 'file' => $this->getFile(),\n 'line' => $this->getLine(),\n ];\n\n if (!App::environment('prod')) {\n $data['trace'] = $this->getTraceAsString();\n }\n\n return $data;\n }", "public function __construct(){\n\t\t$this->stack = array();\n\t}", "public function setError($error, $line=-1) {\n \t$debug = debug_backtrace();\n \t$caller = next($debug);\n \t$this->error = sprintf('[%s::%s - %s] %s', basename($caller['file']), $caller['function'], ($line > 0) ? $line : $caller['line'], $error);\n }", "public static function trace()\n\t{\n\t\tob_start();\n\t\tdebug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$trace = ob_get_clean();\n\t\t$trace = str_replace('#','<br/><div><b><u>',$trace);\n\t\t$trace = str_replace('called at [','called at : </u></b><ul><li>File : ',$trace);\n\t\t$trace = preg_replace('/:([0-9]*)\\]/','</li><li>Ligne : $1</li></ul></div>',$trace);\n\t\techo $trace;\n\t\treturn $trace;\n\t}", "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 function addSpans(\\google\\tracing\\v1\\Span $value){\n return $this->_add(2, $value);\n }", "public function getTraces()\n {\n return $this->traces;\n }", "public function setSpan(int $value) {\n if ($value >= 2) {\n return $this->setAttribute('span', $value);\n } else {\n return $this->removeAttribute('span');\n }\n }", "function renderStackTrace($trace, $sanitize = true) {\n\n\t$traceString = '';\n\n\tforeach ($trace as $i => $stackFrame) {\n\t\t$file = isset($stackFrame['file']) ? $stackFrame['file'] : '[internal function]' ;\n\t\t$lineNum = isset($stackFrame['line']) ? '(' . $stackFrame['line'] . ')' : '';\n\t\t$classAndFunction = $stackFrame['class'] . $stackFrame['type'] . $stackFrame['function'];\n\t\t$args = array();\n\n\t\tif (!$sanitize) {\n\t\t\tforeach ($stackFrame['args'] as $arg) {\n\t\t\t\tif (is_string($arg)) {\n\t\t\t\t\t\t$args[] = \"'\" . $arg . \"'\";\n\t\t\t\t} elseif (is_array($arg)) {\n\t\t\t\t\t\t$args[] = 'Array';\n\t\t\t\t} elseif (is_null($arg)) {\n\t\t\t\t\t\t$args[] = 'NULL';\n\t\t\t\t} elseif (is_bool($arg)) {\n\t\t\t\t\t\t$args[] = ($arg) ? 'true' : 'false';\n\t\t\t\t} elseif (is_object($arg)) {\n\t\t\t\t\t\t$args[] = get_class($arg);\n\t\t\t\t} elseif (is_resource($arg)) {\n\t\t\t\t\t\t$args[] = get_resource_type($arg);\n\t\t\t\t} else {\n\t\t\t\t\t\t$args[] = $arg;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$args = join(', ', $args);\n\t\t$traceString .= \"#{$i} {$file}{$lineNum}: {$classAndFunction}({$args})\\n\";\n\n\t\tif ($i === count($trace) - 1) {\n\t\t\t$traceString .= '#' . count($trace) . ' {main}';\n\t\t}\n\t}\n\n\treturn $traceString;\n}", "public function __construct()\n\t{\n\t\t$this->_stack = array();\n\t\t$this->setSeparator();\n\t}", "function trace(){\n $r = array_map(create_function('$a', 'return (isset($a[\"class\"])?$a[\"class\"].$a[\"type\"]:\"\").$a[\"function\"].\"(\".@join(\",\",$a[\"args\"]).\");, Row: \".@$a[\"line\"];'), debug_backtrace(false));\n array_shift($r);\n return $r;\n}", "private function jTraceEx($exception, $seen = null)\n\t{\n\t\t$starter = ($seen) ? 'Caused by: ' : '';\n\t\t$result = array();\n\n\t\tif (!$seen) $seen = array();\n\n\t\t$trace = $exception->getTrace();\n\t\t$prev = $exception->getPrevious();\n\n\t\t$result[] = sprintf('%s%s: %s', $starter, get_class($exception), $exception->getMessage());\n\n\t\t$file = $exception->getFile();\n\t\t$line = $exception->getLine();\n\n\t\twhile (true) {\n\t\t\t$current = \"$file:$line\";\n\t\t\tif (is_array($seen) && in_array($current, $seen)) {\n\t\t\t\t$result[] = sprintf(' ... %d more', count($trace) + 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$result[] = sprintf(' at %s%s%s(%s%s%s)',\n\t\t\t\tcount($trace) && array_key_exists('class', $trace[0]) ? str_replace('\\\\', '.', $trace[0]['class']) : '',\n\t\t\t\tcount($trace) && array_key_exists('class', $trace[0]) && array_key_exists('function', $trace[0]) ? '.' : '',\n\t\t\t\tcount($trace) && array_key_exists('function', $trace[0]) ? str_replace('\\\\', '.', $trace[0]['function']) : '(main)',\n\t\t\t\t($line === null) ? $file : basename($file),\n\t\t\t\t($line === null) ? '' : ':',\n\t\t\t\t($line === null) ? '' : $line);\n\t\t\tif (is_array($seen))\n\t\t\t\t$seen[] = \"$file:$line\";\n\t\t\tif (!count($trace))\n\t\t\t\tbreak;\n\t\t\t$file = array_key_exists('file', $trace[0]) ? $trace[0]['file'] : 'Unknown Source';\n\t\t\t$line = (array_key_exists('file', $trace[0]) && array_key_exists('line', $trace[0]) && $trace[0]['line']) ? $trace[0]['line'] : null;\n\t\t\tarray_shift($trace);\n\t\t}\n\n\t\t$result = join(\"\\n\", $result);\n\n\t\tif ($prev)\n\t\t\t$result .= \"\\n\" . $this->jTraceEx($prev, $seen);\n\n\t\treturn $result;\n\t}", "public final function fillInStackTrace() {\n return null;\n }", "public function setDebugInfo($file,$line)\n\t{\n\t\t$this->file = $file;\n\t\t$this->line = $line;\n\t}", "function __construct() {\n\t\t$this->exception_method = [];\n\t\tparent::__construct();\n\t\t\n\t}", "public function assertOneSpan($traces, SpanAssertion $expectedSpan)\n {\n $this->assertOneExpectedSpan($traces, $expectedSpan);\n }", "public function setException($exception)\n {\n $this->exception = $exception;\n }", "function _trace($message) {\n if ($trace = TRUE) {\n _log($message);\n } \n}", "private function stackTraceValid( $trace ) {\r\n return true;\r\n }", "public function listenLowSeverity(): Debug\n {\n set_error_handler([$this, 'onUncaughtLowSeverity']);\n set_exception_handler([$this, 'onUncaughtException']);\n\n return $this;\n }", "function exception_handler($exception)\r\n{\r\n?>\r\n<script type=\"text/javascript\">\r\nfunction toggleLayer( whichLayer )\r\n{\r\n var elem;\r\n if( document.getElementById ) elem = document.getElementById( whichLayer );\r\n else if( document.all ) elem = document.all[whichLayer];\r\n else if( document.layers ) elem = document.layers[whichLayer];\r\n if(elem.style.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined) elem.style.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';\r\n elem.style.display = (elem.style.display==''||elem.style.display=='block')?'none':'block';\r\n}\r\n</script>\r\n<?php\r\n echo \"<pre>\";\r\n $tolog=\"\";\r\n $stacktrace=\"\";\r\n $stacktrace.=\"Application raised an exception class <b>\".get_class($exception).\"</b> with message <b>'\".$exception->getMessage().\"'</b>\\n\";\r\n $msg=strip_tags($stacktrace).\"|\";\r\n $stack=array_reverse($exception->getTrace());\r\n reset($stack);\r\n $tab=\"\";\r\n $c=\"\";\r\n $stacktrace.='<a href=\"javascript:toggleLayer(\\'callstack\\');\">Click for detailed information</a><div id=\"callstack\" style=\"display:none;\">';\r\n while (list($k,$v)=each($stack))\r\n {\r\n $stacktrace.=$tab.$c.\"Callstack #$k File: <b><A HREF=\\\"rphp://$v[file],$v[line]\\\">\".$v['file'].\"</A></b> Line: <b>\".$v['line'].\"</b>\\n\";\r\n $tolog.=$v['line'].\"@\".$v['file'].'@'.$msg;\r\n $tab.=\" \";\r\n $c=\"|_\";\r\n }\r\n echo $stacktrace;\r\n echo '</div>';\r\n echo \"</pre>\";\r\n error_log($tolog);\r\n}", "public function setExceptionMessages($exceptionMessages = array())\n {\n foreach ($exceptionMessages as $key => $value) {\n if ($value instanceof Exception) {\n /* @var $value Exception */\n $exceptionMessages[$key] = $value = $value->getMessage();\n }\n }\n\n $this->exceptionMessages = $exceptionMessages;\n }", "public function offsetSet($offset, $value)\r\n {\r\n throw new \\BadMethodCallException(\"Immutable stack, cannot set element\");\r\n }", "public function setError($error) {\n \t$dbg = debug_backtrace();\n $caller = next($dbg);\n \t$this->error = sprintf('[%s::%s - %s] %s', basename($caller['file']), $caller['function'], $caller['line'], $error);\n }", "function trace( $message )\n{\n\t$registry = Registry::getInstance();\n\tif ( $registry->keyExists( 'trace_messages' ) )\n\t{\n\t\t$trace_messages = $registry->get( 'trace_messages' );\n\t}\n\t$trace_messages[] = $message;\n\t$registry->set( \"trace_messages\", $trace_messages );\n}", "public static function setException($v)\n {\n self::$exception = $v;\n }", "public function reporting()\n {\n $this->levels = func_get_args();\n }", "public function setException(Exception $e)\r\n {\r\n \r\n $result = new Blerby_TestRunner_Result();\r\n \r\n $trace = $e->getTrace();\r\n \r\n if (isset($trace[0]['args'][0])) {\r\n $file = $trace[0]['args'][0];\r\n \r\n } else {\r\n $file = Blerby_TestRunner_Util::cleanPath($e->getFile()); \r\n }\r\n \r\n $result->set('status',Blerby_TestRunner_Status::ERROR);\r\n $result->set('file',Blerby_TestRunner_Util::cleanPath($file));\r\n $result->set(\"message\",$e->getMessage());\r\n \r\n preg_match(\"/on line ([0-9]+)/\",$result->get(\"message\"),$matches);\r\n \r\n if (isset($matches[1])) {\r\n \r\n $result->set('line',$matches[1]);\r\n } else {\r\n $result->set('line',\"???\");\r\n }\r\n \r\n $this->addResult($file,$result);\r\n }", "public function setException($err) {\n $this->exception = $err;\n }", "public function setThrowExceptions($value) \n {\n $this->throwExceptions = ($value == true) ? true: false;\n }", "protected function getDebugBacktrace() {}", "public function get_errorLogTrace($output_profile, $log_silo_profile = CRNRSTN_LOG_ALL, $line_num = NULL, $method = NULL, $file = NULL, $output_profile_override_meta = NULL){\n\n try{\n\n if($this->CRNRSTN_debugMode<2){\n\n //\n // HOOOSTON...VE HAF PROBLEM!\n //throw new Exception('Unable to retrieve log trace data due to CRNRSTN being in configuration of CRNRSTN_debugMode=\"'.$this->CRNRSTN_debugMode.'\"...which setting does not authorize resource allocation enabling aggregation of error log data in server memory.');\n\n }else{\n\n if(!isset($method)){\n\n $method = __METHOD__;\n\n }\n\n if(!isset($line_num)){\n\n $line_num = __LINE__;\n\n }\n\n if(!isset($output_profile)){\n\n $output_profile = $this->return_loggingProfile();\n\n }else{\n\n $output_profile = trim(strtoupper($output_profile));\n switch($output_profile){\n case CRNRSTN_LOG_EMAIL:\n case CRNRSTN_LOG_EMAIL_PROXY:\n case CRNRSTN_LOG_FILE:\n case CRNRSTN_LOG_SCREEN_TEXT:\n case CRNRSTN_LOG_SCREEN:\n case CRNRSTN_LOG_SCREEN_HTML:\n case CRNRSTN_LOG_SCREEN_HTML_HIDDEN:\n case CRNRSTN_LOG_DEFAULT:\n break;\n default:\n\n //\n // HOOOSTON...VE HAF PROBLEM!\n throw new Exception('The provided logging output profile, \"'.$output_profile.'\", is not supported by CRNRSTN ::. Please choose between the following options :: [EMAIL, FILE, SCREEN_TEXT, SCREEN, SCREEN_HTML, SCREEN_HTML_HIDDEN, DEFAULT]');\n\n break;\n\n }\n\n }\n\n $this->oLogger->get_errorLogTrace($output_profile, $output_profile_override_meta, $log_silo_profile, $line_num, $method, $file, $this);\n\n }\n\n } catch( Exception $e ) {\n\n //\n // LET CRNRSTN :: HANDLE THIS PER THE LOGGING PROFILE CONFIGURATION FOR THIS SERVER\n $this->catchException($e, LOG_ERR, __METHOD__, __NAMESPACE__);\n\n return false;\n\n }\n\n return NULL;\n\n }", "public function testSettingInvalidTs()\n {\n $this->expectException(\\InvalidArgumentException::class);\n $groupsMark = new GroupsMark();\n $groupsMark->setTs(null);\n }", "public function listenExceptions(): Debug\n {\n set_exception_handler([$this, 'onUncaughtException']);\n\n return $this;\n }", "public static function set ()\n {\n set_error_handler([__CLASS__, 'handle']);\n }", "public function frameSet() {}", "public static function setExceptions($enabled = true)\n\t{\n\t\tself::$useExceptions = $enabled;\n\t}", "function setHoursLeftWarning($s)\n\t{\n\t\t$this->HoursLeftWarning = $s;\n\t\tupdateTableByUser('DeveloperAlerts', 'HoursLeftWarning', $s, $this->getUsername());\n\t}", "private static function _stackTrace( $stack_trace_data = NULL )\n\t{\n\t\tif( is_null( $stack_trace_data ) ) {\n\t\t\t$stack_trace_data = debug_backtrace();\n\t\t\tarray_shift( $stack_trace_data ); //remove the call to _stackTrace\n\t\t}\n\t\t/* Prepare backtrace array */\n\t\t$stack_trace_array = array_reverse( $stack_trace_data );\n\t\t//pull off last 2 items, since they are internal\n\t\t//array_pop( $stack_trace_array );\n\t\t\n\t\t/* Create backtrace string */\n\t\t$strack_trace_string_array = \"\";\n\t\tforeach( $stack_trace_array as $stack_trace ) {\n\t\t\tif( array_key_exists( \"file\", $stack_trace ) && array_key_exists( \"line\", $stack_trace ) ) {\n\t\t\t\t$strack_trace_string_array[] = sprintf( \n\t\t\t\t\t\"%s( %s line %s )\",\n\t\t\t\t\tCommon::safeArrayAccess( \"function\", $stack_trace, \"\" ),\n\t\t\t\t\tstr_replace( LOCAL_DOCUMENT_ROOT, \"\", $stack_trace[\"file\"] ),\n\t\t\t\t\t(string)$stack_trace[\"line\"]\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$strack_trace_string_array[] = sprintf( \n\t\t\t\t\t\"%s( internal )\",\n\t\t\t\t\t$stack_trace[\"function\"]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn implode( \" -> \", $strack_trace_string_array );\n\t}", "function tideways_fatal_backtrace()\n{\n}", "final public function getTraceAsString()\n {\n return 'trace';\n }", "public function getTraces(): array\n {\n return $this->traces;\n }", "private function set_error( $key )\n\t{\n\t\tglobal $path;\n\t\tif( isset($this->err_code[$key]) && isset($this->err_code[$key]) )\n\t\t{\t\n\t\t\t$this->arr_error[].= $this->err_label[$key]; // => array_push\n\t\t\t// DEV -->\n\t\t\t$this->num_error += $this->err_code[$key];\n\t\t\t// <-- DEV\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttrigger_error( $key . ' undefined');\n\t\t\texit;\n\t\t}\n\t}", "private function setLevel( int$level )\n\t{\n\t\t$level-= $this->indentLevel;\n\n\t\tif( $level<=0 ){\n\t\t\t$this->closeGroups(-$level);\n\t\t}elseif( $level==1 ){\n\t\t\t$this->indentLevel+= 1;\n\t\t}else{\n\t\t\tthrow new Exception('Indent error.');\n\t\t}\n\t}", "public function setStackSize(int $bb)\n\t{\n\t\t$this->stackSize = max($bb, 20);\n\t}", "public function setErrorLevel($level){\n\t\t$this->error_level = $level;\t\n\t}", "private static function throwInProcess($trace = null): array\n {\n if($trace instanceof Throwable){\n if(AppContainer::get('debugBackTrace')){\n $file = $trace->getTrace()[0]['file'] ?? '';\n $line = $trace->getTrace()[0]['line'] ?? '';\n }\n\n return array_merge_recursive([\n 'file' => $file ?? $trace->getFile(),\n 'line' => $line ?? $trace->getLine()\n ],static::getExtraStaticExceptionSupplement());\n }\n\n return array_merge_recursive([\n 'file' => ($trace[0]['file'] ?? null),\n 'line' => ($trace[0]['line'] ?? null)\n ],static::getExtraStaticExceptionSupplement());\n }", "public function setTraceLevel(int $traceLevel): self\n {\n $this->traceLevel = $traceLevel;\n return $this;\n }", "public function logTrace()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n \\DebugHelper::dump()->showtrace($output);\n $output->close();\n }" ]
[ "0.5573773", "0.55255336", "0.53828454", "0.53828454", "0.52961034", "0.5267766", "0.5245591", "0.51540023", "0.5145107", "0.5124897", "0.5065407", "0.5048626", "0.503867", "0.50313044", "0.5015122", "0.5005588", "0.49872667", "0.49206713", "0.4911014", "0.4906071", "0.49001673", "0.48752362", "0.48752362", "0.486903", "0.4847232", "0.4841324", "0.48049632", "0.4797776", "0.47909275", "0.47646233", "0.47185525", "0.47155294", "0.47153097", "0.46564", "0.46551707", "0.4653153", "0.46382123", "0.46341383", "0.46295154", "0.46167827", "0.46120936", "0.46116933", "0.45927012", "0.45885998", "0.4575028", "0.45726576", "0.45707008", "0.45666644", "0.45546022", "0.45271054", "0.45228636", "0.45207772", "0.4519745", "0.45178849", "0.45171145", "0.45154232", "0.44981018", "0.4471187", "0.44509345", "0.44465053", "0.44400477", "0.44335476", "0.4431425", "0.4431141", "0.44301817", "0.4411602", "0.44107533", "0.44035336", "0.44008288", "0.43916664", "0.43844083", "0.43806702", "0.43799362", "0.43647856", "0.43642238", "0.43571562", "0.4350074", "0.43416", "0.4336105", "0.43174583", "0.43095332", "0.43068078", "0.42937803", "0.42870602", "0.42870346", "0.42856774", "0.42651302", "0.42595044", "0.42511097", "0.42442223", "0.42385238", "0.42384174", "0.42332086", "0.4232667", "0.42324042", "0.42311347", "0.4228492", "0.42273003", "0.42232388", "0.42228985" ]
0.6150863
0
Get current stack straces
public function getStacktrace() { return $this->stacktrace; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStackFrameList(){\n return $this->_get(1);\n }", "public function getStack()\n {\n return $this->stack;\n }", "public function stackFrames()\n {\n return $this->stackFrames;\n }", "public function getStack(){\r\n return $this->stack;\r\n }", "public function getRequestStack()\n\t{\n\t\treturn $this->requestStack;\n\t}", "public function getSystrace()\n {\n return isset($this->systrace) ? $this->systrace : null;\n }", "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 getActionStack ()\n {\n return $this->context->getActionStack();\n }", "public function getMiddlewareStack() : array;", "public function getAll(){\n\t\treturn $this->stack;\n\t}", "public function getTrace();", "final public function getTrace()\n {\n return [];\n }", "public function get_backtrace() { return $this->getTraceAsString(); }", "final function getTrace();", "public function getDebugTrace() {\n\t\t$trace = debug_backtrace();\n\t\t$i = 1;\n\t\twhile (isset($trace[$i]) and isset($trace[$i + 1]) and isset($trace[$i + 1]['class']) and ($trace[$i + 1]['class'] === 'Sy\\Db\\Gate')) ++$i;\n\t\t$res['class'] = isset($trace[$i + 1]['class']) ? $trace[$i + 1]['class'] : '';\n\t\t$res['function'] = isset($trace[$i + 1]['function']) ? $trace[$i + 1]['function'] : '';\n\t\t$res['file'] = $trace[$i]['file'];\n\t\t$res['line'] = $trace[$i]['line'];\n\t\treturn $res;\n\t}", "public function getFullStack()\n {\n return $this->_fullStack;\n }", "function errorlog_inCallerStack() {\r\n $functionStack = array_column( debug_backtrace(), 'function' );\r\n $inCallerStack = array_search('_errorlog_logErrorRecord', $functionStack) !== false;\r\n return $inCallerStack;\r\n}", "public function getStackSize(): int\n\t{\n\t\treturn $this->stackSize;\n\t}", "public function getTrace(): array\n {\n return $this->trace;\n }", "public function get_debug_backtrace()\n {\n return debug_backtrace();\n }", "public function debugBacktrace()\n {\n return debug_backtrace();\n }", "public function GetTrace () \r\n\t{\r\n\t\treturn (self::$trace);\r\n\t}", "public function GetTrace () \r\n\t{\r\n\t\treturn (self::$trace);\r\n\t}", "function getTrace(){\n\t$array = debug_backtrace();\n\tunset($array[0]);\n\t$html = '';\n\tforeach ($array as $row) {\n\t\tif (isset($row['file']) && isset($row['line']) && isset($row['function']))\n\t\t\t$html .= $row['file'] . ':' . $row['line'] . '行,调用方法:' . $row['function'] . \"\\n\";\n\t}\n\treturn $html;\n}", "abstract protected function getStackPos(): int;", "public static function backtrace() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::backtrace();\n\t}", "public function getMiddlewareStack(): array\n {\n return array_filter($this->middlewares);\n }", "public static function getStack($stacktrace) {\n $output = \"\";\n $i = 1;\n foreach($stacktrace as $node) {\n $output .= \"\\t $i. \".basename($node['file']) .\" : \" .$node['function'] .\" (\" .$node['line'].\")\\n\";\n $i++;\n }\n\t\treturn $output;\n }", "public function getCallStackLimit(): int {\n\t\treturn $this->callStackLimit;\n\t}", "private function tinydb_get_calling_scope($stack_modifier = 0)\n {\n $class_name = debug_backtrace(null, 3 + $stack_modifier)[2 + $stack_modifier]['class'];\n $current_class_name = get_class($this);\n if ($class_name === $current_class_name) {\n return T_PRIVATE;\n } else if (is_a($class_name, $current_class_name, true)) {\n return T_PROTECTED;\n } else {\n return T_PUBLIC;\n }\n }", "public function all()\n\t{\n\t\treturn $this->stack;\n\t}", "protected function getServerInfo()\n {\n $stackTrace = debug_backtrace();\n\n $file = $this->getCalledFile($stackTrace);\n $line = $this->getCalledLine($stackTrace);\n\n return [\n 'file' => $file,\n 'line' => $line,\n 'server' => ! empty($_SERVER) ? json_encode($_SERVER) : null,\n 'post' => ! empty($_POST) ? json_encode($_POST) : null,\n 'get' => ! empty($_GET) ? json_encode($_GET) : null,\n 'files' => ! empty($_FILES) ? json_encode($_FILES) : null,\n 'cookies' => ! empty($_COOKIE) ? json_encode($_COOKIE) : null,\n 'session' => ! empty($_SESSION) ? json_encode($_SESSION) : null,\n 'environment' => ! empty($_ENV) ? json_encode($_ENV) : null\n ];\n }", "public function getBacktrace()\n {\n $backtrace = $this->get_debug_backtrace();\n\n $output = \"\";\n\n $count = 0;\n foreach ($backtrace as $line) {\n if ($count <= 1) {\n $count++;\n continue;\n }\n\n $output .= \"#{$count}: \";\n\n if (isset($line['type']) && $line['type'] != \"\") {\n $output .= $line['class'] . $line['type'];\n }\n\n $output .= $line['function'] . \"(...)\";\n $output .= \" [{$line['file']}#{$line['line']}\\r\\n\";\n\n $count++;\n }\n\n return $output;\n }", "public function getOperatingContexts();", "public function getTrace():array {\n\t\t\treturn $this->trace;\n\t\t}", "protected function returnStackTrace() {\n\t\ttry {\n\t\t\tthrow new \\Exception();\n\t\t} catch (\\Exception $e) {\n\t\t\treturn $e->getTrace();\n\t\t}\n\t}", "function get_caller(){\n\t\t$trace = array_reverse(debug_backtrace());\n\t\t$caller = array();\n\t\n\t\tforeach($trace as $call){\n\t\t\tif(isset($call['class']) && __CLASS__ == $call['class']){\n\t\t\t\tcontinue; // Filter out wpdb calls.\n\t\t\t}\n\t\t\t$caller[] = isset($call['class']) ? \"{$call['class']}->{$call['function']}\" : $call['function'];\n\t\t}\n\t\n\t\treturn join(', ', $caller);\n\t}", "public static function trace()\n\t{\n\t\tob_start();\n\t\tdebug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$trace = ob_get_clean();\n\t\t$trace = str_replace('#','<br/><div><b><u>',$trace);\n\t\t$trace = str_replace('called at [','called at : </u></b><ul><li>File : ',$trace);\n\t\t$trace = preg_replace('/:([0-9]*)\\]/','</li><li>Ligne : $1</li></ul></div>',$trace);\n\t\techo $trace;\n\t\treturn $trace;\n\t}", "public function getTransformStack()\n {\n return $this->ctm;\n }", "final function getTraceAsString();", "public function getTraceAsString(): string\n {\n $remove = \"Stack trace:\\n\";\n $len = strpos($this->toString, $remove);\n if ($len === false) {\n return '';\n }\n return substr($this->toString, $len + strlen($remove));\n }", "public function getTraces()\n {\n return $this->traces;\n }", "public function getTraceAsString();", "public function getStartingStackSize(): int\n\t{\n\t\treturn $this->bb * $this->stackSize;\n\t}", "function getBacktrace($frame = null)\n {\n if (defined('PEAR_IGNORE_BACKTRACE')) {\n return null;\n }\n if ($frame === null) {\n return $this->backtrace;\n }\n return $this->backtrace[$frame];\n }", "private function origin($depth)\n {\n $trace = debug_backtrace()[$depth];\n if (isset($trace['class'], $trace['function'])) {\n return [$trace['class'], $trace['function']];\n }\n\n return false;\n }", "function trace(){\n $r = array_map(create_function('$a', 'return (isset($a[\"class\"])?$a[\"class\"].$a[\"type\"]:\"\").$a[\"function\"].\"(\".@join(\",\",$a[\"args\"]).\");, Row: \".@$a[\"line\"];'), debug_backtrace(false));\n array_shift($r);\n return $r;\n}", "public function getCaller():array { return $this->caller; }", "function dumpApplicationDiagnostics(){\n\techo 'SESSION Object';\n\tdump( $_SESSION[ SESSION_NAME_SPACE ] );\n}", "function get_caller() {\n\t\t$trace = array_reverse( debug_backtrace() );\n\t\t$caller = array();\n\n\t\tforeach ( $trace as $call ) {\n\t\t\tif ( isset( $call['class'] ) && __CLASS__ == $call['class'] )\n\t\t\t\tcontinue; // Filter out wpdb calls.\n\t\t\t$caller[] = isset( $call['class'] ) ? \"{$call['class']}->{$call['function']}\" : $call['function'];\n\t\t}\n\n\t\treturn join( ', ', $caller );\n\t}", "public function getFrames()\n {\n if($this->frames === null) {\n $frames = $this->exception->getTrace();\n\n // If we're handling an ErrorException thrown by Whoops,\n // get rid of the last frame, which matches the handleError method,\n // and do not add the current exception to trace. We ensure that\n // the next frame does have a filename / linenumber, though.\n if($this->exception instanceof ErrorException && empty($frames[1]['line'])) {\n $frames[1] = isset($frames[1]) ? $frames[1] + $frames[0] : $frames[0];\n array_shift($frames);\n } else {\n $firstFrame = $this->getFrameFromException($this->exception);\n array_unshift($frames, $firstFrame);\n }\n $this->frames = new FrameCollection($frames);\n }\n\n return $this->frames;\n }", "final public function getTraceAsString()\n {\n return 'trace';\n }", "public function getValidationStack()\n {\n return $this->validate;\n }", "static function get_backtrace()\r\n {\r\n $html = array();\r\n $backtraces = debug_backtrace();\r\n foreach ($backtraces as $backtrace)\r\n {\r\n $html[] = implode(' ', $backtrace);\r\n }\r\n return implode('<br/>', $html);\r\n }", "public static function current()\r\n\t{\r\n\t\t$parentLog = end(self::$performanceStack);\r\n\t\treturn $parentLog;\r\n\t}", "public function getStackingMode()\n {\n return $this->stackingMode;\n }", "public static function getInstance(){\n\t\tif(null === self::$instance){\n\t\t\tself::$instance = new Stack();\n\t\t}\n\t\treturn self::$instance;\n\t}", "function session()\n {\n return app()->services()->session()->stack();\n }", "static public function getStack($type, $requirements = array()) {\n self::debug('*GETSTACK*');\n return self::_getStack($type, $requirements);\n }", "public function getTraces(): array\n {\n return $this->traces;\n }", "protected function getDebugBacktrace() {}", "public function __toString()\n\t{\n\t\treturn json_encode($this->stack, JSON_PRETTY_PRINT);\n\t}", "public function analyzeCallStack() {\r\n $this->_analyzator->analyze();\r\n\r\n return $this;\r\n }", "public function getAggregatedStack()\n {\n $functions\t= $this->computeInclusiveMetrics();\n\n foreach($functions as &$function) {\n $function['metrics']\t= array\n (\n 'ct'\t\t=> $function['metrics']['ct'],\n 'inclusive'\t=> $function['metrics'],\n 'exclusive'\t=> $function['metrics']\n );\n\n unset($function['metrics']['inclusive']['ct'], $function['metrics']['exclusive']['ct']);\n\n foreach($this->request['callstack'] as $call) {\n if($function['callee_id'] == $call['caller_id']) {\n foreach(array('wt', 'cpu', 'mu', 'pmu') as $k) {\n $function['metrics']['exclusive'][$k]\t-= $call['metrics'][$k];\n }\n }\n }\n\n unset($function);\n }\n\n return $functions;\n }", "private function getStackTrace() {\n\t\t$trace = '';\n\t\tforeach (debug_backtrace() as $k => $v) {\n\t\t\tif ( $k < $ignore ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tarray_walk( $v['args'], function ( &$item, $key ) {\n\t\t\t\t$item = var_export( $item, true );\n\t\t\t});\n\n\t\t\t$trace .= '#' .\n\t\t\t\t($k - $ignore) .\n\t\t\t\t' ' .\n\t\t\t\t$v['file'] .\n\t\t\t\t'(' . $v['line'] . '): ' .\n\t\t\t\t( isset($v['class']) ? $v['class'] . '->' : '' ) .\n\t\t\t\t$v['function'] .\n\t\t\t\t'(' . implode(', ', $v['args']) . ')' .\n\t\t\t\t\"\\n\";\n\t\t}\n\n\t\treturn $trace;\n\t}", "public function setSystrace($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Devtools\\Testing\\V1\\SystraceSetup::class);\n $this->systrace = $var;\n\n return $this;\n }", "public static function getDepth() : int\n {\n return count(static::$stack);\n \n }", "public function getAggregatedStack()\n\t{\n\t\t$functions\t= $this->computeInclusiveMetrics();\n\t\t\n\t\tforeach($functions as &$function)\n\t\t{\n\t\t\t$function['metrics']\t= array\n\t\t\t(\n\t\t\t\t'ct'\t\t=> $function['metrics']['ct'],\n\t\t\t\t'inclusive'\t=> $function['metrics'],\n\t\t\t\t'exclusive'\t=> $function['metrics']\n\t\t\t);\n\t\t\t\n\t\t\tunset($function['metrics']['inclusive']['ct'], $function['metrics']['exclusive']['ct']);\n\t\t\t\n\t\t\tforeach($this->request['callstack'] as $call)\n\t\t\t{\n\t\t\t\tif($function['callee_id'] == $call['caller_id'])\n\t\t\t\t{\n\t\t\t\t\tforeach(array('wt', 'cpu', 'mu', 'pmu') as $k)\n\t\t\t\t\t{\n\t\t\t\t\t\t$function['metrics']['exclusive'][$k]\t-= $call['metrics'][$k];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tunset($function);\n\t\t}\n\t\t\n\t\treturn $functions;\n\t}", "private function getReadableTrace() : string {\n $result = '';\n\n $traceIteration = 1;\n $argsDelimeter = ', ';\n\n $trace = $this->getTrace();\n foreach ($trace as $part) {\n $file = array_key_exists('file', $part) ? $part['file'] : '';\n $line = array_key_exists('line', $part) ? $part['line'] : '';\n $function = array_key_exists('function', $part) ? $part['function'] : '';\n $args = array_key_exists('args', $part) && is_array($part['args']) ? print_r($part['args'], true) : '';\n\n $result .= ' #' . $traceIteration++ . ' ' . $file . '(' . $line . '): ' . $function . '(' . $args . ')';\n }\n $result = ltrim($result, ' ');\n\n return $result;\n }", "function get_caller_class(int $index = 2): ?string\n{\n $caller = debug_backtrace();\n $caller = $caller[$index];\n\n return $caller['class'] ?? null;\n}", "private function getSharedAttributes($stack = []) {\n \n $mods = get_theme_mods(); \n\n if(is_array($mods) && !empty($mods)) {\n foreach($mods as $key => $mod) {\n if(in_array($key, $this->sharedModKeys)) {\n $stack[$key] = $mod; \n }\n }\n }\n\n return $stack; \n }", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "public function getColorfulText()\n {\n $output = \"\\033[1;31m--[ Agile Toolkit Exception ]---------------------------\\n\";\n $output .= get_class($this).\": \\033[47m\".$this->getMessage().\"\\033[0;31m\".\n ($this->getCode() ? ' [code: '.$this->getCode().']' : '');\n\n foreach ($this->params as $key => $val) {\n $key = str_pad($key, 19, ' ', STR_PAD_LEFT);\n $output .= \"\\n\".$key.': '.$this->toString($val);\n }\n\n $output .= \"\\n\\033[0mStack Trace: \";\n\n $in_atk = true;\n $escape_frame = false;\n\n foreach ($this->getMyTrace() as $call) {\n if (!isset($call['file'])) {\n $call['file'] = '';\n } elseif (\n $in_atk &&\n strpos($call['file'], '/data/src/') === false &&\n strpos($call['file'], '/core/src/') === false &&\n strpos($call['file'], '/dsql/src/') === false\n ) {\n $escape_frame = true;\n $in_atk = false;\n }\n\n $file = str_pad(substr($call['file'], -40), 40, ' ', STR_PAD_LEFT);\n\n $line = str_pad(@$call['line'], 4, ' ', STR_PAD_LEFT);\n\n $output .= \"\\n\\033[0;34m\".$file.\"\\033[0m\";\n $output .= \":\\033[0;31m\".$line.\"\\033[0m\";\n\n if (isset($call['object'])) {\n $name = (!isset($call['object']->name)) ? get_class($call['object']) : $call['object']->name;\n $output .= \" - \\033[0;32m\".$name.\"\\033[0m\";\n }\n\n $output .= \" \\033[0;32m\";\n\n if (isset($call['class'])) {\n $output .= $call['class'].'::';\n }\n\n if ($escape_frame) {\n $output .= \"\\033[0,31m\".$call['function'];\n $escape_frame = false;\n\n $args = [];\n foreach ($call['args'] as $arg) {\n $args[] = $this->toString($arg);\n }\n\n $output .= \"\\n\".str_repeat(' ', 20).\"\\033[0,31m(\".implode(', ', $args);\n } else {\n $output .= \"\\033[0,33m\".$call['function'].'(';\n }\n\n $output .= ')';\n }\n\n if ($p = $this->getPrevious()) {\n $output .= \"\\n\\033[0mCaused by Previous Exception:\\n\";\n $output .= \"\\033[1;31m\".get_class($p).': '.$p->getMessage().\"\\033[0;31m\".\n ($p->getCode() ? ' [code: '.$p->getCode().']' : '');\n }\n\n // next print params\n\n $output .= \"\\n\\033[1;31m--------------------------------------------------------\\n\";\n\n return $output.\"\\033[0m\";\n }", "public function getHandlerStack()\n {\n\n $handlerStack = HandlerStack::create();\n\n foreach ($this->middleware as $name => $middleware) {\n $handlerStack->push($middleware, $name);\n }\n\n return $handlerStack;\n }", "function getCaller() {\r\n\t\t$trace = debug_backtrace();\r\n\t\t$useNext = false;\r\n\t\t$caller = false;\r\n\t\t//write_log(\"TRACE: \".print_r($trace,true),null,true);\r\n\t\tforeach($trace as $event) {\r\n\t\t\tif ($useNext) {\r\n\t\t\t\tif (($event['function'] != 'require') && ($event['function'] != 'include')) {\r\n\t\t\t\t\t$caller .= \"::\".$event['function'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($event['function'] == 'write_log') {\r\n\t\t\t\t$useNext = true;\r\n\t\t\t\t// Set our caller as the calling file until we get a function\r\n\t\t\t\t$file = pathinfo($event['file']);\r\n\t\t\t\t$caller = $file['filename'].\".\".$file['extension'];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $caller; \r\n\t}", "protected function getBackTrace(){\n\t\treturn array('Inicio', 'Facturaci&oacute;n');\n\t}", "public static function get_named_stack( $stack_name )\n\t{\n\t\tif ( isset( self::$stacks[$stack_name] ) ) {\n\t\t\treturn self::$stacks[$stack_name];\n\t\t}\n\t\telse {\n\t\t\treturn self::create_stack( $stack_name );\n\t\t}\n\t}", "public function getFrames()\n {\n if($this->frames === null) {\n $frames = $this->exception->getTrace();\n\n // If we're handling an ErrorException thrown by Whoops,\n // get rid of the last frame, which matches the handleError method,\n // and do not add the current exception to trace. We ensure that\n // the next frame does have a filename / linenumber, though.\n if(($this->exception instanceof ErrorException || $this->exception instanceof Object) && empty($frames[1]['line'])) {\n $frames = array($this->getFrameFromError($this->exception));\n } else {\n $firstFrame = $this->getFrameFromException($this->exception);\n array_unshift($frames, $firstFrame);\n }\n $collection = array();\n\n if (count($frames)) {\n foreach ($frames as $frame) {\n array_push($collection, new Frame($frame));\n }\n }\n\n $this->frames = new Database\\Collection($collection);\n }\n\n return $this->frames;\n }", "public function __getTraceAsString() {\r\n\t\t$string = preg_replace('/Database->__construct\\(.*\\)/', 'Database->__construct(...)', $this->getTraceAsString());\r\n\t\t$string = preg_replace('/mysqli->mysqli\\(.*\\)/', 'mysqli->mysqli(...)', $string);\r\n\t\treturn $string;\r\n\t}", "public function get_trace() : array\n {\n }", "public function getSourceFrames() {\n return $this->sourceFrames;\n }", "public function getHandlerStack(): HandlerStack\n {\n if ($this->handlerStack) {\n return $this->handlerStack;\n }\n\n $this->handlerStack = HandlerStack::create($this->getGuzzleHandler());\n\n foreach ($this->middlewares as $name => $middleware) {\n $this->handlerStack->push($middleware, $name);\n }\n\n return $this->handlerStack;\n }", "function compactStackTrace($removeThisCall = true){\n\t$dbg = debug_backtrace();\n\t$r = '';\n\n\tif ($removeThisCall) array_shift($dbg);\n\n\t$fields = array('file', 'line', 'class', 'function');\n\n\tforeach ($dbg as $d){\n\t\tforeach ($fields as $f)\n\t\t\t$d[$f] = nu($d[$f]) ?: 'N/A';\n\t\t$r .= \"\\n:.:{$d['file']}:{$d['line']} {$d['class']} -> {$d['function']}\";\n\t}\n\n\t$r .= \"\\n:.:\\n\";\n\treturn $r;\n}", "function args()\n{\n return dindex(dindex(debug_backtrace(), 1), 'args');\n}", "public function getLastTrace() {\n return $this->last_trace;\n }", "public function getObjectStack($value)\n {\n $event = new GetObjectStackEvent($value);\n $this->eventDispatcher->dispatch($event, $event::NAME);\n\n if ($event->hasStack()) {\n return $event->getStack();\n }\n\n if ($this->chain->hasNext($this, __FUNCTION__)) {\n return $this->chain->next($this, __FUNCTION__, [$value]);\n }\n\n return array();\n }", "function get_backtrace_list( $trace )\n\t{\n\t\tif ( !is_array( $trace ) && is_scalar( $trace ) )\n\t\t\treturn \"<div class='trace-error'>$trace</div>\";\n\n\t\t$ftrace = $this->prepare_backtrace( $trace );\n\n\t\t$d = array(\n\t\t\t'func' => '',\n\t\t\t'file' => '',\n\t\t\t'line' => '',\n\t\t\t'args' => array(),\n\t\t);\n\t\t$list = array();\n\n\t\tforeach ( $ftrace as $key => $t )\n\t\t{\n\t\t\t$t = array_merge( $d, $t );\n\n\t\t\t$lineclass = ( $key % 2 ) ? 'even' : 'odd';\n\t\t\t$args_html = !empty( $t['args'] )\n\t\t\t\t? sprintf(' <span class=\"args\">%s</span> ', implode(', ', $t['args']) )\n\t\t\t\t: '';\n\n\t\t\t$filemeta = $t['file'] ? \"<span class='file'>{$t['file']}</span> <span class='line'>{$t['line']}</span>\" : '';\n\n\t\t\t$line = <<<HTML\n\t\t\t<div class=\"trace $lineclass\">\n\t\t\t\t<div class=\"called\">{$t['func']}($args_html)</div>\n\t\t\t\t<div class='filemeta'>$filemeta</div>\n\t\t\t</div>\nHTML;\n\n\t\t\t$list[] = $line;\n\t\t}\n\n\t\treturn implode( $list );\n\t}", "private static function _getCalleeInfo($trace)\n {\n $previousCaller = array();\n $miniTrace = array();\n $prevStep = array();\n\n // go from back of trace to find first occurrence of call to Sage or its wrappers\n while ($step = array_pop($trace)) {\n if (SageHelper::stepIsInternal($step)) {\n $previousCaller = $prevStep;\n break;\n }\n\n if (isset($step['file'], $step['line'])) {\n unset($step['object'], $step['args']);\n array_unshift($miniTrace, $step);\n }\n\n $prevStep = $step;\n }\n $callee = $step;\n\n if (! isset($callee['file']) || ! is_readable($callee['file'])) {\n return array(null, null, $callee, $previousCaller, $miniTrace);\n }\n\n // open the file and read it up to the position where the function call expression ended\n $file = fopen($callee['file'], 'r');\n $line = 0;\n $source = '';\n while (($row = fgets($file)) !== false) {\n if (++$line > $callee['line']) {\n break;\n }\n $source .= $row;\n }\n fclose($file);\n $source = self::_removeAllButCode($source);\n\n if (empty($callee['class'])) {\n $codePattern = $callee['function'];\n } else {\n if ($callee['type'] === '::') {\n $codePattern = $callee['class'].\"\\x07*\".$callee['type'].\"\\x07*\".$callee['function'];;\n } else /*if ( $callee['type'] === '->' )*/ {\n $codePattern = \".*\\x07*\".$callee['type'].\"\\x07*\".$callee['function'];;\n }\n }\n\n // get the position of the last call to the function\n preg_match_all(\"\n [\n # beginning of statement\n [\\x07{(]\n\n # search for modifiers (group 1)\n ([-+!@~]*)?\n\n # spaces\n \\x07*\n\n # check if output is assigned to a variable (group 2) todo: does not detect concat\n (\n \\\\$[a-z0-9_]+ # variable\n \\x07*\\\\.?=\\x07* # assignment\n )?\n\n # possibly a namespace symbol\n \\\\\\\\?\n\n\t\t\t# spaces again\n \\x07*\n\n # main call to Sage\n ({$codePattern})\n\n\t\t\t# spaces everywhere\n \\x07*\n\n # find the character where Sage's opening bracket resides (group 3)\n (\\\\()\n\n ]ix\",\n $source,\n $matches,\n PREG_OFFSET_CAPTURE\n );\n\n $modifiers = end($matches[1]);\n $assignment = end($matches[2]);\n $callToSage = end($matches[3]);\n $bracket = end($matches[4]);\n\n if (empty($callToSage)) {\n // if a wrapper is misconfigured, don't display the whole file as variable name\n return array(array(), $modifiers, $callee, $previousCaller, $miniTrace);\n }\n\n $modifiers = $modifiers[0];\n if ($assignment[1] !== -1) {\n $modifiers .= '@';\n }\n\n $paramsString = preg_replace(\"[\\x07+]\", ' ', substr($source, $bracket[1] + 1));\n // we now have a string like this:\n // <parameters passed>); <the rest of the last read line>\n\n // remove everything in brackets and quotes, we don't need nested statements nor literal strings which would\n // only complicate separating individual arguments\n $c = strlen($paramsString);\n $inString = $escaped = $openedBracket = $closingBracket = false;\n $i = 0;\n $inBrackets = 0;\n $openedBrackets = array();\n\n while ($i < $c) {\n $letter = $paramsString[$i];\n\n if (! $inString) {\n if ($letter === '\\'' || $letter === '\"') {\n $inString = $letter;\n } elseif ($letter === '(' || $letter === '[') {\n $inBrackets++;\n $openedBrackets[] = $openedBracket = $letter;\n $closingBracket = $openedBracket === '(' ? ')' : ']';\n } elseif ($inBrackets && $letter === $closingBracket) {\n $inBrackets--;\n array_pop($openedBrackets);\n $openedBracket = end($openedBrackets);\n $closingBracket = $openedBracket === '(' ? ')' : ']';\n } elseif (! $inBrackets && $letter === ')') {\n $paramsString = substr($paramsString, 0, $i);\n break;\n }\n } elseif ($letter === $inString && ! $escaped) {\n $inString = false;\n }\n\n // replace whatever was inside quotes or brackets with untypeable characters, we don't\n // need that info. We'll later replace the whole string with '...'\n if ($inBrackets > 0) {\n if ($inBrackets > 1 || $letter !== $openedBracket) {\n $paramsString[$i] = \"\\x07\";\n }\n }\n if ($inString) {\n if ($letter !== $inString || $escaped) {\n $paramsString[$i] = \"\\x07\";\n }\n }\n\n $escaped = ! $escaped && ($letter === '\\\\');\n $i++;\n }\n\n // by now we have an un-nested arguments list, lets make it to an array for processing further\n $arguments = explode(',', preg_replace(\"[\\x07+]\", '...', $paramsString));\n\n // test each argument whether it was passed literary or was it an expression or a variable name\n $parameters = array();\n $blacklist = array('null', 'true', 'false', 'array(...)', 'array()', '\"...\"', '[...]', 'b\"...\"',);\n foreach ($arguments as $argument) {\n $argument = trim($argument);\n\n if (is_numeric($argument)\n || in_array(str_replace(\"'\", '\"', strtolower($argument)), $blacklist, true)\n ) {\n $parameters[] = null;\n } else {\n $parameters[] = $argument;\n }\n }\n\n return array($parameters, $modifiers, $callee, $previousCaller, $miniTrace);\n }", "protected function getErrorBackTrace()\n {\n /**\n * @todo check if debug back trace is enabled\n */\n ob_start();\n debug_print_backtrace();\n $backtrace = ob_get_clean();\n\n if ( empty( $backtrace ) ) {\n $backtrace = 'Backtrace is empty';\n }\n return $backtrace;\n }", "function get_backtrace()\n{\n\tglobal $phpbb_root_path;\n\n\t$output = '<div style=\"font-family: monospace;\">';\n\t$backtrace = debug_backtrace();\n\t$path = phpbb_realpath($phpbb_root_path);\n\n\tforeach ($backtrace as $number => $trace)\n\t{\n\t\t// We skip the first one, because it only shows this file/function\n\t\tif ($number == 0)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Strip the current directory from path\n\t\tif (empty($trace['file']))\n\t\t{\n\t\t\t$trace['file'] = '';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$trace['file'] = str_replace(array($path, '\\\\'), array('', '/'), $trace['file']);\n\t\t\t$trace['file'] = substr($trace['file'], 1);\n\t\t}\n\t\t$args = array();\n\n\t\t// If include/require/include_once is not called, do not show arguments - they may contain sensible information\n\t\tif (!in_array($trace['function'], array('include', 'require', 'include_once')))\n\t\t{\n\t\t\tunset($trace['args']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Path...\n\t\t\tif (!empty($trace['args'][0]))\n\t\t\t{\n\t\t\t\t$argument = htmlspecialchars($trace['args'][0]);\n\t\t\t\t$argument = str_replace(array($path, '\\\\'), array('', '/'), $argument);\n\t\t\t\t$argument = substr($argument, 1);\n\t\t\t\t$args[] = \"'{$argument}'\";\n\t\t\t}\n\t\t}\n\n\t\t$trace['class'] = (!isset($trace['class'])) ? '' : $trace['class'];\n\t\t$trace['type'] = (!isset($trace['type'])) ? '' : $trace['type'];\n\n\t\t$output .= '<br />';\n\t\t$output .= '<b>FILE:</b> ' . htmlspecialchars($trace['file']) . '<br />';\n\t\t$output .= '<b>LINE:</b> ' . ((!empty($trace['line'])) ? $trace['line'] : '') . '<br />';\n\n\t\t$output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']) . '(' . ((sizeof($args)) ? implode(', ', $args) : '') . ')<br />';\n\t}\n\t$output .= '</div>';\n\treturn $output;\n}", "function debug_print_backtrace2() {\n\t\t\techo \"<pre>\";\n\t\t\t$ar = debug_backtrace();\n\t\t\t//array_pop($ar);\n\t\t\tvar_dump($ar);\n\t\t\techo \"</pre>\";\n\t\t}", "function debug_print_backtrace2() {\n\t\t\techo \"<pre>\";\n\t\t\t$ar = debug_backtrace();\n\t\t\t//array_pop($ar);\n\t\t\tvar_dump($ar);\n\t\t\techo \"</pre>\";\n\t\t}", "protected function getCallTree() {\n\t\treturn implode( '', array_map(\n\t\t\tarray( &$this, 'getCallTreeLine' ), $this->remapCallTree( $this->mStack )\n\t\t) );\n\t}", "private static function _stackTrace( $stack_trace_data = NULL )\n\t{\n\t\tif( is_null( $stack_trace_data ) ) {\n\t\t\t$stack_trace_data = debug_backtrace();\n\t\t\tarray_shift( $stack_trace_data ); //remove the call to _stackTrace\n\t\t}\n\t\t/* Prepare backtrace array */\n\t\t$stack_trace_array = array_reverse( $stack_trace_data );\n\t\t//pull off last 2 items, since they are internal\n\t\t//array_pop( $stack_trace_array );\n\t\t\n\t\t/* Create backtrace string */\n\t\t$strack_trace_string_array = \"\";\n\t\tforeach( $stack_trace_array as $stack_trace ) {\n\t\t\tif( array_key_exists( \"file\", $stack_trace ) && array_key_exists( \"line\", $stack_trace ) ) {\n\t\t\t\t$strack_trace_string_array[] = sprintf( \n\t\t\t\t\t\"%s( %s line %s )\",\n\t\t\t\t\tCommon::safeArrayAccess( \"function\", $stack_trace, \"\" ),\n\t\t\t\t\tstr_replace( LOCAL_DOCUMENT_ROOT, \"\", $stack_trace[\"file\"] ),\n\t\t\t\t\t(string)$stack_trace[\"line\"]\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$strack_trace_string_array[] = sprintf( \n\t\t\t\t\t\"%s( internal )\",\n\t\t\t\t\t$stack_trace[\"function\"]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn implode( \" -> \", $strack_trace_string_array );\n\t}", "function _get_processes()\n\t{\n\t\t// Mac OS X uses different method to output \"top\" list instead\n\t\t// of continuously updating it, so let's define what command it is.\n\t\t\n\t\t$topcmd = ((IS_DARWIN_OS == true) ? \"top -l 1\" : \"top -b -n 1\");\n\t\t\n\t\t$command = ((IS_WINDOWS_OS == true) ? \"tasklist\" : $topcmd);\n\t\t\t\n\t\t$processlist = @shell_exec($command);\n\t\t\n\t\treturn (($topinfo === false) ? false : trim($processlist));\n\t}", "protected function checkWindowsApacheThreadStackSize() {}", "static function getTraces(Exception $exception, $format = 'txt'){\r\n\t\t$traceData = $exception->getTrace();\r\n\t\tarray_unshift($traceData, array(\r\n 'function' => '',\r\n 'file' => $exception->getFile() != null ? $exception->getFile() : null,\r\n 'line' => $exception->getLine() != null ? $exception->getLine() : null,\r\n 'args' => array(),\r\n\t\t));\r\n\t\t$traces = array();\r\n\t\tif ($format == 'html'){\r\n\t\t\t$lineFormat = 'at <strong>%s%s%s</strong>(%s)<br />in <em>%s</em> line %s <a href=\"#\" onclick=\"toggle(\\'%s\\'); return false;\">...</a><br /><ul class=\"code\" id=\"%s\" style=\"display: %s\">%s</ul>';\r\n\t\t}else{\r\n\t\t\t$lineFormat = 'at %s%s%s(%s) in %s line %s';\r\n\t\t}\r\n\t\tfor ($i = 0, $count = count($traceData); $i < $count; $i++){\r\n\t\t\t$line = isset($traceData[$i]['line']) ? $traceData[$i]['line'] : null;\r\n\t\t\t$file = isset($traceData[$i]['file']) ? $traceData[$i]['file'] : null;\r\n\t\t\t$args = isset($traceData[$i]['args']) ? $traceData[$i]['args'] : array();\r\n\t\t\t$traces[] = sprintf($lineFormat,\r\n\t\t\t\t(isset($traceData[$i]['class']) ? $traceData[$i]['class'] : ''),\r\n\t\t\t\t(isset($traceData[$i]['type']) ? $traceData[$i]['type'] : ''),\r\n\t\t\t\t$traceData[$i]['function'],\r\n\t\t\t\tself::formatArgs($args, false, $format),\r\n\t\t\t\tself::formatFile($file, $line, $format, null === $file ? 'n/a' : $file),\r\n\t\t\t\tnull === $line ? 'n/a' : $line,\r\n\t 'trace_'.$i,\r\n\t 'trace_'.$i,\r\n\t\t\t\t$i == 0 ? 'block' : 'none',\r\n\t\t\t\tself::fileExcerpt($file, $line)\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $traces;\r\n\t}", "private function getParentEnvironment() {\n\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\treturn getenv();\n\t\t} elseif ( isset( $_ENV['PATH'] ) ) {\n\t\t\treturn [ 'PATH' => $_ENV['PATH'] ];\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}" ]
[ "0.6602076", "0.6332762", "0.62920916", "0.62600565", "0.6161599", "0.61570185", "0.608657", "0.5733001", "0.57324654", "0.5681833", "0.5608143", "0.5584803", "0.5506179", "0.5482485", "0.5431837", "0.5384378", "0.5352697", "0.5320601", "0.525224", "0.52492464", "0.52435184", "0.5230421", "0.5230421", "0.5219736", "0.52184814", "0.5191295", "0.5170597", "0.5167949", "0.50970435", "0.507772", "0.5070012", "0.50608164", "0.5047324", "0.50291383", "0.49872285", "0.49778104", "0.4962797", "0.4959796", "0.49286777", "0.49162754", "0.49153867", "0.49151087", "0.48925397", "0.48842457", "0.48501045", "0.4847699", "0.4847454", "0.48315167", "0.48305473", "0.4823768", "0.48026097", "0.47976553", "0.47958806", "0.4785622", "0.4776953", "0.47752064", "0.47750226", "0.477043", "0.47701368", "0.47624874", "0.47491896", "0.4747891", "0.47371095", "0.47345188", "0.4724317", "0.4713042", "0.46969303", "0.46908534", "0.4682741", "0.4664968", "0.4664161", "0.4654262", "0.4654262", "0.4654262", "0.4643429", "0.46220726", "0.45997888", "0.45948875", "0.45892188", "0.45842952", "0.45816156", "0.45744556", "0.4567359", "0.4558501", "0.45557287", "0.45544168", "0.45529544", "0.45307562", "0.45295078", "0.45289317", "0.45211616", "0.4515951", "0.45058945", "0.45058945", "0.45033604", "0.45006487", "0.44958046", "0.44957212", "0.44947714", "0.4487293" ]
0.54636747
14
The actual compare function
public function compare(\morph\Object $objectA, \morph\Object $objectB) { $compare = null; $propertyA = (float)$objectA->{$this->propertyName}; $propertyB = (float)$objectB->{$this->propertyName}; if ($propertyA == $propertyB){ $compare = 0; }else{ $compare = ($propertyA < $propertyB) ? -1 : 1; } return $compare; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function compare();", "abstract protected function _compare($val1, $val2);", "public static function compare($a,$b);", "public function getValueCompare();", "public function getComparison();", "public function comparator();", "public function compare($item);", "function cmp($a, $b) {\n $valueA = getCompareValue($a);\n $valueB = getCompareValue($b);\n return $valueA - $valueB;\n }", "abstract protected function compare($idA, $idB);", "function compare($wert_a, $wert_b)\n {\n $a = $wert_a[0];\n $b = $wert_b[0];\n if ($a == $b) {\n return 0;\n }\n return ($a > $b) ? -1 : +1;\n }", "public function scompare($o = null) {}", "function comparator($object1, $object2) {\n\t\t\treturn $object1->amount < $object2->amount; \n\t\t}", "public function compareAction() {}", "function testCmp() {\n $mdtv1 = Metadata_Term_Value::getOneFromDb(['metadata_term_value_id'=>6201],$this->DB);\n $mdtv2 = Metadata_Term_Value::getOneFromDb(['metadata_term_value_id'=>6202],$this->DB);\n\n\t\t\t$this->assertEqual(Metadata_Term_Value::cmp($mdtv1, $mdtv2), -1);\n\t\t\t$this->assertEqual(Metadata_Term_Value::cmp($mdtv1, $mdtv1), 0);\n\t\t\t$this->assertEqual(Metadata_Term_Value::cmp($mdtv2, $mdtv1), 1);\n\n $all = Metadata_Term_Value::getAllFromDb([],$this->DB);\n\n usort($all,'Metadata_Term_Value::cmp');\n\n $this->assertEqual(6201, $all[0]->metadata_term_value_id);\n $this->assertEqual(6202, $all[1]->metadata_term_value_id);\n $this->assertEqual(6203, $all[2]->metadata_term_value_id);\n $this->assertEqual(6204, $all[3]->metadata_term_value_id);\n $this->assertEqual(6205, $all[4]->metadata_term_value_id);\n $this->assertEqual(6206, $all[5]->metadata_term_value_id);\n $this->assertEqual(6207, $all[6]->metadata_term_value_id);\n $this->assertEqual(6208, $all[7]->metadata_term_value_id);\n $this->assertEqual(6212, $all[8]->metadata_term_value_id);\n $this->assertEqual(6213, $all[9]->metadata_term_value_id);\n $this->assertEqual(6211, $all[10]->metadata_term_value_id);\n $this->assertEqual(6210, $all[11]->metadata_term_value_id);\n $this->assertEqual(6209, $all[12]->metadata_term_value_id);\n }", "function cmp_function($value1, $value2)\n{\n if($value1 == $value2) {\n return 0;\n }\n else if($value1 > $value2) {\n return 1;\n }\n else {\n return -1;\n }\n}", "abstract protected function compare($value): bool;", "function cmp($a,$b) {\r\rif($a > $b){\r $x=put_string($a,\">\",$b,\"\\n\");\r}\rif ($a >= $b ) {\r $x=put_string($a,\">=\",$b,\"\\n\");\r}\rif ($a === $b ) {\r $x=put_string($a,\"===\",$b,\"\\n\");\r}\rif ($b < $a ) {\r $x=put_string($b,\"<\",$a,\"\\n\");\r}\rif ($b <= $a ) {\r $x=put_string($b,\"<=\",$a,\"\\n\");\r}\rif ($b === $a ) {\r $x=put_string($b,\"===\",$a,\"\\n\");\r}\rif ($a > $a ) {\r $x=put_string($a,\">\",$a,\"\\n\");\r}\rif ($a < $a ) {\r $x=put_string($a,\"<\",$a,\"\\n\");\r}\rif ($a !== $a ) {\r $x=put_string($a,\"!==\",$a,\"\\n\");\r}\rif ($b > $b ) {\r $x=put_string($b,\">\",$b,\"\\n\");\r}\rif ($b < $b ) {\r $x=put_string($b,\"<\",$b,\"\\n\");\r}\rif ($b !== $b ) {\r $x=put_string($b,\"!==\",$b,\"\\n\");\r}\r\r}", "function compare($row1, $row2) {\n\t\treturn $this->compare_priv($row1, $row2, 0);\n\t}", "public function testCompareReturnValues()\n\t{\n\t\t/** @var AbstractCollectorCommand $mock */\n\t\t$mock = $this->getAbstractCollectorMock();\n\n\t\t$this->assertEquals( -1, $mock->compare( 1, 2 ) );\n\t\t$this->assertEquals( 0, $mock->compare( 2, 2 ) );\n\t\t$this->assertEquals( 1, $mock->compare( 2, 1 ) );\n\t}", "function CompareValeurs($val1, $val2) {\r\n\tif ($val2[1] == $val1[1])\r\n\t\treturn(strcmp($val1[0],$val2[0]));\r\n\telse\r\n\t\treturn($val2[1] - $val1[1]);\r\n }", "function compare($x, $y) {\n if($x[0] == \"N\" && $x[0] == $y[0]) return 0;\n if($x[0] == \"N\" && $y[0] == \"Y\") return 1;\n if($x[0] == \"Y\" && $y[0] == \"N\") return -1;\n $type1 = intval($x[3]);\n $type2 = intval($y[3]);\n if($type1 > $type2) return -1;\n if($type1 < $type2) return 1;\n $time1 = (float)$x[1];\n $time2 = (float)$y[1];\n if($time1 > $time2) return 1;\n if($time1 < $time2) return -1;\n $len1 = intval($x[2]);\n $len2 = intval($y[2]);\n if($len1 > $len2) return 1;\n if($len1 < $len2) return -1;\n return 0;\n}", "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}", "function cmp($a, $b) {\n $cmp_pattern = \"/_nr_([0-9]*)_([0-9]{4})/\";\n if ((preg_match($cmp_pattern, $a[1], $a_) == 0) || (preg_match($cmp_pattern, $b[1], $b_) == 0)) {\n strcmp($a[1],$b[1]);\n }\n $a = $a_[2].$a_[1];\n $b = $b_[2].$b_[1];\n\n return intval($a) > intval($b);\n}", "function comp($a,$b)\r\n{\r\n\treturn ($a[0] < $b[0]);\r\n}", "function compare_func($a, $b)\n\t\t{\n\t\t\t$t1 = strtotime($a[\"org_date_added\"]);\n\t\t\t$t2 = strtotime($b[\"org_date_added\"]);\n\t\t\n\t\t\treturn ($t2 - $t1);\n\t\t}", "function _compareActions($a,$b){\n\t\tif ( @$a['order'] < @$b['order'] ) return -1;\n\t\telse return 1;\n\t}", "function compare($a, $b)\r\n\t\t\t{ return strcasecmp($a[\"fichier\"], $b[\"fichier\"]); }", "function compare_citations($x, $y)\n{\n\n if( !$x->sources[0]->citation->uuid){// && !$y->sources[0]->citation->uuid){\n $res = -1;\n //var_dump($y->sources[0]->citation->uuid);\n }elseif(!$y->sources[0]->citation->uuid){\n $res = 1;\n //var_dump($x->sources[0]->citation->uuid);\n }\n else{\n\n\n $author_team_x = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $x->sources[0]->citation->uuid);\n $author_team_y = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $y->sources[0]->citation->uuid);\n\n //same author, and different year\n if($author_team_x->titleCache == $author_team_y->titleCache){\n $x_year = substr(\n $x->sources[0]->citation->datePublished->start,\n 0,\n strpos($x->sources[0]->citation->datePublished->start,'-'));\n $y_year = substr(\n $y->sources[0]->citation->datePublished->start,\n 0,\n strpos($y->sources[0]->citation->datePublished->start,'-'));\n if ($x_year < $y_year){//the year of the first publication is smaller\n $res = -1;\n }\n else if($x_year == $y_year){ //if same year check the page\n $x_page = $x->sources[0]->citationMicroReference;\n $y_page = $y->sources[0]->citationMicroReference;\n if($x_page < $y_page){\n $res = -1;\n }\n else{\n $res = 1;\n }\n }else\n $res = 1;\n }\n //different author and the first one is alphabetically smaller\n //else if($x->sources[0]->citation->authorship->teamMembers[0]->lastname <\n //$y->sources[0]->citation->authorship->teamMembers[0]->lastname){\n else if ($author_team_x->titleCache < $author_team_y->titleCache)\t{\n $res = -1;\n }\n //different author and the second one is alphabetically smaller\n else{\n $res = 1;\n }\n\n }\n //var_dump($res);\n //var_dump(' ============ ');\n return $res;\n}", "private function _cmp($a, $b)\n {\n if ($a[0] != $b[0])\n {\n if ($a[0] == '*') {return 1;}\n else if ($b[0] == '*') {return -1;}\n else {if ($a[0] < $b[0]) {return -1;} else {return 1;}}\n }\n else\n {\n if ($a[1] != $b[1])\n {\n if ($a[1] == '*') {return 1;}\n else if ($b[1] == '*') {return -1;}\n else {if ($a[1] < $b[1]) {return -1;} else {return 1;}} \n }\n else\n {\n if ($a[2] != $b[2])\n {\n if ($a[2] == '*') {return 1;}\n else if ($b[2] == '*') {return -1;}\n else {\n $lga = strlen($a[2]); $lgb = strlen($b[2]);\n if ($lga > $lgb) {return -1;}\n else if ($lga < $lgb) {return 1;}\n else {if ($a[2] < $b[2]) {return -1;} else {return 1;}}\n }\n }\n else\n {\n if ($a[3] == '*') {return 1;}\n else if ($b[3] == '*') {return -1;}\n else if ($a[3] < $b[3]) {return -1;}\n else if ($a[3] > $b[3]) {return 1;}\n else {return 0;}\n }\n }\n }\n \n }", "function compare($a, $b) {\n if ($this->access($a) == $this->access($b)) {\n return 0;\n }\n return ($this->access($a) < $this->access($b)) ? -1 : 1;\n }", "private function compare_recs( $record_a, $record_b ) {\n\n $return_val = 0;\n if( $this->criteria == CRITERIA_MOST_POPULATED ) {\n if ( $record_a['population'] < $record_b['population'] ) {\n $return_val = 1;\n } elseif ( $record_a['population'] > $record_b['population'] ) {\n $return_val = -1;\n }\n } elseif ( $this->criteria == CRITERIA_LEAST_POPULATED ) {\n if ( $record_a['population'] < $record_b['population'] ) {\n $return_val = -1;\n } elseif ( $record_a['population'] > $record_b['population'] ) {\n $return_val = 1;\n }\n } elseif( $this->criteria == CRITERIA_CLOSEST ) {\n if ( $record_a['distance'] < $record_b['distance'] ) {\n $return_val = -1;\n } elseif ( $record_a['distance'] > $record_b['distance'] ) {\n $return_val = 1;\n }\n } elseif( $this->criteria == CRITERIA_FARTHEST ) {\n if ( $record_a['distance'] < $record_b['distance'] ) {\n $return_val = 1;\n } elseif ( $record_a['distance'] > $record_b['distance'] ) {\n $return_val = -1;\n }\n }\n\n return( $return_val );\n }", "function cmp($a, $b) {\n return strcmp($a['generation_id'], $b['generation_id']);\n\t}", "public function get_compare($query)\n {\n }", "function comparator($elem1,$elem2) {\n\n\tif ($elem1->getId() == $elem2->getId()) \n\t\treturn 0;\n\telse \n\t\tif ($elem1->getId() > $elem2->getId())\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn -1;\n\n}", "function cmp2($a, $b) {\n return strcmp($a['age_start'], $b['age_start']);\n\t}", "public function compareTo($other);", "function cmp($a, $b)\n\t{\n\t\tif($a[4] == $b[4]) return 0;\n\t\t\n\t\tif($a[4] < $b[4]) return -1;\n\t\t\n\t\treturn 1;\n\t}", "function cmp_by_name($val1, $val2){\n return strcmp($val1->name, $val2->name);\n}", "function cmp($a, $b)\n {\n if ($a->points == $b->points) {\n return 0;\n }\n return ($a->points > $b->points) ? -1 : 1;\n }", "function compare_author($a, $b) \n{ \n if (($a[$GLOBALS['MYLANGFIELDS'][0]] == DEFAULTLANG) && ($b[$GLOBALS['MYLANGFIELDS'][0]] == DEFAULTLANG))\n return strnatcmp($a[$GLOBALS['MYFIELDS'][0]], $b[$GLOBALS['MYFIELDS'][0]]);\n if ($a[$GLOBALS['MYLANGFIELDS'][0]] == DEFAULTLANG)\n return 1;\n if ($b[$GLOBALS['MYLANGFIELDS'][0]] == DEFAULTLANG)\n return -1;\n \n return strcmp_from_utf8($a[$GLOBALS['MYFIELDS'][0]], $b[$GLOBALS['MYFIELDS'][0]]); \n}", "static function compare(Transfer $a, Transfer $b) {\n\t\treturn $a->value - $b->value;\n\t}", "function nearby_result_compare($a, $b) {\n\tif ($a[3] > $b[3]) {\n\t\treturn +1;\n\t} else if ($a[3] < $b[3]) {\n\t\treturn -1;\n\t} else {\n\t\treturn 0;\n\t}\n}", "public function getComparatorFor($expected, $actual);", "function cmp($a, $b){\n if($a->score == $b->score){\n return 0;\n }\n\n return ($a->score<$b->score) ? 1:-1;\n }", "function addressbook_cmp($a,$b) {\n\n if($a['backend'] > $b['backend']) {\n return 1;\n } else if($a['backend'] < $b['backend']) {\n return -1;\n }\n\n return (strtolower($a['name']) > strtolower($b['name'])) ? 1 : -1;\n\n}", "function cmpFA($a,$b) {\n\treturn strcasecmp($a['file'],$b['file']); \t}", "public function compareTo($item);", "function abc($a,$b){return strnatcasecmp($a->getInfo(\"name\"),$b->getInfo(\"name\"));}", "function sort_compare_type($a, $b) {\n // Order table types by hardcoded values in a local function getTypePriority.\n // Order tables alphabetically.\n //$cmp = $this->getTypePriority($a['Type']) - $this->getTypePriority($b['Type']);\n //if ($cmp != 0) return $cmp;\n //return strnatcmp($a['Name'], $b['Name']);\n\n // New way of sort. 11/27/2015.\n // Order both table types and tables by priority defined in WMD.\n //print $a['Type'] . \" := \" . $this->tableTypePriorityHash[$a['Type']] . \" - \" .\n // $b['Type'] . \" := \" . $this->tableTypePriorityHash[$b['Type']] . \"<br/>\";\n $cmp = $this->tableTypePriorityHash[$a['Type']] - $this->tableTypePriorityHash[$b['Type']];\n if ($cmp != 0) return $cmp;\n return $this->tablePriorityHash[$a['Name']] - $this->tablePriorityHash[$b['Name']];\n }", "function cmp($a, $b) {\n\treturn $a['posi'] - $b['posi'];\n}", "function adodb_cmpr($a, $b) {\n\tif ($a[0] == $b[0]) return 0;\n\treturn ($a[0] > $b[0]) ? -1 : 1;\n}", "function loadsrc_comp($a, $b){\n if($a[0] == $b[0])\n return 0;\n return ($a[0] < $b[0]) ? 1 : -1;\n }", "static function cmp_serie($a, $b)\r\n\t{\r\n\t\t\r\n\t\t$cmp_return = strcasecmp($a->duree, $b->duree);\r\n\t\tif ($cmp_return == 0) {\r\n\t\t\t$cmp_return = strcasecmp($a->user, $b->user);\r\n\t\t}\r\n\t\treturn $cmp_return;\r\n\t\t\r\n\t}", "function cmpImgTime($element1, $element2) \n {\n $time1 = $element1['mtime'];\n $time2 = $element2['mtime'];\n return $time1 <=> $time2;\n }", "function cmp($a, $b) \n\t{\t\t\t \n\t $a=key($a);\n\t $b=key($b);\t \n\t if ($a==$b) \n\t {\n\t\t return 0;\n\t }\n\t return ($a < $b) ? -1 : 1;\n\t}", "function compareLC() {\n $beginMatch = 0;\n $beginSubjectMatch = 0;\n $beginClassMatch = 0;\n $beginCutter1Match = 0;\n $beginCutter2Match = 0;\n $beginCutter3Match = 0;\n $beginVersionMatch = 0;\n $beginCopyMatch = 0;\n\n //Check Subjects\n if ($GLOBALS['CN_Subject'] > $GLOBALS['BC_Subject']) {\n $beginMatch = 1;\n } else if ($GLOBALS['CN_Subject'] >= $GLOBALS['BC_Subject']) {\n $beginSubjectMatch = 1;\n }\n\n //Check Classification Number\n if ($beginSubjectMatch) {\n //if(strpos($GLOBALS['CN_ClassNum'], '.') !== false) {\n if ((double) $GLOBALS['CN_ClassNum'] > (double) $GLOBALS['BC_ClassNum']) {\n $beginMatch = 1;\n } else if ((double) $GLOBALS['CN_ClassNum'] >= (double) $GLOBALS['BC_ClassNum']) {\n $beginClassMatch = 1;\n }\n //}\n /*\n //else {\n $CN_Arr = str_split($GLOBALS['CN_ClassNum']);\n $BC_Arr = str_split($GLOBALS['BC_ClassNum']);\n $EC_Arr = str_split($GLOBALS['EC_ClassNum']);\n\n $n = 0;\n\n for ($n; $n < sizeof($CN_Arr); ++$n) {\n if ($n >= sizeof($BC_Arr)) {\n $beginClassMatch = 1;\n break;\n } else if ($n < sizeof($BC_Arr)) {\n if ($CN_Arr[$n] > $BC_Arr[$n]) {\n $beginMatch = 1;\n break;\n } else if ($CN_Arr[$n] < $BC_Arr[$n]) {\n break;\n } else { }\n } else { }\n }\n\n if ($n == sizeof($CN_Arr)) {\n $beginClassMatch = 1;\n }\n //}\n */\n\n \n }\n\n //Check Cutter 1\n if ($beginClassMatch) {\n $CN_Cutter1_Ltr = substr($GLOBALS['CN_Cutter1'], 1, 1);\n $CN_Cutter1_Num = (int) substr($GLOBALS['CN_Cutter1'], 2);\n\n $BC_Cutter1_Ltr = substr($GLOBALS['BC_Cutter1'], 1, 1);\n $BC_Cutter1_Num = (int) substr($GLOBALS['BC_Cutter1'], 2);\n\n if (empty($GLOBALS['CN_Cutter1']) || empty($GLOBALS['BC_Cutter1'])) {\n $beginCutter1Match = 1;\n } else {\n if ($CN_Cutter1_Ltr > $BC_Cutter1_Ltr) {\n $beginMatch = 1;\n } else if (strcmp($CN_Cutter1_Ltr, $BC_Cutter1_Ltr) == 0) {\n if ($CN_Cutter1_Num > $BC_Cutter1_Num) {\n $beginMatch = 1;\n } else if (strcmp($CN_Cutter1_Num, $BC_Cutter1_Num) == 0) {\n $beginCutter1Match = 1;\n }\n }\n }\n }\n\n //Check Cutter 2\n if ($beginCutter1Match) {\n $CN_Cutter2_Ltr = substr($GLOBALS['CN_Cutter2'], 0, 1);\n $CN_Cutter2_Num = (int) substr($GLOBALS['CN_Cutter2'], 1);\n\n $BC_Cutter2_Ltr = substr($GLOBALS['BC_Cutter2'], 0, 1);\n $BC_Cutter2_Num = (int) substr($GLOBALS['BC_Cutter2'], 1);\n\n if (empty($GLOBALS['CN_Cutter2']) || empty($GLOBALS['BC_Cutter2'])) {\n $beginCutter2Match = 1;\n } else {\n if ($CN_Cutter2_Ltr > $BC_Cutter2_Ltr) {\n $beginMatch = 1;\n } else if (strcmp($CN_Cutter2_Ltr, $BC_Cutter2_Ltr) == 0) {\n if ($CN_Cutter2_Num > $BC_Cutter2_Num) {\n $beginMatch = 1;\n } else if (strcmp($CN_Cutter2_Num, $BC_Cutter2_Num) == 0) {\n $beginCutter2Match = 1;\n }\n }\n }\n }\n\n //Check Cutter 3\n if ($beginCutter2Match) {\n $CN_Cutter3_Ltr = substr($GLOBALS['CN_Cutter3'], 0, 1);\n $CN_Cutter3_Num = (int) substr($GLOBALS['CN_Cutter3'], 1);\n\n $BC_Cutter3_Ltr = substr($GLOBALS['BC_Cutter3'], 0, 1);\n $BC_Cutter3_Num = (int) substr($GLOBALS['BC_Cutter3'], 1);\n\n if (empty($GLOBALS['CN_Cutter3']) || empty($GLOBALS['BC_Cutter3'])) {\n $beginCutter3Match = 1;\n } else {\n if ($CN_Cutter3_Ltr > $BC_Cutter3_Ltr) {\n $beginMatch = 1;\n } else if (strcmp($CN_Cutter3_Ltr, $BC_Cutter3_Ltr) == 0) {\n if ($CN_Cutter3_Num > $BC_Cutter3_Num) {\n $beginMatch = 1;\n } else if (strcmp($CN_Cutter3_Num, $BC_Cutter3_Num) == 0) {\n $beginCutter3Match = 1;\n }\n }\n }\n }\n\n //Check Version\n if ($beginCutter3Match) {\n $CN_Version_Num = substr($GLOBALS['CN_Version'], 2);\n $BC_Version_Num = substr($GLOBALS['BC_Version'], 2);\n\n if (empty($CN_Version_Num)) {\n $beginVersionMatch = 1;\n } else if ($CN_Version_Num >= $BC_Version_Num || empty($BC_Version_Num)) {\n $beginMatch = 1;\n }\n }\n\n //Check Copy\n if ($beginVersionMatch) {\n $CN_Copy_Num = substr($GLOBALS['CN_Copy'], 2);\n $BC_Copy_Num = substr($GLOBALS['BC_Copy'], 2);\n\n if (empty($CN_Copy_Num)) {\n $beginCopyMatch = 1;\n } else if ($CN_Copy_Num >= $BC_Copy_Num || empty($BC_Copy_Num)) {\n $beginMatch = 1;\n }\n }\n\n $endMatch = 0;\n $endSubjectMatch = 0;\n $endClassMatch = 0;\n $endCutter1Match = 0;\n $endCutter2Match = 0;\n $endCutter3Match = 0;\n $endVersionMatch = 0;\n $endCopyMatch = 0;\n\n //Check Subjects\n if ($GLOBALS['CN_Subject'] < $GLOBALS['EC_Subject']) {\n $endMatch = 1;\n } else if ($GLOBALS['CN_Subject'] <= $GLOBALS['EC_Subject']) {\n $endSubjectMatch = 1;\n }\n\n //Check Classification Number\n if ($endSubjectMatch) {\n //if (strpos($GLOBALS['CN_ClassNum'], '.') !== false) {\n if ((double) $GLOBALS['CN_ClassNum'] < (double) $GLOBALS['EC_ClassNum']) {\n $endMatch = 1;\n } else if ((double) $GLOBALS['CN_ClassNum'] <= (double) $GLOBALS['EC_ClassNum']) {\n $endClassMatch = 1;\n }\n /*\n } else {\n $CN_Arr = str_split($GLOBALS['CN_ClassNum']);\n $EC_Arr = str_split($GLOBALS['EC_ClassNum']);\n $EC_Arr = str_split($GLOBALS['EC_ClassNum']);\n\n $n = 0;\n\n for ($n; $n < sizeof($CN_Arr); ++$n) {\n if ($n >= sizeof($EC_Arr)) {\n $endClassMatch = 1;\n break;\n } else if ($n < sizeof($EC_Arr)) {\n if ($CN_Arr[$n] < $EC_Arr[$n]) {\n $endMatch = 1;\n break;\n } else if ($CN_Arr[$n] > $EC_Arr[$n]) {\n break;\n } else { }\n } else { }\n }\n\n if ($n == sizeof($CN_Arr)) {\n $endClassMatch = 1;\n }\n }\n */\n }\n\n //Check Cutter 1\n if ($endClassMatch) {\n $CN_Cutter1_Ltr = substr($GLOBALS['CN_Cutter1'], 1, 1);\n $CN_Cutter1_Num = (int) substr($GLOBALS['CN_Cutter1'], 2);\n\n $EC_Cutter1_Ltr = substr($GLOBALS['EC_Cutter1'], 1, 1);\n $EC_Cutter1_Num = (int) substr($GLOBALS['EC_Cutter1'], 2);\n\n if (empty($GLOBALS['CN_Cutter1']) || empty($GLOBALS['EC_Cutter1'])) {\n $endCutter1Match = 1;\n } else {\n if ($CN_Cutter1_Ltr < $EC_Cutter1_Ltr) {\n $endMatch = 1;\n } else if (strcmp($CN_Cutter1_Ltr, $EC_Cutter1_Ltr) == 0) {\n if ($CN_Cutter1_Num < $EC_Cutter1_Num) {\n $endMatch = 1;\n } else if (strcmp($CN_Cutter1_Num, $EC_Cutter1_Num) == 0) {\n $endCutter1Match = 1;\n }\n }\n }\n }\n\n //Check Cutter 2\n if ($endCutter1Match) {\n $CN_Cutter2_Ltr = substr($GLOBALS['CN_Cutter2'], 0, 1);\n $CN_Cutter2_Num = (int) substr($GLOBALS['CN_Cutter2'], 1);\n\n $EC_Cutter2_Ltr = substr($GLOBALS['EC_Cutter2'], 0, 1);\n $EC_Cutter2_Num = (int) substr($GLOBALS['EC_Cutter2'], 1);\n\n if (empty($GLOBALS['CN_Cutter2']) || empty($GLOBALS['EC_Cutter2'])) {\n $endCutter2Match = 1;\n } else {\n if ($CN_Cutter2_Ltr < $EC_Cutter2_Ltr) {\n $endMatch = 1;\n } else if (strcmp($CN_Cutter2_Ltr, $EC_Cutter2_Ltr) == 0) {\n if ($CN_Cutter2_Num < $EC_Cutter2_Num) {\n $endMatch = 1;\n } else if (strcmp($CN_Cutter2_Num, $EC_Cutter2_Num) == 0) {\n $endCutter2Match = 1;\n }\n }\n }\n }\n\n //Check Cutter 3\n if ($endCutter2Match) {\n $CN_Cutter3_Ltr = substr($GLOBALS['CN_Cutter3'], 0, 1);\n $CN_Cutter3_Num = (int) substr($GLOBALS['CN_Cutter3'], 1);\n\n $EC_Cutter3_Ltr = substr($GLOBALS['EC_Cutter3'], 0, 1);\n $EC_Cutter3_Num = (int) substr($GLOBALS['EC_Cutter3'], 1);\n\n if (empty($GLOBALS['CN_Cutter3']) || empty($GLOBALS['EC_Cutter3'])) {\n $endCutter3Match = 1;\n } else {\n if ($CN_Cutter3_Ltr < $EC_Cutter3_Ltr) {\n $endMatch = 1;\n } else if (strcmp($CN_Cutter3_Ltr, $EC_Cutter3_Ltr) == 0) {\n if ($CN_Cutter3_Num < $EC_Cutter3_Num) {\n $endMatch = 1;\n } else if (strcmp($CN_Cutter3_Num, $EC_Cutter3_Num) == 0) {\n $endCutter3Match = 1;\n }\n }\n }\n }\n\n //Check Version\n if ($endCutter3Match) {\n $CN_Version_Num = substr($GLOBALS['CN_Version'], 2);\n $EC_Version_Num = substr($GLOBALS['EC_Version'], 2);\n\n if (empty($CN_Version_Num)) {\n $endVersionMatch = 1;\n } else if ($CN_Version_Num <= $EC_Version_Num || empty($EC_Version_Num)) {\n $endMatch = 1;\n }\n }\n\n //Check Copy\n if ($endVersionMatch) {\n $CN_Copy_Num = substr($GLOBALS['CN_Copy'], 2);\n $EC_Copy_Num = substr($GLOBALS['EC_Copy'], 2);\n\n if (empty($CN_Copy_Num)) {\n $endCopyMatch = 1;\n } else if ($CN_Copy_Num <= $EC_Copy_Num || empty($EC_Copy_Num)) {\n $endMatch = 1;\n }\n } \n\n //Check for match\n if($beginSubjectMatch && $beginClassMatch && $beginCutter1Match && $beginCutter2Match && $beginCutter3Match && $beginVersionMatch && $beginCopyMatch) {\n $beginMatch = 1;\n }\n if ($endSubjectMatch && $endClassMatch && $endCutter1Match && $endCutter2Match && $endCutter3Match && $endVersionMatch && $endCopyMatch) {\n $endMatch = 1;\n }\n\n if($beginMatch && $endMatch) {\n return 1;\n }\n else {\n return 0;\n }\n\n }", "private function cmp($lhs, $rhs) {\n $scoreArtistL = $this->getStringSimilarity($this->mArtist, $lhs['artist']);\n $scoreArtistR = $this->getStringSimilarity($this->mArtist, $rhs['artist']);\n $scoreTitleL = $this->getStringSimilarity($this->mTitle, $lhs['title']);\n $scoreTitleR = $this->getStringSimilarity($this->mTitle, $rhs['title']);\n\n // printf(\"artist \" . $lhs['artist'] . \" vs \" . $rhs['artist'] . \" | \" . $scoreArtistL . \" vs \" . $scoreArtistR . \"</br>\");\n // printf(\"title \" . $lhs['title'] . \" vs \" . $rhs['title'] . \" | \" . $scoreTitleL . \" vs \" . $scoreTitleR. \"</br>\");\n\n return $scoreArtistR + $scoreTitleR - $scoreArtistL - $scoreTitleL;\n }", "function dateCompare($a, $b) { \n\t\t\tif($a->startTime->getTimestamp() == $b->startTime->getTimestamp()) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn ($a->startTime->getTimestamp() < $b->startTime->getTimestamp()) ? -1 : 1;\n\t\t}", "function variant_cmp($left, $right, $lcid = null, $flags = null) {}", "function compare($d1, $d2)\r\n {\r\n $d1->convertTZ(new Date_TimeZone('UTC'));\r\n $d2->convertTZ(new Date_TimeZone('UTC'));\r\n $dias1 = Data_Calc::dataParaDias($d1->dia, $d1->mes, $d1->ano);\r\n $dias2 = Data_Calc::dataParaDias($d2->dia, $d2->mes, $d2->ano);\r\n if($dias1 < $dias2) return -1;\r\n if($dias1 > $dias2) return 1;\r\n if($d1->hora < $d2->hora) return -1;\r\n if($d1->hora > $d2->hora) return 1;\r\n if($d1->minuto < $d2->minuto) return -1;\r\n if($d1->minuto > $d2->minuto) return 1;\r\n if($d1->segundo < $d2->segundo) return -1;\r\n if($d1->segundo > $d2->segundo) return 1;\r\n return 0;\r\n }", "function do_compare($before = BEFORE,$after = AFTER){\n\tglobal $debug;\n\tglobal $before_path;\n\tglobal $after_path;\n\tglobal $compare_path;\n\tif(!is_dir($compare_path)){\n\t\tmkdir($compare_path);\n\t}\n\techo \"comparing..\\n\";\n\t$urls = get_urls();\n\tforeach ($urls as $url){\n\t\t$url = str_replace(array(\"\\n\", \"\\r\"), '', $url);\n\t\t$bi = $before_path.\"/\".md5($url).\".jpg\";\n\t\t$ai = $after_path.\"/\".md5($url).\".jpg\";\n\t\t$report = $compare_path.\"/\".md5($url).\".txt\";\n\t\t$ci = $compare_path.\"/\".md5($url).\".jpg\";\n\t\timg_compare($bi,$ai,$report,$ci);\n\t}\n\t\n}", "function adodb_cmp($a, $b) {\n\tif ($a[0] == $b[0]) return 0;\n\treturn ($a[0] < $b[0]) ? -1 : 1;\n}", "private static function compare($a, $b) {\n $ordera = $a->get_order();\n $orderb = $b->get_order();\n if ($ordera > $orderb) {\n return 1;\n }\n if ($ordera < $orderb) {\n return -1;\n }\n $classa = get_class($a);\n $classb = get_class($b);\n if ($classa > $classb) {\n return 1;\n }\n if ($classb < $classa) {\n return -1;\n }\n return 0;\n }", "abstract protected function setUpComparator();", "function compare(la_time $other) {\n if($this->counter == $other->counter) {\n if( $this->actor_id < $other->actor_id) {\n return -1;\n }\n else if( $this->actor_id > $other->actor_id) {\n return 1;\n }\n else {\n return 0;\n }\n }\n else if ($this->counter > $other->counter) {\n return 1;\n }\n else if ($this->counter < $other->counter) {\n return -1;\n }\n }", "public function testCmpart()\n {\n $oA = new stdClass();\n $oA->cnt = 10;\n\n $oB = new stdClass();\n $oB->cnt = 10;\n\n $this->assertTrue(cmpart($oA, $oB) == 0);\n\n $oA->cnt = 10;\n $oB->cnt = 20;\n\n $this->assertTrue(cmpart($oA, $oB) == -1);\n }", "function bx_image_compare($p_photo, $p_compare, $p_width, $p_height, $file=\"0\", $p_size=\"0\")\n{\n\tif( !file_exists($p_photo['tmp_name']) )\n\t\treturn false;\n\n\tif($p_photo['tmp_name'] == \"none\" || $p_photo['tmp_name'] == \"\")\n\t\treturn false;\n\n\tif($file == \"0\")\n\t\t$photo_info = @GetImageSize($p_photo['tmp_name']);\n\telse\n\t\t$photo_info = @GetImageSize($p_photo);\n\t$photo_width = $photo_info[0];\n\t$photo_height = $photo_info[1];\n\t$photo_size_string = $photo_info[3];\n\tswitch($photo_info[2])\n\t{\n\t\tcase 1:\t\t$photo_ext = \".gif\";\tbreak;\n\t\tcase 2:\t\t$photo_ext = \".jpg\";\tbreak;\n\t\tcase 3:\t\t$photo_ext = \".png\";\tbreak;\n\t\tcase 4:\t\t$photo_ext = \".swf\";\tbreak;\n\t}\n\t//echo $photo_width .\" . \". $p_width .\" . \". $photo_height .\" . \". $p_height;\n\n\tif ($p_compare == \">\")\n\t{\n\t\tif($p_size != '0')\n\t\t\tif ($p_photo['size'] < $p_size)\n\t\t\t\treturn false;\n\n\t\tif ($photo_width > $p_width && $photo_height > $p_height)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\telseif ($p_compare == \"=\")\n\t{\n\t\tif($p_size != '0')\n\t\t\tif ($p_photo['size'] > $p_size)\n\t\t\t\treturn false;\n\n\t\tif ($photo_width == $p_width && $photo_height == $p_height)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\telseif ($p_compare == \"<\")\n\t{\n\t\tif($p_size != '0')\n\t\t\tif ($p_photo['size'] > $p_size)\n\t\t\t\treturn false;\n\n\t\tif ($photo_width <= $p_width && $photo_height <= $p_height)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\telse{}\n}", "function cmp($line1, $line2){\n\t$line1elements = explode(\" \", $line1);\n\t$line2elements = explode(\" \", $line2);\n\t$score1 = $line1elements[3];\n\t$score2 = $line2elements[3];\n\tif($score1>$score2)\n\t\treturn -1;\n\telse if($score1<$score2)\n\t\treturn 1;\n\telse\t\n\t\treturn 0;\n}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function compareObjects(&$ob1, &$ob2) {\n\tprint_pre('o1 == o2 : ' . bool2str($ob1 == $ob2));\n\tprint_pre('o1 != o2 : ' . bool2str($ob1 != $ob2));\n\tprint_pre('o1 === o2 : ' . bool2str($ob1 === $ob2));\n\tprint_pre('o1 !== o2 : ' . bool2str($ob1 !== $ob2));\n}", "public function compare($o = null, $attrs = array()) {}", "function ScoreCmp( $a, $b ) {\n\t\n\t$c = GetScore( $a['goods'], $a['bads'] );\n\t$d = GetScore( $b['goods'], $b['bads'] );\n\tif( $c == $d ) return 0;\n\treturn ($c>$d) ? -1 : 1;\n}", "function compararUsuarios($a, $b)\n{\n if ($a->value == $b->value) {\n return 0;\n }\n return ($a->value < $b->value) ? 1 : -1;\n}", "function cmpSemester($a, $b) {\n \n global $semesters;\n\n // Assumption is being made on the comparison where a/b is:\n // YEAR SEMESTER_NAME DEPARTMENT COURSE_NUMBER SECTION_NUMBER\n list($a_year, $a_semester, $a_department, $a_course_number, $a_section_number) = explode(' ', $a);\n list($b_year, $b_semester, $b_department, $b_course_number, $b_section_number) = explode(' ', $b);\n\n if ($a_year != $b_year) {\n return strcmp($a_year, $b_year);\n } else if ($a_semester != $b_semester) {\n return strcmp($semesters[$a_semester], $semesters[$b_semester]);\n } else if ($a_department != $b_department) {\n return strcmp($a_department, $b_department);\n } else if ($a_course_number != $b_course_number) {\n return strcmp($a_course_number, $b_course_number);\n } else if ($a_section_number != $b_section_number) {\n return strcmp($a_section_number, $b_section_number);\n }\n\n return 0;\n}", "public function isValidComparisonExpectations() {}", "function compare_internal($elem1, $elem2)\n{\n\t// assume NULL > everything\n\tif (is_null( $elem1 ) && is_null( $elem2 ))\n\t{\n\t\treturn 0; // assume they are equal\n\t}\n\tif (is_null( $elem1 ))\n\t{\n\t\treturn 1;\n\t}\n\telse if (is_null( $elem2 ))\n\t{\n\t\treturn -1;\n\t}\n\t\n\t// check to see if both sort index values are numbers, in which case, perform a natsort\n\tif (strlen( $elem1 ) && strlen( $elem2 ) &&\n\t\tctype_digit( $elem1 ) && ctype_digit( $elem2 ))\n\t{\n\t\treturn strnatcmp( $elem1, $elem2 );\n\t}\n\t\n\t// try to compare Persian strings\t\n\t$sort_order = //'آاأإؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی۱۲۳۴۵۶۷۸۹۰';\n\t\tarray( 'آ', 'ا', 'أ', 'إ', 'ؤ', 'ئ', 'ب', 'پ', 'ت', 'ث', 'ج', 'چ', 'ح', 'خ', 'د',\n\t\t\t'ذ', 'ر', 'ز', 'ژ', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ک', 'گ',\n\t\t\t'ل', 'م', 'ن', 'و', 'ه', 'ی', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹', '۰' );\n\t$sort_array = array();\n\t$index = 1;\n\tforeach ($sort_order as $item)\n\t{\n\t\t$sort_array[ $item ] = $index ++;\n\t}\n\t$len1 = strlen( $elem1 );\n\t$len2 = strlen( $elem2 );\n\t$failed = false;\n\tfor ($i = 0, $j = 0; $i < $len1 && $j < $len2;)\n\t{\n\t\t$c1 = extract_utf8_char( $elem1, $i );\n\t\t$c2 = extract_utf8_char( $elem2, $j );\n\t\t\n\t\tif (array_key_exists( $c1, $sort_array ) &&\n\t\t\tarray_key_exists( $c2, $sort_array ))\n\t\t{\n\t\t\tif ($sort_array[ $c1 ] == $sort_array[ $c2 ])\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $sort_array[ $c1 ] - $sort_array[ $c2 ];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$failed = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tif ($failed == false)\n\t{\n\t\treturn 0; // equal strings\n\t}\n\t\n\treturn strcmp( $elem1, $elem2 );\n}", "public function compareTo($object) : int;", "function dateCompare($a, $b) { \n\t\t\t\t\t\tif(sameDate($a->startDate, $b->startDate)) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn ($a->startDate->getTimestamp() < $b->startDate->getTimestamp()) ? -1 : 1;\n\t\t\t\t\t}", "function dateCompare($a, $b) { \n\tif($a->startTime->getTimestamp() == $b->startTime->getTimestamp()) {\n\t\treturn 0;\n\t}\n\treturn ($a->startTime->getTimestamp() < $b->startTime->getTimestamp()) ? -1 : 1;\n}", "function compare_scores($score1, $score2){\r\n return bccomp($score1['finger_counter_count'], $score2['finger_counter_count']);\r\n return ($score1 > $score2) ? -1 : 1;\r\n }", "function version_compare($version1, $version2, $operator = NULL)\n{\n}", "function compareReports(CountyMarriage $r1, \n CountyMarriage $r2)\n{\n return $r1->compare($r2);\n}", "function validateCompare ($input, $input2, $option = 'same') {\n if($input === $input2) {\n return true;\n } else {\n return false;\n }\n}", "function compare_title($a, $b) \n{ \n if (($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG) && ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG))\n return strnatcmp($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]);\n if ($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return 1;\n if ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return -1;\n \n return strcmp_from_utf8($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]); \n}", "function date_compare($a, $b)\n\t\t{\n\t\t\tif (date($a[\"updated_at\"]) == date($b[\"updated_at\"]))\n\t\t\t\treturn 0;\n\n\t\t\treturn (date($a['updated_at']) < date($b['updated_at'])) ? -1 : 1;\n\n\t\t}", "function key_compare_func($a, $b) {\n if ($a === $b) {\n return 0;\n }\n return ($a > $b) ? 1 : -1;\n}", "function cmp_entries($a, $b){\n $a_nameparts = explode(\" \", $a[\"name\"], 2);\n $b_nameparts = explode(\" \", $b[\"name\"], 2);\n $result = 0;\n if( isset($a_nameparts[1]) && isset($b_nameparts[1]) ){\n $result = strcmp($a_nameparts[1], $b_nameparts[1]);\n }\n if( $result === 0 ) {\n $result = strcmp($a_nameparts[0], $b_nameparts[0]);\n }\n if( $result === 0 ) {\n $result = strcmp($a[\"number\"], $b[\"number\"]);\n }\n return $result;\n}", "function compare_by_area($a, $b)\n{\n $areaA = $a->width * $a->height;\n $areaB = $b->width * $b->height;\n return $areaA <=> $areaB;\n}", "static function card_cmp( $a, $b ) {\n return $a->number - $b->number;\n }", "function compare($X, $Y) {\n return ($Y['count'] - $X['count']);\n}", "function compareElems($elem1, $elem2) {\n return strcmp($elem1['apellidos'], $elem2['apellidos']);\n }", "function cmp_obj($a, $b)\r\n {\r\n $al = $a->Top;\r\n $bl = $b->Top;\r\n if ($al == $bl) {\r\n return 0;\r\n }\r\n return ($al > $bl) ? +1 : -1;\r\n }", "function cmpElemValues($a, $b){\n\t\tglobal $args;\n\t\t$aval = getElemOrAttrVal($a, $args[\"query\"][\"ord\"][0]);\n\t\t$bval = getElemOrAttrVal($b, $args[\"query\"][\"ord\"][0]);\n\t\tif($aval == false || $bval == false){\n\t\t\tfprintf(STDERR, \"ERROR! Order element and/or attribute is missing!\\n\");\n\t\t\texit(EINPUTF);\n\t\t}\n\t\t$i = strnatcmp($aval, $bval);\n\t\treturn $args[\"query\"][\"ord\"][1] == 'ASC'? $i : $i*(-1);\n\t}", "function cmpByName($a, $b)\n{\n $an = utf8_strtolower($a);\n $bn = utf8_strtolower($b);\n if ($an == $bn) {\n return 0;\n }\n return($an < $bn) ? -1 : 1;\n}", "function recognizer_node_cmp($a, $b)\r\n{\r\n if($a->score == $b->score) return 0;\r\n return ($a->score < $b->score) ? -1 : 1; //从小到大排序\r\n}", "public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}", "public function compareDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = $this->getData($key);\n $otherValue = $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }", "function compareDeepValue($val1, $val2) {\n return strcmp($val1['post_author'], $val2['post_author']);\n\n}", "function compareEntry($left, $right)\n\t{\n\t\t$ln = strcmp($left[\"last\"], $right[\"last\"]);\n\t\tif($ln == 0)\n\t\t{\n\t\t\treturn(strcmp($left[\"first\"], \n\t\t\t\t$right[\"first\"]));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn($ln);\n\t\t}\n\t}", "function compareParam($param, $comparitor){\n\t$compareParam;\n\t\n\tif($param == null or $param == \"\" or $param === 0 or $param == \"null\"){$compareParam = 0;}\n\telseif($param < $comparitor){$compareParam = \"<\";}\n\telseif($param > $comparitor){$compareParam = \">\";}\n\telseif($param == $comparitor){$compareParam = \"=\";}\n\telse{$compareParam = 0;}\n\t\n\treturn $compareParam;\n}" ]
[ "0.90044045", "0.79739976", "0.7593064", "0.75320464", "0.7281555", "0.70871794", "0.70537275", "0.70528513", "0.69707984", "0.685085", "0.6823544", "0.681698", "0.6801732", "0.6756934", "0.6716562", "0.6596662", "0.658869", "0.65628445", "0.6549852", "0.651249", "0.6501288", "0.64563596", "0.644276", "0.64279777", "0.64121777", "0.64073104", "0.64008546", "0.63612294", "0.636082", "0.635169", "0.63374865", "0.6334379", "0.63336134", "0.6321321", "0.6293725", "0.62701875", "0.62626475", "0.62437207", "0.62435526", "0.6242993", "0.6221749", "0.622087", "0.6216222", "0.62072223", "0.6204705", "0.6196768", "0.61798793", "0.6169586", "0.6163901", "0.6161513", "0.6160112", "0.6152375", "0.61501414", "0.61433434", "0.6133184", "0.6130322", "0.6126646", "0.6114553", "0.6111988", "0.6111463", "0.6094315", "0.60942066", "0.6093432", "0.60926247", "0.60775244", "0.60737133", "0.60726875", "0.6063398", "0.6055998", "0.6055998", "0.6046979", "0.6038664", "0.602755", "0.6020402", "0.60067904", "0.6001227", "0.5995586", "0.5990697", "0.5980066", "0.5974072", "0.5972153", "0.59679854", "0.59659374", "0.5959084", "0.59582996", "0.59479356", "0.5946248", "0.5944118", "0.5931906", "0.59302855", "0.5923031", "0.59030354", "0.59013057", "0.5900755", "0.589857", "0.5896745", "0.58860433", "0.58848405", "0.5882559", "0.5879788", "0.5870398" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { $usuario = Auth::User(); //se ele e master if($usuario->tipo_usuario_id!=8){ return false; } 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 [ 'txt_nome_dirigente' => 'required|min:3|max:100', 'txt_cargo_dirigente' => 'required|min:3|max:100', 'txt_cpf_dirigente' => 'required|cpf', 'txt_email_dirigente' => 'required|email|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
This file is part of Moodle Moodle is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Moodle is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Moodle. If not, see < function to draw tab and call correspondent function
function tab($courseid, $blockid, $forum, $chatid, $groupid, $current_tab = 'description') { global $CFG; $tabs = array(); $row = array(); $inactive = array(); $activated = array(); if (!$groupid) { // Imprime o map somente se houver grupo. $inactive[] = 'map'; } $row[] = new tabobject('description', $CFG->wwwroot.'/blocks/pbltool/view.php?blockid='.$blockid.'&courseid='.$courseid.'&groupid='.$groupid, get_string('description', 'block_pbltool')); $row[] = new tabobject('tasks', $CFG->wwwroot.'/blocks/pbltool/view_tasks.php?blockid='.$blockid.'&courseid='.$courseid.'&groupid='.$groupid , get_string('tasks', 'block_pbltool')); $row[] = new tabobject('map', $CFG->wwwroot.'/blocks/pbltool/view_gantt.php?blockid='.$blockid.'&courseid='.$courseid.'&groupid='.$groupid.'" onclick="this.target=\'map\'; return openpopup(\'/blocks/pbltool/view_gantt.php?blockid='.$blockid.'&courseid='.$courseid.'&groupid='.$groupid.'\' ,\'map\', \'resizable=1,scrollbars=1,directories=o,location=0,menubar=0,toolbar=0,status=0,width=800,height=450\');', get_string('map', 'block_pbltool')); $row[] = new tabobject('forum', $CFG->wwwroot.'/mod/forum/view.php?f='.$forum . '&group=' . $groupid . '" onclick="this.target=\'forum\'; return openpopup(\'/mod/forum/view.php?f='.$forum .'&group=' . $groupid .'\' ,\'forum\', \'resizable=1,scrollbars=1,directories=o,location=0,menubar=0,toolbar=0,status=0,width=1000,height=600\');', get_string('forum', 'block_pbltool')); if ($groupid) { $row[] = new tabobject('chat', $CFG->wwwroot.'/mod/chat/gui_header_js/index.php?id='.$chatid.'&groupid='.$groupid. '" onclick="this.target=\'chat\'; return openpopup(\'/mod/chat/gui_header_js/index.php?id='.$chatid.'&groupid='.$groupid .'\' ,\'chat\', \'resizable=1,scrollbars=1,directories=o,location=0,menubar=0,toolbar=0,status=0,width=800,height=450\');', get_string('groupchat', 'block_pbltool')); } else { $row[] = new tabobject('chat', $CFG->wwwroot.'/mod/chat/gui_header_js/index.php?id='.$chatid.'&groupid='.$groupid. '" onclick="this.target=\'chat\'; return openpopup(\'/mod/chat/gui_header_js/index.php?id='.$chatid.'&groupid='.$groupid .'\' ,\'chat\', \'resizable=1,scrollbars=1,directories=o,location=0,menubar=0,toolbar=0,status=0,width=800,height=450\');', get_string('Chat', 'block_pbltool')); } if (count($row) > 1) { $tabs[] = $row; return print_tabs($tabs, $current_tab, $inactive, $activated, true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emarking_tabs_markers_training($context, $cm, $emarking, $generalprogress, $delphiprogress) {\n global $CFG;\n global $USER;\n global $OUTPUT;\n // Tab's icons.\n $timeicon = $OUTPUT->pix_icon('i/scheduled', null);\n $scalesicon = $OUTPUT->pix_icon('i/scales', null);\n // Array for tabs data.\n $tabs = array();\n $firststagetable = new html_table();\n $firststagetable->data [] = array(\n get_string('stage', 'mod_emarking'),\n $timeicon . \" \" . get_string('marking_deadline', 'mod_emarking'),\n $scalesicon . \" \" . get_string('stage_general_progress', 'mod_emarking'));\n if ($generalprogress >= 100 && $emarking->firststagedate < time()) {\n $firststagetable->data [] = array(\n get_string('delphi_stage_one', 'mod_emarking'),\n \"&nbsp;\",\n $OUTPUT->pix_icon('i/grade_correct', \"\"));\n } else {\n $firststagetable->data [] = array(\n get_string('delphi_stage_one', 'mod_emarking'),\n emarking_time_difference($emarking->firststagedate, time(), false),\n emarking_get_progress_circle($generalprogress));\n }\n $firststagetable->data [] = array(\n get_string('delphi_stage_two', 'mod_emarking'),\n emarking_time_difference($emarking->secondstagedate, time(), false),\n emarking_get_progress_circle($delphiprogress));\n return html_writer::table($firststagetable);\n}", "function training_tabs_callback() {\n ctools_include('menu');\n $tab_1 = array(\n 'title' => 'First tab',\n 'href' => 'training/ctools/tabs/tab1',\n );\n $tab_2 = array(\n 'title' => 'Second tab',\n 'href' => 'training/ctools/tabs/tab2',\n );\n ctools_menu_add_tab($tab_1);\n ctools_menu_add_tab($tab_2);\n if (arg(3) == 'tab2') {\n return t('Tab 2 content');\n }\n\n return t('Tab 1 content');\n}", "abstract protected function tabs();", "function account_tab( $tabs ) {\n\n\t\t$tabs[1000]['points']['icon'] = 'um-faicon-trophy';\n\t\t$tabs[1000]['points']['title'] = __( 'My Points', 'twodayssss' );\n\t\t$tabs[1000]['points']['submit_title'] = __( 'My Points', 'twodayssss' );\n\t\t$tabs[1000]['points']['show_button'] = false;\n\n\t\treturn $tabs;\n\t}", "function tab_name() {\n return 'Graph Plugin';\n }", "abstract public function bootAddTab($group, $id, $label);", "function draw_pic ($tab)\n\t{\n\t\t$image = imagecreate($this->pic_width, $this->pic_height);\n\n\t\t// allocation des couleurs\n\t\t$white = imagecolorallocate($image, 255, 255, 255);\n//\t\t$black = imagecolorallocate($image, 0, 0, 0);\t\t\n\t\t$black = imagecolorallocate($image, 50, 58, 77);\t\t\n $grey = imagecolorallocate($image, 84, 96, 117);\n\t\t$red = imagecolorallocate($image, 255, 0, 0);\n\t\t$blue = imagecolorallocate($image, 199, 205, 209);\n\t\t$light_grey = imagecolorallocate($image, 211, 217, 232);\n\t\t$title_color = $black;\n\t\t$shadow_color = $black;\n\n\t\t// calcul de l'echelle a utiliser pour le repere du graphique\n\t\t$this->get_xy($tab);\n\t\t$this->calc_scale();\n\n\t\t// affichage du repere\n\t\timageline($image, 30, 30, 30, $this->pic_height - 60, $black);\n\t\timageline($image, 25, $this->pic_height - 60, $this->pic_width - 30, $this->pic_height - 60,$black);\n\n\t\t// affichage des fleches\n\t\timagefilledpolygon($image, array(26, 30, 34, 30, 30, 22), 3, $black);\n//\t\timagefilledpolygon($image, array($this->pic_width - 30, $this->pic_height - 64, $this->pic_width - 30, $this->pic_height - 56, $this->pic_width - 23, $this->pic_height - 60), 3, $black);\n\n\t\t// affichage de l'echelle des ordonnees et des abcisses\n\t\t$this->draw_y($image, $black, $grey, $light_grey, $tab);\n\t\t$this->draw_x($image, $black, $grey, $tab, $title_color);\n\n\t\t// affichage de l'histogram et de l'echelle des abcisses\n\t\t$this->draw_histo($image, $tab, $blue, $black, $shadow_color);\n\n\t\t//creation et affichage de l'image finale\n\t\timagegif($image);\n\t}", "function change_tabs($tabs){\n $tabs['additional_information']['title'] = 'Характеристики';\n return $tabs;\n}", "function settings_gui(){\n\t$tabs = new tabs('system_settings');\n\t$tabs->add('capabilities','Brukerroller');\n\t\n\t$tabs->draw();\n\tglobal $hd_active_tab;\n\tswitch($hd_active_tab) {\n\t\tcase 'capabilities':\n\t\t\trequire_once('gui.capabilites.settings.php');\n\t\t\tgui_capas();\n\t\t\tbreak;\n\t}\n}", "abstract protected function draw($regatta_name, $host, $date, Array $blocks);", "public function describeTabs();", "function tab_add_instance($tab) {\n global $CFG, $DB;\n\n require_once(\"$CFG->libdir/resourcelib.php\");\n\n $cmid = $tab->coursemodule;\n $tab->timemodified = time();\n\n\n //insert tabs and content\n if ($tab->id = $DB->insert_record(\"tab\", $tab)) {\n\n // we need to use context now, so we need to make sure all needed info is already in db\n $DB->set_field('course_modules', 'instance', $tab->id, array('id' => $cmid));\n $context = context_module::instance($cmid);\n $editoroptions = array('subdirs' => 1, 'maxbytes' => $CFG->maxbytes, 'maxfiles' => -1, 'changeformat' => 1, 'context' => $context, 'noclean' => 1, 'trusttext' => true);\n\n foreach ($tab->tabname as $key => $value) {\n $value = trim($value);\n if (isset($value) && $value <> '') {\n $option = new stdClass();\n $option->tabname = $value;\n $option->tabid = $tab->id;\n\n if (isset($tab->content[$key]['format'])) {\n $option->contentformat = $tab->content[$key]['format'];\n }\n\n if (isset($tab->tabcontentorder[$key])) {\n $option->tabcontentorder = $tab->tabcontentorder[$key];\n }\n\n if (isset($tab->content[$key]['externalurl'])) {\n $option->externalurl = $tab->content[$key]['externalurl'];\n }\n $option->timemodified = time();\n //Must get id number from inserted record to update the editor field (tabcontent)\n $newtab_content_id = $DB->insert_record(\"tab_content\", $option);\n\n //tab content is now an array due to the new editor\n //In order to enter file information from the editor\n //We must now update the record once it has been created\n\n if (isset($tab->content[$key]['text'])) {\n $draftitemid = $tab->content[$key]['itemid'];\n if ($draftitemid) {\n $tabcontentupdate = new stdClass();\n $tabcontentupdate->id = $newtab_content_id;\n $tabcontentupdate->tabcontent = file_save_draft_area_files($draftitemid, $context->id, 'mod_tab', 'content', $newtab_content_id, $editoroptions, $tab->content[$key]['text']);\n $DB->update_record('tab_content', $tabcontentupdate);\n }\n }\n }\n }\n }\n return $tab->id;\n}", "public function getTableOverlay();", "public function setTabs($model = NULL, &$tabs = NULL) {\n\t\t$drawingController = new DrawingController(NULL);\n\t\t$_GET['parent_id'] = $_GET['drawing_id'];\n\t\t$drawingController->setTabs(NULL);\n\t\tstatic::$tabs = $drawingController->tabs;\n\t\t$this->setActiveTabs(NULL, DrawingToAssembly::getNiceNamePlural());\n\t\t$this->breadcrumbs = DrawingController::getBreadCrumbTrail();\n\t}", "function debug($tab){\n\techo '<div style=\"color: white; padding: 20px; font-weight: bold; background:#' . rand(111111, 999999) . '\">';\n\n\t$trace = debug_backtrace(); // Retourne les infos sur l'emplace ou est executee une fonction\n\techo 'Le debug a ete demande dans le fichier : ' . $trace[0]['file'] . ' à la ligne : ' . $trace[0]['line'] . '</hr>';\n\n\n\n\n\n echo '<pre>';\n print_r($tab);\n echo '</pre>';\n\n\n echo '</div>';\n\n}", "abstract public function bootEndTab();", "function getTabs(&$tabs_gui)\n\t{\n\t\tglobal $rbacsystem;\n\n\t\t// properties\n\t\tif ($rbacsystem->checkAccess(\"write\", $_GET[\"ref_id\"]))\n\t\t{\n\t\t\t$tabs_gui->addTarget(\"edit_properties\",\n\t\t\t\t\"repository.php?cmd=properties&ref_id=\".$_GET[\"ref_id\"],\n\t\t\t\t\"properties\");\n\t\t}\n\n\t\t// edit permission\n\t\tif ($rbacsystem->checkAccess(\"edit_permission\", $_GET[\"ref_id\"]))\n\t\t{\n\t\t\t$tabs_gui->addTarget(\"perm_settings\",\n\t\t\t\t\"repository.php?cmd=permissions&ref_id=\".$_GET[\"ref_id\"],\n\t\t\t\t\"permissions\");\n\t\t}\n\t}", "function setTabs(){\n global $ilTabs, $ilCtrl, $ilAccess, $ilLocator;\n\n // show current quiz round inlcuding link and QR code (deadline)\n if ($ilAccess->checkAccess(\"read\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"showCurrentRound\", $this->txt(\"tabmenu_showCurrentRound\"), $ilCtrl->getLinkTarget($this, \"showCurrentRound\"));\n }\n\n // tab for the \"edit quiz\" command\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"editQuiz\", $this->txt(\"tabmenu_edit_quiz\"), $ilCtrl->getLinkTarget($this, \"editQuiz\"));\n }\n\n // show round results\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"showResults\", $this->txt(\"tabmenu_show_result\"), $ilCtrl->getLinkTarget($this, \"showResults\"));\n }\n\n // a \"properties\" tab\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"properties\", $this->txt(\"tabmenu_properties\"), $ilCtrl->getLinkTarget($this, \"editProperties\"));\n $this->addPermissionTab();\n }\n\n // information Tab\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"info\", $this->txt(\"tabmenu_info\"), $ilCtrl->getLinkTarget($this, \"info\"));\n }\n\n }", "function add_from_tab() {\n ?>\n <a href=\"#wpuf-metabox-qr-code\" class=\"nav-tab\" id=\"wpuf-qr-code-tab\"><?php _e( 'QR Code', 'wpuf-pro' ); ?></a>\n <?php\n }", "public function tab1(){\n $this->layout = new \\stdClass();\n \n if($this->model->getConfigParam('actionimage1')){\n $this->layout->scroll[] = $this->getComponentImage($this->model->getConfigParam('actionimage1'),\n [],\n ['margin' => '120 80 10 80']);\n $margin = 20;\n } else {\n $margin = 140;\n }\n\n $this->layout->scroll[] = $this->getComponentText('{#collect_location_matching#}', array(), array(\n 'padding' => $margin.' 40 10 40',\n 'text-align' => 'center',\n 'font-size' => '27',\n 'font-ios' => 'Lato-Light',\n 'font-android' => 'Lato-Light',\n ));\n\n $onclick[] = $this->getOnclickLocation(['sync_open' => 1]);\n $onclick[] = $this->getOnclickOpenAction('people',false,['sync_open' => 1]);\n\n $this->layout->footer[] = $this->getComponentSpacer('20');\n $this->layout->footer[] = $this->uiKitButtonHollow('{#enable_location#}',[\n 'onclick' => $onclick\n ]);\n $this->layout->footer[] = $this->getComponentSpacer('20');\n\n\n\n return $this->layout;\n }", "function tab_restore_mods($mod,$restore) {\r\n\r\n global $CFG;\r\n\r\n $status = true;\r\n\r\n //Get record from backup_ids\r\n $data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);\r\n\r\n if ($data) {\r\n //Now get completed xmlized object\r\n $info = $data->info;\r\n //traverse_xmlize($info); //Debug\r\n //print_object ($GLOBALS['traverse_array']); //Debug\r\n //$GLOBALS['traverse_array']=\"\"; //Debug\r\n \r\n //Now, build the tab record structure\r\n $tab->course = $restore->course_id;\r\n $tab->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);\r\n $tab->tab1 = backup_todb($info['MOD']['#']['TAB1']['0']['#']);\r\n\t\t\t$tab->tab2 = backup_todb($info['MOD']['#']['TAB2']['0']['#']);\r\n\t\t\t$tab->tab3 = backup_todb($info['MOD']['#']['TAB3']['0']['#']);\r\n\t\t\t$tab->tab4 = backup_todb($info['MOD']['#']['TAB4']['0']['#']);\r\n\t\t\t$tab->tab5 = backup_todb($info['MOD']['#']['TAB5']['0']['#']);\r\n\t\t\t$tab->tab6 = backup_todb($info['MOD']['#']['TAB6']['0']['#']);\r\n\t\t\t$tab->tab7 = backup_todb($info['MOD']['#']['TAB7']['0']['#']);\r\n\t\t\t$tab->tab8 = backup_todb($info['MOD']['#']['TAB8']['0']['#']);\r\n\t\t\t$tab->tab9 = backup_todb($info['MOD']['#']['TAB9']['0']['#']);\r\n\t\t\t$tab->tab0 = backup_todb($info['MOD']['#']['TAB0']['0']['#']);\r\n\t\t\t$tab->tab1content = backup_todb($info['MOD']['#']['TAB1CONTENT']['0']['#']);\r\n\t\t\t$tab->tab2content = backup_todb($info['MOD']['#']['TAB2CONTENT']['0']['#']);\r\n\t\t\t$tab->tab3content = backup_todb($info['MOD']['#']['TAB3CONTENT']['0']['#']);\r\n\t\t\t$tab->tab4content = backup_todb($info['MOD']['#']['TAB4CONTENT']['0']['#']);\r\n\t\t\t$tab->tab5content = backup_todb($info['MOD']['#']['TAB5CONTENT']['0']['#']);\r\n\t\t\t$tab->tab6content = backup_todb($info['MOD']['#']['TAB6CONTENT']['0']['#']);\r\n\t\t\t$tab->tab7content = backup_todb($info['MOD']['#']['TAB7CONTENT']['0']['#']);\r\n\t\t\t$tab->tab8content = backup_todb($info['MOD']['#']['TAB8CONTENT']['0']['#']);\r\n\t\t\t$tab->tab9content = backup_todb($info['MOD']['#']['TAB9CONTENT']['0']['#']);\r\n\t\t\t$tab->tab0content = backup_todb($info['MOD']['#']['TAB0CONTENT']['0']['#']);\r\n\t\t\t$tab->css = backup_todb($info['MOD']['#']['CSS']['0']['#']);\r\n\t\t\t$tab->menucss = backup_todb($info['MOD']['#']['MENUCSS']['0']['#']);\r\n\t\t\t$tab->displaymenu = backup_todb($info['MOD']['#']['DISPLAYMENU']['0']['#']);\r\n\t\t\t$tab->menuname = backup_todb($info['MOD']['#']['MENUNAME']['0']['#']);\r\n $tab->timemodified = $info['MOD']['#']['TIMEMODIFIED']['0']['#'];\r\n \r\n //The structure is equal to the db, so insert the tab\r\n $newid = insert_record (\"tab\",$tab);\r\n\r\n //Do some output \r\n if (!defined('RESTORE_SILENTLY')) {\r\n echo \"<li>\".get_string(\"modulename\",\"tab\").\" \\\"\".format_string(stripslashes($tab->name),true).\"\\\"</li>\";\r\n }\r\n backup_flush(300);\r\n\r\n if ($newid) {\r\n //We have the newid, update backup_ids\r\n backup_putid($restore->backup_unique_code,$mod->modtype,\r\n $mod->id, $newid);\r\n \r\n } else {\r\n $status = false;\r\n }\r\n } else {\r\n $status = false;\r\n }\r\n\r\n return $status;\r\n }", "function dllc_add_instance(stdClass $dllc, mod_dllc_mod_form $mform = null) {\n global $DB,$COURSE;\n $courseid = $COURSE->id;\n\n $data = new stdClass();\n $data->courseid = $courseid;\n $data->name = 'Participants '.$mform->get_data()->dateheuredebut;\n $data->description = 'Groupe pour les etudiants inscirts à l\\'atelier ';\n $data->descriptionformat = FORMAT_HTML;\n try {\n $newgroupid = groups_create_group($data);\n } catch (moodle_exception $e) {\n echo $e;\n }\n $dllc->timecreated = time();\n $dllc->salle = $mform->get_data()->salle;\n $dllc->grade = '';\n $dllc->c_atelier = $mform->get_data()->c_atelier;\n $dllc->niveau = $mform->get_data()->niveau;\n $dllc->ateliers = $mform->get_data()->ateliers;\n $dllc->dateheuredebut = $mform->get_data()->dateheuredebut;\n $dllc->dateheurefin = $mform->get_data()->dateheurefin;\n $dllc->nbplacedispo = $mform->get_data()->nbplacedispo;\n $dllc->idgroup = $newgroupid ;\n\n try {\n $dllc->id = $DB->insert_record('dllc', $dllc);\n } catch (dml_exception $e) {\n echo $e;\n }\n dllc_grade_item_update($dllc);\n\n return $dllc->id;\n\n\n\n}", "private function createTab()\n {\n try {\n if (LengowMain::compareVersion()) {\n $tabParent = new Tab();\n $tabParent->name[Configuration::get('PS_LANG_DEFAULT')] = 'Lengow';\n $tabParent->module = 'lengow';\n $tabParent->class_name = 'AdminLengow';\n $tabParent->id_parent = 0;\n $tabParent->add();\n } else {\n $tabParent = new Tab(Tab::getIdFromClassName('AdminCatalog'));\n $tab = new Tab();\n $tab->name[Configuration::get('PS_LANG_DEFAULT')] = 'Lengow';\n $tab->module = 'lengow';\n $tab->class_name = 'AdminLengowHome14';\n $tab->id_parent = $tabParent->id;\n $tab->add();\n $tabParent = $tab;\n }\n foreach ($this->tabs as $name => $values) {\n if (_PS_VERSION_ < '1.5' && $values['name'] === 'AdminLengowHome') {\n continue;\n }\n $tab = new Tab();\n if (_PS_VERSION_ < '1.5') {\n $tab->class_name = $values['name'] . '14';\n $tab->id_parent = $tabParent->id;\n } else {\n $tab->class_name = $values['name'];\n $tab->id_parent = $tabParent->id;\n $tab->active = $values['active'];\n }\n $tab->module = $this->lengowModule->name;\n $languages = Language::getLanguages(false);\n foreach ($languages as $language) {\n $tab->name[$language['id_lang']] = LengowMain::decodeLogMessage($name, $language['iso_code']);\n }\n $tab->add();\n LengowMain::log(\n LengowLog::CODE_INSTALL,\n LengowMain::setLogMessage('log.install.install_tab', array('class_name' => $tab->class_name))\n );\n }\n return true;\n } catch (Exception $e) {\n return false;\n }\n }", "public function tab() {\n $args = func_get_args();\n\n if (count($args) == 0) {\n return $this->info['tab'];\n } else {\n $tab = array();\n\n if (!is_array($args[0])) {\n $tab['name'] = $args[0];\n } else {\n $tab = $args[0];\n }\n\n if (isset($args[1])) {\n $tab['plugin'] = $args[0];\n }\n\n if (isset($args[2])) {\n $tab['label'] = $args[2];\n }\n\n $tab = array_merge(array(\n 'plugin' => $this->id(),\n 'flag' => null,\n ), $tab);\n\n $this->hook('nav-tab', 'createNavTab', array(\n $tab['name'],\n $tab['plugin'],\n $tab['label'],\n $tab['flag'])\n );\n }\n }", "function generateTabs($pScreenName, $pRestriction = ''){\n if(0 == count($this->getScreens())){\n return '';\n }\n\n $content = '';\n $tabs = array();\n $Screens =& $this->getScreens();\n\n if (\"List\" == $pScreenName){\n if(empty($this->addNewName)){\n $addNewName = $this->SingularRecordName;\n } else {\n $addNewName = $this->addNewName;\n }\n\t\t\t$content = '';\n if($this->AllowAddRecord){\n if('view' == $pRestriction){\n //$content = \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|You cannot add a new {$addNewName} because you don't have permission\\\"), 'disabled');\";\n } else {\n //get first edit screen and insert a tab link to it as \"new\"\n foreach ($Screens as $Screen){\n if ('editscreen' == strtolower(get_class($Screen))){\n\t\t\t\t\t\t\t$content = \"\\$tabs['New'] = array(\\\"edit.php?mdl={$this->ModuleID}&amp;scr={$Screen->name}\\\", gettext(\\\"Add New|Add a new \\\").gettext(\\\"{$addNewName}\\\"));\";\t\n break; //exits loop\n }\n }\n }\n } else {\n // $content = \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|To add a new {$addNewName} you must go to a parent module\\\"), 'disabled');\";\n }\n \n\n //get search screen and insert a tab link to it\n if(count($Screens)){\n foreach ($Screens as $Screen){\n if ('searchscreen' == strtolower(get_class($Screen))){\n $content .= \"\\$tabs['Search'] = array(\\\"search.php?mdl={$this->ModuleID}\\\", gettext(\\\"Search|Search in \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n //$content .= \"\\$tabs['Reports'] = array(\\\"reports.php?mdl={$this->ModuleID}\\\", gettext(\\\"Reports|Reports for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\tif( true == $this->areChartsDefined() ){\n\t\t\t\t\t\t\t$content .= \"\\$tabs['Charts'] = array(\\\"charts.php?mdl={$this->ModuleID}\\\", gettext(\\\"Charts|Charts for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\t}\n } \n }\n }\n if($this->dataCollectionForm){\n $content .= \"\\$tabs['DataCollection'] = array(\\\"dataCollectionForm.php?mdl={$this->ModuleID}\\\", gettext(\\\"Blank Form|Blank form for \\\").gettext(\\\"{$this->PluralRecordName}\\\"), 'download');\";\n }\n } elseif (\"ListCtxTabs\" == $pScreenName){\n\t\t\n//$tabs['List'] = Array(\"list.php?$qs\", gettext(\"List|View the list of /**plural_record_name**/\"));\n\t\t\t$content = \"\\$tabs['List'] = array(\\\"list.php?\\$qs\\\", gettext(\\\"List|View the list of \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\tif(empty($this->addNewName)){\n $addNewName = $this->SingularRecordName;\n } else {\n $addNewName = $this->addNewName;\n }\n\n if($this->AllowAddRecord){\n if('view' == $pRestriction){\n // $content .= \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|You cannot add a new {$addNewName} because you don't have permission\\\"), 'disabled');\";\n } else {\n //get first edit screen and insert a tab link to it as \"new\"\n foreach ($Screens as $Screen){\n if ('editscreen' == strtolower(get_class($Screen))){\n\t\t\t\t\t\t\t$content .= \"\\$tabs['New'] = array(\\\"edit.php?mdl={$this->ModuleID}&amp;scr={$Screen->name}\\\", gettext(\\\"Add New|Add a new \\\").gettext(\\\"{$addNewName}\\\"));\";\t\n\n break; //exits loop\n }\n }\n }\n } else {\n //$content = \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|To add a new {$addNewName} you must go to a parent module\\\"), 'disabled');\";\n }\n \n\n //get search screen and insert a tab link to it\n if(count($Screens)){\n foreach ($Screens as $Screen){\n if ('searchscreen' == strtolower(get_class($Screen))){\n $content .= \"\\$tabs['Search'] = array(\\\"search.php?mdl={$this->ModuleID}\\\", gettext(\\\"Search|Search in \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\t//$content .= \"\\$tabs['Reports'] = array(\\\"reports.php?mdl={$this->ModuleID}\\\", gettext(\\\"Reports|Reports for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\tif( true == $this->areChartsDefined() ){\n\t\t\t\t\t\t\t$content .= \"\\$tabs['Charts'] = array(\\\"charts.php?mdl={$this->ModuleID}\\\", gettext(\\\"Charts|Charts for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n }\n }\n if($this->dataCollectionForm){\n $content .= \"\\$tabs['DataCollection'] = array(\\\"dataCollectionForm.php?mdl={$this->ModuleID}\\\", gettext(\\\"Blank Form|Blank form for \\\").gettext(\\\"{$this->PluralRecordName}\\\"), 'download');\";\n }\n\t\t}elseif( \"EditScreenPermissions\" == $pScreenName ){\n\t\t\t$content = '';\n\t\t\tforeach ($Screens as $Screen){\t\t\t\n\t\t\t\tif( 'editscreen' == strtolower(get_class($Screen)) AND isset($Screen->EditPermission) ){\n\t\t\t\t\t$content .= \"\\$EditScrPermission['{$Screen->name}'] = '{$Screen->EditPermission}';\\n\";\t\n\t\t\t\t}\n }\n\t\t\tif( $content != '' ){\n\t\t\t\tforeach ($Screens as $Screen){\t\t\t\n\t\t\t\t\tif( 'editscreen' == strtolower(get_class($Screen)) AND !isset($Screen->EditPermission) ){\n\t\t\t\t\t\t$content .= \"\\$EditScrPermission['{$Screen->name}'] = '{$this->ModuleID}';\\n\";\t\n\t\t\t\t\t}\n }\n\t\t\t}\n\t\t\n\t\t}elseif( \"ListRecordMenu\" == $pScreenName ){ \n\t\t \n\t\t\t$recordMenuCounter = 0;\n\t\t\t\t\n\t\t\tforeach ($Screens as $Screen){\n $linkTo = '';\n $tab = '';\n\t\t\t\t$recordMenu = '';\n\t\t\t\t$recordMenuEntries = '';\n\t\t\t\t\n switch( strtolower(get_class($Screen)) ){\n case \"viewscreen\":\n $handler = \"view.php\"; \n $phrase = \"View|View summary information about a record of type \\\").gettext(\\\"\". $this->SingularRecordName;\n break;\n case \"editscreen\":\n if(!empty($Screen->linkToModuleID)){\n $linkTo = $Screen->linkToModuleID;\n }\n $handler = \"edit.php\";\n\n if (empty($Screen->phrase)){\n $phrase = $Screen->name;\n } else {\n $phrase = $Screen->phrase;\n }\n break;\n case \"searchscreen\":\n $handler = \"search.php\";\n $phrase = \"Search|Search in \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"listscreen\":\n $handler = \"list.php\";\n $phrase = \"List|View the list of \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"recordreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"listreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"anoneditscreen\":\n continue;\n break;\n default:\n print_r($Screens);\n die(\"unknown screen type: '\".get_class($Screen).\"'\\n\");\n }\n\n\t\t\t\t$recordMenu = '$recordMenuEntries['.$Screen->name.']='.\"'{ text: \\\"'.strip_tags( ShortPhrase( gettext(\\\"{$phrase}\\\") ) ).'\\\" }';\\n\";\n\n $tabConditionModuleID = '';\n if(!empty($Screen->tabConditionModuleID)){\n $tabConditionModuleID = \", '{$Screen->tabConditionModuleID}'\";\n }\n\n\t\t\t\tif( ( \"view\" == $pRestriction && \"viewscreen\" == strtolower(get_class($Screen)) ) \n\t\t\t\t || (\"view\" != $pRestriction) ){\n\t\t\t\t\tif($linkTo == ''){\t\t\t\t\t\t\n\t\t\t\t\t\t$recordMenuURL = '$recordMenuURL['.$Screen->name.']= '.\"\\\"$handler?scr={$Screen->name}&mdl={$this->ModuleID}\\\";\\n\"; \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$recordMenuURL = '$recordMenuURL['.$Screen->name.']= '.\"\\\"$handler?scr={$Screen->name}&mdl=$linkTo\\\";\\n\"; \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 if( in_array(strtolower(get_class($Screen)), array('viewscreen', 'editscreen', 'recordreportscreen')) ){ \n\t\t\t\t\t$recordMenuList .= $recordMenu;\n\t\t\t\t\t$recordMenuURLList .= $recordMenuURL;\t\t\t\t\t\n }\n }\t\t\t\n\t\t\t\n\t\t\t$content = $recordMenuList.$recordMenuURLList;\n\t\n\t\t}else {\n print \"m. GenerateTabs: current screen $pScreenName\\n\";\n\n $currentScreen = $this->getScreen($pScreenName);\n\n foreach ($Screens as $Screen){\n $linkTo = '';\n $tab = '';\n switch(strtolower(get_class($Screen))){\n case \"viewscreen\":\n $handler = \"view.php\";\n /* if(in_array($this->SingularRecordName[0], array('a','e','i','o','h','y','A','E','I','O','H','Y'))){\n $a = 'an';\n } else {\n $a = 'a';\n } */\n $phrase = \"View|View summary information about a record of type \\\").gettext(\\\"\". $this->SingularRecordName;\n break;\n case \"editscreen\":\n if(!empty($Screen->linkToModuleID)){\n $linkTo = $Screen->linkToModuleID;\n }\n $handler = \"edit.php\";\n\n if (empty($Screen->phrase)){\n $phrase = $Screen->name;\n } else {\n $phrase = $Screen->phrase;\n }\n break;\n case \"searchscreen\":\n $handler = \"search.php\";\n $phrase = \"Search|Search in \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"listscreen\":\n $handler = \"list.php\";\n $phrase = \"List|View the list of \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"recordreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"listreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"anoneditscreen\":\n continue;\n break;\n default:\n print_r($Screens);\n die(\"unknown screen type: '\".get_class($Screen).\"'\\n\");\n }\n\n $tabConditionModuleID = '';\n if(!empty($Screen->tabConditionModuleID)){\n $tabConditionModuleID = \", '{$Screen->tabConditionModuleID}'\";\n }\n\n if ($pScreenName != $Screen->name){\n if ( ( \"view\" == $pRestriction \n\t\t\t\t\t && ( \"viewscreen\" == strtolower( get_class($Screen) ) \n\t\t\t\t\t || \"recordreportscreen\" == strtolower( get_class($Screen) ) ) ) \n\t\t\t\t\t || (\"view\" != $pRestriction) ){\n\n //insert link\n if($linkTo == ''){\n $tab = \" \\$tabs['{$Screen->name}'] = array( \\\"$handler?scr={$Screen->name}&amp;\\$tabsQS\\\", gettext(\\\"{$phrase}\\\") $tabConditionModuleID);\\n\";\n } else {\n $tab = \" \\$tabs['{$Screen->name}'] = array( \\\"$handler?mdl=$linkTo&amp;rid=\\$recordID\\\", gettext(\\\"{$phrase}\\\") $tabConditionModuleID);\\n\";\n }\n }\n } else {\n //Current screen: insert name only\n $tab = \" \\$tabs['{$Screen->name}'] = array( \\\"\\\", gettext(\\\"{$phrase}\\\") $tabConditionModuleID);\\n\";\n }\n\n if(in_array(strtolower(get_class($Screen)), array('viewscreen', 'editscreen', 'recordreportscreen'))){\n $content .= $tab;\n }\n }\n }\n\n return $content;\n }", "function TablaComprasGeneral()\n {\t\n\t //Logo\n $this->Image(\"./assets/img/logo.png\" , 35 ,12, 80 , 25 , \"PNG\"); \n //Arial bold 15\n $this->SetFont('Courier','B',18);\n //Movernos a la derecha\n $this->Cell(130);\n //Título\n $this->Cell(180,25,'LISTADO GENERAL DE COMPRAS',0,0,'C');\n //Salto de línea\n $this->Ln(30);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'CÉDULA GERENTE :',0,0,'');\n\t$this->CellFitSpace(95,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->CellFitSpace(42,5,'NOMBRE GERENTE :',0,0,'');\n\t$this->CellFitSpace(120,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'TELÉFONO GERENTE :',0,0,'');\n $this->CellFitSpace(95,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->CellFitSpace(42,5,'CORREO GERENTE :',0,0,'');\n $this->CellFitSpace(120,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(10,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'CÓDIGO COMPRA',1,0,'C', True);\n\t$this->CellFitSpace(60,8,'PROVEEDOR',1,0,'C', True);\n\t$this->CellFitSpace(17,8,'STATUS',1,0,'C', True);\n\t$this->CellFitSpace(35,8,'FECHA COMPRA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'ARTICULOS',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'SUBTOTAL CON IVA',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'SUBTOTAL IVA 0%',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'IVA',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'TOTAL IVA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'DESC',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'TOTAL DESC',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'TOTAL PAGO',1,1,'C', True);\n\t\n $tra = new Login();\n $reg = $tra->ListarCompras();\n\t$totalarticulos=0;\n\t$Subtotalconiva=0;\n\t$Subtotalsiniva=0;\n\t$Totaliva=0;\n\t$Totaldescuento=0;\n\t$pagoDescuento=0;\n\t$Pagototal=0;\n\t$a=1;\n\t\n for($i=0;$i<sizeof($reg);$i++){\n\t\n $totalarticulos+=$reg[$i]['articulos'];\n $Subtotalconiva+=$reg[$i]['subtotalivasic'];\n $Subtotalsiniva+=$reg[$i]['subtotalivanoc'];\n\t$Totaliva+=$reg[$i]['totalivac']; \n\t$Totaldescuento+=$reg[$i]['totaldescuentoc']; \n\t$Pagototal+=$reg[$i]['totalc']; \n\t\t\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(10,5,$a++,1,0,'C');\n\t$this->CellFitSpace(30,5,$reg[$i][\"codcompra\"],1,0,'C');\n\t$this->CellFitSpace(60,5,utf8_decode($reg[$i][\"nomproveedor\"]),1,0,'C');\n\t\n\tif($reg[$i]['fechavencecredito']== '0000-00-00') { \n\t$this->CellFitSpace(17, 5,utf8_decode($reg[$i]['statuscompra']),1,0,'C');\n\t} elseif($reg[$i]['fechavencecredito'] >= date(\"Y-m-d\")) { \n\t$this->CellFitSpace(17, 5,utf8_decode($reg[$i]['statuscompra']),1,0,'C');\n\t} elseif($reg[$i]['fechavencecredito'] < date(\"Y-m-d\")) { \n\t$this->CellFitSpace(17, 5,utf8_decode(\"VENCIDA\"),1,0,'C');\n\t}\n\t\t\n\t$this->CellFitSpace(35,5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($reg[$i]['fechacompra']))),1,0,'C');\n\t$this->CellFitSpace(15,5,utf8_decode($reg[$i][\"articulos\"]),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['subtotalivasic'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['subtotalivanoc'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(15,5,utf8_decode(number_format($reg[$i]['ivac'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(25,5,utf8_decode(number_format($reg[$i]['totalivac'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(15,5,utf8_decode(number_format($reg[$i]['descuentoc'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(25,5,utf8_decode(number_format($reg[$i]['totaldescuentoc'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['totalc'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(10,5,'',0,0,'C');\n $this->Cell(32,5,'',0,0,'C');\t\n $this->Cell(60,5,'',0,0,'C');\t\n $this->Cell(15,5,'',0,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(35,5,'TOTAL GENERAL',1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n\t$this->Cell(15,5,utf8_decode($totalarticulos),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Subtotalconiva, 2, '.', ',')),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Subtotalsiniva, 2, '.', ',')),1,0,'C');\n $this->Cell(15,5,\"\",1,0,'C');\n $this->Cell(25,5,utf8_decode(number_format($Totaliva, 2, '.', ',')),1,0,'C');\n $this->Cell(15,5,\"\",1,0,'C');\n $this->Cell(25,5,utf8_decode(number_format($Totaldescuento, 2, '.', ',')),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Pagototal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n \n $this->Ln(12); \n $this->SetFont('courier','B',9);\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]),0,0,'');\n $this->Cell(80,6,'RECIBIDO:__________________________________',0,0,'');\n $this->Ln();\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'FECHA/HORA ELABORACIÓN: '.date('d-m-Y h:i:s A'),0,0,'');\n $this->Cell(80,6,'',0,0,'');\n $this->Ln(4);\n\t\n }", "private function createTab() {\n\t\t$moduleToken = t3lib_formprotection_Factory::get()->generateToken('moduleCall', self::MODULE_NAME);\n\t\treturn $this->doc->getTabMenu(\n\t\t\tarray('M' => self::MODULE_NAME, 'moduleToken' => $moduleToken, 'id' => $this->id),\n\t\t\t'tab',\n\t\t\tself::IMPORT_TAB,\n\t\t\tarray(self::IMPORT_TAB => $GLOBALS['LANG']->getLL('import_tab'))\n\t\t\t) . $this->doc->spacer(5);\n\t}", "public function help_tab(){\r\n $screen = get_current_screen();\r\n\r\n foreach($this->what_helps as $help_id => $tab) {\r\n $callback_name = $this->generate_callback_name($help_id);\r\n if(method_exists($this, 'help_'.$callback_name.'_callback')) {\r\n $callback = array($this, 'help_'.$callback_name.'_callback');\r\n }\r\n else {\r\n $callback = array($this, 'help_callback');\r\n }\r\n // documentation tab\r\n $screen->add_help_tab( array(\r\n 'id' => 'hw-help-'.$help_id,\r\n 'title' => __( $tab['title'] ),\r\n //'content' => \"<p>sdfsgdgdfghfhfgh</p>\",\r\n 'callback' => $callback\r\n )\r\n );\r\n }\r\n }", "function garland_diptera_cdm_taxonpage_tab($tabname){\n switch($tabname){\n case 'Synonymy' : return t('Nomenclature'); break;\n default : return t($tabname);\n }\n}", "public function tabs(&$selectedview) {\n global $COURSE;\n\n $conf = @$this->theblock->config;\n\n if (!empty($conf->informationpageid)) {\n // Page deals with the page format.\n $taburl = new moodle_url('/course/view.php', array('id' => $COURSE->id, 'page' => $conf->informationpageid));\n $rows[0][] = new tabobject('information', $taburl, get_string('menuinformation', 'block_userquiz_monitor'));\n }\n\n /*\n * $label = get_string('menuamfref', 'block_userquiz_monitor', $conf->trainingprogramname);\n * $rows[0][] = new tabobject('schedule', \"view.php?id=\".$COURSE->id.\"&selectedview=schedule\", $label);\n */\n $activated = null;\n $hasexamtabs = false;\n if (!empty($conf->trainingenabled)) {\n\n if (empty($conf->examenabled)) {\n // No tabs at all if only training.\n return;\n }\n\n $trainingtab = get_string('menutest', 'block_userquiz_monitor');\n $taburl = new moodle_url('/course/view.php', array('id' => $COURSE->id, 'selectedview' => 'training'));\n $rows[0][] = new tabobject('training', $taburl, $trainingtab);\n\n $examtab = get_string('menuexamination', 'block_userquiz_monitor');\n $taburl = new moodle_url('/course/view.php', array('id' => $COURSE->id, 'selectedview' => 'examination'));\n $rows[0][] = new tabobject('examination', $taburl, $examtab);\n\n $hasexamtabs = true;\n $examrow = 1;\n if (in_array($selectedview, array('examination', 'examlaunch', 'examresults', 'examhistory'))) {\n $activated = array('examination');\n }\n } else {\n // If only exam enabled, print exam tabs at first level.\n $hasexamtabs = true;\n $examrow = 0;\n }\n\n if ($selectedview == 'examination') {\n $selectedview = 'examlaunch'; // The default.\n }\n\n if ($hasexamtabs) {\n $examtab = get_string('menuexamlaunch', 'block_userquiz_monitor');\n $taburl = new moodle_url('/course/view.php', array('id' => $COURSE->id, 'selectedview' => 'examlaunch'));\n $rows[$examrow][] = new tabobject('examlaunch', $taburl, $examtab);\n\n $examtab = get_string('menuexamresults', 'block_userquiz_monitor');\n $taburl = new moodle_url('/course/view.php', array('id' => $COURSE->id, 'selectedview' => 'examresults'));\n $rows[$examrow][] = new tabobject('examresults', $taburl, $examtab);\n\n if (!empty($conf->examshowdetails)) {\n $examtab = get_string('menuexamdetails', 'block_userquiz_monitor');\n $taburl = new moodle_url('/course/view.php', array('id' => $COURSE->id, 'selectedview' => 'examdetails'));\n $rows[$examrow][] = new tabobject('examdetails', $taburl, $examtab);\n }\n\n if (!empty($conf->examshowhistory)) {\n $examtab = get_string('menuexamhistories', 'block_userquiz_monitor');\n $taburl = new moodle_url('/course/view.php', array('id' => $COURSE->id, 'selectedview' => 'examhistory'));\n $rows[$examrow][] = new tabobject('examhistory', $taburl, $examtab);\n }\n }\n\n return print_tabs($rows, $selectedview, $activated, $activated, true);\n }", "function update_gallery_tab($tabs)\n {\n }", "public function AdminOrdersAfterTableDraw(){\n }", "function sidetab_ui(){\r\n\tglobal $base_over_ride;\r\n\tglobal $login_domain;\r\n\tinclude_once 'admin/sidetab-ui.php';\r\n}", "function group_get_menu_tabs() {\n global $USER;\n static $menu;\n\t\n $group = group_current_group();\n if (!$group) {\n return null;\n }\n\t\n\t//Start-Anusha\n\tif($group->outcome){\n\t\t$groupmem = get_record('group_member','member',$USER->get('id'),'group',$group->id);\n\t}\n\t//End-Anusha\n\t\n\t//Start-Eshwari\n\tif($group->courseoutcome){\n\t\t$groupcoursemem = get_record('group_member','member',$USER->get('id'),'group',$group->id);\n\t}\n\t\n\t//End-Eshwari\n\t//Start-Eshwari\n\t\n\tif($group->courseoffering){\n\t\t$groupofferingmem = get_record('group_member','member',$USER->get('id'),'group',$group->id);\n\t}\n\t\n\t/*\n $menu = array(\n 'info' => array(\n 'path' => 'coursetemplate/info',\n 'url' => 'coursetemplate/view.php?id='.$group->id,\n\n 'title' => 'About',\n 'weight' => 20\n ),\n\t);\n\t*/\n\t//End-Eshwari\n\t $menu = array(\n 'info' => array(\n 'path' => 'groups/info',\n 'url' => 'group/view.php?id='.$group->id,\n 'title' => get_string('About', 'group'),\n\n\n 'weight' => 20\n ),\n\t);\n//Start-Anusha\n\tif($groupmem){\n\t\tif($groupmem->role != \"member\"){\n\t\t\t$menu['members'] = array(\n\t\t\t\t'path' => 'groups/members',\n\t\t\t\t'url' => 'group/members.php?id='.$group->id,\n\t\t\t\t'title' => get_string('Members', 'group'),\n\t\t\t\t'weight' => 30\n\t\t\t);\t\n\t\t}\n\t}else{\n//End-Anusha\n\t\t$menu['members'] = array(\n\t\t\t\t'path' => 'groups/members',\n\t\t\t\t'url' => 'group/members.php?id='.$group->id,\n\t\t\t\t'title' => get_string('Members', 'group'),\n\t\t\t\t'weight' => 30\n\t\t);\n//Start-Anusha\n\t}\n\t//Start-Eshwari \n\t\n\tif($groupcoursemem){\n\t\tif($groupcoursemem->role != \"member\"){\n\t\t\t$menu['members'] = array(\n\t\t\t\t'path' => 'groups/members',\n\t\t\t\t'url' => 'group/members.php?id='.$group->id,\n\t\t\t\t'title' => get_string('Members', 'group'),\n\t\t\t\t'weight' => 30\n\t\t\t);\t\n\t\t}\n\t}else{\n\n\t\t$menu['members'] = array(\n\n\t\t\t\t'path' => 'groups/members',\n\t\t\t\t'url' => 'group/members.php?id='.$group->id,\n\t\t\t\t'title' => get_string('Members', 'group'),\n\t\t\t\t'weight' => 30\n\t\t);\n\n\t}\n\t\n\tif($groupofferingmem){\n\t\tif($groupofferingmem->role != \"member\"){\n\t\t\t$menu['members'] = array(\n\t\t\t\t'path' => 'groups/members',\n\t\t\t\t'url' => 'group/members.php?id='.$group->id,\n\t\t\t\t'title' => get_string('Members', 'group'),\n\t\t\t\t'weight' => 30\n\t\t\t);\t\n\t\t}\n\t}else{\n\n\t\t$menu['members'] = array(\n\n\t\t\t\t'path' => 'groups/members',\n\t\t\t\t'url' => 'group/members.php?id='.$group->id,\n\t\t\t\t'title' => get_string('Members', 'group'),\n\t\t\t\t'weight' => 30\n\t\t);\n\n\t}\n\t\n\t\n\t//End-Eshwari\n\t/*\n\t//Start of subgroup logic by Shashank\n\t$menu['subgroups'] = array(\n\t\t\t\t'path' => 'coursetemplate/subgroups',\n\t\t\t\t'url' => 'coursetemplate/subgroups.php?id='.$group->id,\n\t\t\t\t'title' => 'Sub Template',\n\t\t\t\t'weight' => 35\n\t\t);\n\t//End of subgroup logic by Shashank\n\t*/\n\t//Start of subgroup logic by Shashank\n\t$menu['subgroups'] = array(\n\t\t\t\t'path' => 'groups/subgroups',\n\t\t\t\t'url' => 'group/subgroups.php?id='.$group->id,\n\t\t\t\t'title' => 'Sub Groups',\n\t\t\t\t'weight' => 35\n\t\t);\n//End of subgroup logic by Shashank\n//End-Anusha\t\n if ($group->public || group_user_access($group->id)) {\n $menu['forums'] = array( // @todo: get this from a function in the interaction plugin (or better, make forums an artefact plugin)\n 'path' => 'groups/forums',\n 'url' => 'interaction/forum/index.php?group='.$group->id,\n 'title' => get_string('nameplural', 'interaction.forum'),\n 'weight' => 40,\n );\n }\n\t/*\n $menu['views'] = array(\n 'path' => 'coursetemplate/views',\n 'url' => 'view/groupviews.php?group='.$group->id,\n\n 'title' => 'Views',\n 'weight' => 50,\n );\n\t*/\n\t $menu['views'] = array(\n 'path' => 'groups/views',\n 'url' => 'view/groupviews.php?group='.$group->id,\n 'title' => get_string('Views', 'group'),\n\n\n 'weight' => 50,\n );\n//Start-Anusha\nif($group->outcome){\n $menu['outcome'] = array(\n 'path' => 'groups/outcomes',\n 'url' => 'group/groupoutcome.php?group='.$group->id,\n 'title' => 'Outcome Results',\n 'weight' => 60,\n );\n}\n//End-Anusha\n//Start-Eshwari\n\nif($group->courseoutcome){\n $menu['courseoutcome'] = array(\n 'path' => 'groups/courseofferings',\n 'url' => 'group/groupcourseoffering.php?group='.$group->id,\n 'title' => 'Course offering Outcome Results',\n 'weight' => 60,\n );\n}\n//End-Eshwari\n\n\n if (group_user_access($group->id)) {\n safe_require('grouptype', $group->grouptype);\n $artefactplugins = call_static_method('GroupType' . $group->grouptype, 'get_group_artefact_plugins');\n if ($plugins = get_records_array('artefact_installed', 'active', 1)) {\n foreach ($plugins as &$plugin) {\n if (!in_array($plugin->name, $artefactplugins)) {\n continue;\n }\n safe_require('artefact', $plugin->name);\n $plugin_menu = call_static_method(generate_class_name('artefact',$plugin->name), 'group_tabs', $group->id);\n $menu = array_merge($menu, $plugin_menu);\n }\n }\n }\n\n if (defined('MENUITEM')) {\n $key = substr(MENUITEM, strlen('groups/'));\n if ($key && isset($menu[$key])) {\n $menu[$key]['selected'] = true;\n }\n }\n\n return $menu;\n}", "function __construct()\n {\n\t $this->tabs = array( \n//\t array ( 'tab_id' => 'properties',\t\t'tab_op' => 'administration.customization_properties.edit', \t'tab_name' => 'Application properties'),\n\t array ( 'tab_id' => 'fields',\t\t\t'tab_op' => 'administration.customization_fields.edit', \t\t'tab_name' => 'Field properties'),\n\t array ( 'tab_id' => 'searches', \t\t'tab_op' => 'administration.customization_searches.edit',\t\t'tab_name' => 'Search filters'),\n\t array ( 'tab_id' => 'results', \t\t\t'tab_op' => 'administration.customization_results.edit',\t\t'tab_name' => 'Search results'),\n\t array ( 'tab_id' => 'bulk',\t\t\t\t'tab_op' => 'administration.customization_bulk.edit', \t\t\t'tab_name' => 'Bulk form'),\t \n\t array ( 'tab_id' => 'view', \t\t\t'tab_op' => 'administration.customization_view.edit',\t\t\t'tab_name' => 'View form'),\n\t array ( 'tab_id' => 'edit', \t\t\t'tab_op' => 'administration.customization_edit.edit',\t\t\t'tab_name' => 'Edit form'),\n\t array ( 'tab_id' => 'linked', \t\t\t'tab_op' => 'administration.customization_linked.edit',\t\t\t'tab_name' => 'Linked applications'),\n\t array ( 'tab_id' => 'linked_view', \t\t'tab_op' => 'administration.customization_linked_view.edit',\t'tab_name' => 'Linked view form'),\n\t array ( 'tab_id' => 'popup_searches', \t'tab_op' => 'administration.customization_popup_searches.edit',\t'tab_name' => 'Popup search filters'),\n\t array ( 'tab_id' => 'popup_results', \t'tab_op' => 'administration.customization_popup_results.edit',\t'tab_name' => 'Popup search results'),\n\t array ( 'tab_id' => 'popup_view', \t\t'tab_op' => 'administration.customization_popup_view.edit',\t\t'tab_name' => 'Popup view form'),\n\t array ( 'tab_id' => 'popup_edit', \t\t'tab_op' => 'administration.customization_popup_edit.edit',\t\t'tab_name' => 'Popup edit form')\n\t ); \n\n\t\tparent::__construct();\n }", "abstract public function bootEndTabSet();", "function woocommerce_product_write_panel_tabs(){\n ?>\n <li class=\"custom_tab\">\n <a href=\"#custom_tab_data_ctabs\">\n <?php _e('Custom Tabs', 'GWP'); ?>\n </a>\n </li>\n <?php\n }", "function TablaVentasGeneral()\n {\t\n\t //Logo\n $this->Image(\"./assets/img/logo.png\" , 35 ,12, 80 , 25 , \"PNG\"); \n //Arial bold 15\n $this->SetFont('Courier','B',18);\n //Movernos a la derecha\n $this->Cell(130);\n //Título\n $this->Cell(180,25,'LISTADO GENERAL DE VENTAS',0,0,'C');\n //Salto de línea\n $this->Ln(30);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'CÉDULA GERENTE :',0,0,'');\n\t$this->CellFitSpace(95,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->CellFitSpace(42,5,'NOMBRE GERENTE :',0,0,'');\n\t$this->CellFitSpace(120,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'TELÉFONO GERENTE :',0,0,'');\n $this->CellFitSpace(95,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->CellFitSpace(42,5,'CORREO GERENTE :',0,0,'');\n $this->CellFitSpace(120,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(10,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'CÓDIGO VENTA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'CAJA',1,0,'C', True);\n\t$this->CellFitSpace(60,8,'CLIENTES',1,0,'C', True);\n\t$this->CellFitSpace(17,8,'STATUS',1,0,'C', True);\n\t$this->CellFitSpace(35,8,'FECHA VENTA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'ARTIC',1,0,'C', True);\n\t$this->CellFitSpace(28,8,'SUBTOT CON IVA',1,0,'C', True);\n\t$this->CellFitSpace(28,8,'SUBTOT IVA 0%',1,0,'C', True);\n\t$this->CellFitSpace(12,8,'IVA',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'TOTAL IVA',1,0,'C', True);\n\t$this->CellFitSpace(12,8,'DESC',1,0,'C', True);\n\t$this->CellFitSpace(20,8,'TOT DESC',1,0,'C', True);\n\t$this->CellFitSpace(27,8,'TOTAL PAGO',1,1,'C', True);\n\t\n $tra = new Login();\n $reg = $tra->ListarVentas();\n\t$totalarticulos=0;\n\t$Subtotalconiva=0;\n\t$Subtotalsiniva=0;\n\t$Totaliva=0;\n\t$Totaldescuento=0;\n\t$pagoDescuento=0;\n\t$Pagototal=0;\n\t$a=1;\n\t\n for($i=0;$i<sizeof($reg);$i++){\n\t\n $totalarticulos+=$reg[$i]['articulos'];\n $Subtotalconiva+=$reg[$i]['subtotalivasive'];\n $Subtotalsiniva+=$reg[$i]['subtotalivanove'];\n\t$Totaliva+=$reg[$i]['totalivave']; \n\t$Totaldescuento+=$reg[$i]['totaldescuentove']; \n\t$Pagototal+=$reg[$i]['totalpago']; \n\t\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(10,5,$a++,1,0,'C');\n\t$this->CellFitSpace(32,5,$reg[$i][\"codventa\"],1,0,'C');\n\t$this->CellFitSpace(15,5,utf8_decode($reg[$i][\"nrocaja\"]),1,0,'C');\n\t$this->CellFitSpace(60,5,utf8_decode($reg[$i][\"nomcliente\"]),1,0,'C');\n\t\n\tif($reg[$i]['fechavencecredito']== '0000-00-00') { \n\t$this->CellFitSpace(17, 5,utf8_decode($reg[$i]['statusventa']),1,0,'C');\n\t} elseif($reg[$i]['fechavencecredito'] >= date(\"Y-m-d\")) { \n\t$this->CellFitSpace(17, 5,utf8_decode($reg[$i]['statusventa']),1,0,'C');\n\t} elseif($reg[$i]['fechavencecredito'] < date(\"Y-m-d\")) { \n\t$this->CellFitSpace(17, 5,utf8_decode(\"VENCIDA\"),1,0,'C');\n\t}\n\t$this->CellFitSpace(35,5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($reg[$i]['fechaventa']))),1,0,'C');\n\t$this->CellFitSpace(15,5,utf8_decode($reg[$i][\"articulos\"]),1,0,'C');\n\t$this->CellFitSpace(28,5,utf8_decode(number_format($reg[$i]['subtotalivasive'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(28,5,utf8_decode(number_format($reg[$i]['subtotalivanove'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(12,5,utf8_decode(number_format($reg[$i]['ivave'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totalivave'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(12,5,utf8_decode(number_format($reg[$i]['descuentove'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(20,5,utf8_decode(number_format($reg[$i]['totaldescuentove'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(27,5,utf8_decode(number_format($reg[$i]['totalpago'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(10,5,'',0,0,'C');\n $this->Cell(32,5,'',0,0,'C');\t\t\n $this->Cell(15,5,'',0,0,'C');\n $this->Cell(60,5,'',0,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(52,5,'TOTAL GENERAL',1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n\t$this->Cell(15,5,utf8_decode($totalarticulos),1,0,'C');\n $this->Cell(28,5,utf8_decode(number_format($Subtotalconiva, 2, '.', ',')),1,0,'C');\n $this->Cell(28,5,utf8_decode(number_format($Subtotalsiniva, 2, '.', ',')),1,0,'C');\n $this->Cell(12,5,\"\",1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($Totaliva, 2, '.', ',')),1,0,'C');\n $this->Cell(12,5,\"\",1,0,'C');\n $this->Cell(20,5,utf8_decode(number_format($Totaldescuento, 2, '.', ',')),1,0,'C');\n $this->Cell(27,5,utf8_decode(number_format($Pagototal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n \n $this->Ln(12); \n $this->SetFont('courier','B',9);\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]),0,0,'');\n $this->Cell(80,6,'RECIBIDO:__________________________________',0,0,'');\n $this->Ln();\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'FECHA/HORA ELABORACIÓN: '.date('d-m-Y h:i:s A'),0,0,'');\n $this->Cell(80,6,'',0,0,'');\n $this->Ln(4);\n\t\n }", "function support($tab = 0) {\n $this->auth(SUPPORT_ADM_LEVEL);\n $data['title'] = 'support';\n $data['tab'] = $tab;\n $this->load->view('include/v_header', $data);\n $this->load->view('admin/support/v_main');\n $this->load->view('include/v_footer');\n }", "function cl_tabrecregrasjm() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tabrecregrasjm\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function hankart_add_manual_tab( $tabs ) {\n\t$tabs['pdf_manual'] = array(\n\t\t'title' \t=> __( 'Manual', 'storefront' ),\n\t\t'priority' \t=> 50,\n\t\t'callback' \t=> 'hankart_add_manual_tab_content'\n\t);\n\treturn $tabs;\n}", "function draw_y ($image, $black, $grey, $light_grey, $tab) // affiche les infos de l'axe des ordonnees\n\t{\n\t\tImageTTFText ($image, 10, 0, 3, 20, $grey, $this->path, $this->yname);\n\n\t\t//l'origine\n\t\tImageTTFText ($image, 10, 0, 0, $this->y(0) + 3, $black, $this->path, 0);\n\n\t\t$nb_draw = floor($this->ref_height / 30);\n\t\t$i = $this->max_y / $nb_draw;\n\t\t$stop = $nb_draw * $i;\n\n\t\t// affiche les reperes en fonction de la hauteur de l'axe\n\t\t$compt = 0;\n\t\twhile($i <= $stop)\n\t\t{\n\t\t\t$compt++;\nimageline($image, $this->x(0) - 5, $this->y($i), $this->x(0), $this->y($i), $black);\nimageline($image, $this->x(0) + 1, $this->y($i), $this->pic_width - 30, $this->y($i), $light_grey);\nImageTTFText ($image, 10, 0, 0, $this->y($i) + 3, $black, $this->path, $i);\n\t\t\t$i += $this->max_y / $nb_draw;\n\t\t\t\n\t\t}\n\t\tif ($compt == 1)\n\t\t{\n\t\t\t$i -= $this->max_y / $nb_draw;\nimageline($image, $this->x(0) - 5, $this->y($i/2), $this->x(0), $this->y($i/2), $black);\nimageline($image, $this->x(0) + 1, $this->y($i/2), $this->pic_width - 30, $this->y($i/2), $light_grey);\nImageTTFText ($image, 10, 0, 0, $this->y($i/2) + 3, $black, $this->path, $i/2);\n\t\t}\n\t}", "public function plot($pid,$namespace='') {\n $this->setTempFile();\n\n // Config\n $fontName = ($this->controller->configurations->get('graphvizFontName'))? 'fontname=\"'.$this->controller->configurations->get('graphvizFontName').'\"' : '';\n $fontSize = ($this->controller->configurations->get('graphvizFontSize'))? 'fontsize=\"'.$this->controller->configurations->get('graphvizFontSize').'\"' : '';\n \n\n $this->appendToFile('digraph siwiki_relations {');\n $this->appendToFile('graph [label=\"siwiki relations\\ngenerated '.date('r').'\" '.$fontName.' '.$fontSize.' ];');\n $this->appendToFile('node [ '.$fontName.' '.$fontSize.' ];');\n\n // Admin mode... display the whole wiki... this can be huge!\n if(empty($namespace)) {\n $this->getNamespaces($pid);\n\n foreach($this->namespaces as $namespace) {\n $this->appendToFile('subgraph cluster'.$namespace['uid'].' { '.chr(10).'label = '.$this->quote($namespace['name']).';');\n $this->getAllArticles($pid,$namespace['uid']);\n $this->getAllFutureArticles($pid,$namespace['uid']);\n\n $this->appendToFile('} // end cluster'.$namespace['uid']);\n\n $this->getAllReferencesToArticles($pid);\n $this->getAllReferencesToFutureArticles($pid);\n\n }\n\n }\n\n // Standard Display Mode in panel... display only namespace informations!\n else {\n $this->getNamespace($namespace);\n $this->appendToFile('subgraph cluster'.$this->namespace['uid'].' { '.chr(10).'label = '.$this->quote($this->namespace['name']).';');\n $this->getAllArticles($pid,$this->namespace['uid']);\n $this->getAllFutureArticles($pid,$this->namespace['uid']);\n\n $this->appendToFile('} // end cluster'.$this->namespace['uid']);\n\n $this->getAllReferencesToArticlesInThisNamespace($pid,$this->namespace['uid']);\n $this->getAllReferencesToFutureArticlesInThisNamespace($pid,$this->namespace['uid']);\n }\n\n\n $this->appendToFile('} // end digraph ');\n\n $this->plotWithGraphviz();\n\n $entry = new tx_lib_object(array('plotRelations' => $this->png));\n $this->append($entry);\n\n // Delete the temporary file\n unlink($this->filename);\n\n }", "private function metabox_style_tabs() {\n $help_sidebar = $this->get_sidebar();\n\n $help_class = '';\n if ( ! $help_sidebar ) :\n $help_class .= ' no-sidebar';\n endif;\n\n // Time to render!\n ?>\n\n <div class=\"tabbed\">\n <div class=\"tabbed-sections\">\n <ul class=\"tr-tabs alignleft\">\n <?php\n $class = ' class=\"active\"';\n $tabs = $this->get_tabs();\n foreach ( $tabs as $tab ) :\n $link_id = \"tab-link-{$tab['id']}\";\n $panel_id = (!empty($tab['url'])) ? $tab['url'] : \"#tab-panel-{$tab['id']}\";\n ?>\n <li id=\"<?php echo esc_attr( $link_id ); ?>\"<?php echo $class; ?>>\n <a href=\"<?php echo esc_url( \"$panel_id\" ); ?>\">\n <?php echo esc_html( $tab['title'] ); ?>\n </a>\n </li>\n <?php\n $class = '';\n endforeach;\n ?>\n </ul>\n </div>\n\n <?php if ( $help_sidebar ) : ?>\n <div class=\"tabbed-sidebar\">\n <?php echo $help_sidebar; ?>\n </div>\n <?php endif; ?>\n\n <div class=\"tr-sections clearfix\">\n <?php\n $classes = 'tab-section active';\n foreach ( $tabs as $tab ):\n $panel_id = \"tab-panel-{$tab['id']}\";\n ?>\n\n <div id=\"<?php echo esc_attr( $panel_id ); ?>\" class=\"<?php echo $classes; ?>\">\n <?php\n // Print tab content.\n echo $tab['content'];\n\n // If it exists, fire tab callback.\n if ( ! empty( $tab['callback'] ) )\n call_user_func_array( $tab['callback'], array( $this, $tab ) );\n ?>\n </div>\n <?php\n $classes = 'tab-section';\n endforeach;\n ?>\n </div>\n </div>\n <?php\n }", "public function bp_account_tab_action() {\n\t\techo $this->get_instance( \\MyVideoRoomExtrasParking\\Library\\SectionTemplates::class )->account_control_centre_alternate_dashboard();\n\t}", "protected function createTabs() {}", "function webplayer_admin_tabs($current = 'webplayer') {\r\n\t$tabs = array('webplayer' => 'HD Webplayer', 'videos' => 'Videos', 'playlist' => 'Playlist', 'license' => 'License', 'documentation' => 'Documentation');\r\n\t$links = array();\r\n\t\r\n\tforeach( $tabs as $tab => $name ) {\r\n\t\tif( $tab == $current) {\r\n\t\t\t$links[] = \"<a class='nav-tab nav-tab-active' href='?page=$tab'>$name</a>\";\r\n\t\t} else {\r\n\t\t\t$links[] = \"<a class='nav-tab' href='?page=$tab'>$name</a>\";\r\n\t\t}\r\n\t}\r\n\t\r\n\techo '<div id=\"icon-upload\" class=\"icon32\"></div>';\r\n\techo \"<h2 class='nav-tab-wrapper'>\";\r\n\tforeach( $links as $link ) {\r\n\t\techo $link;\r\n\t}\r\n\techo \"</h2>\";\r\n\t\r\n}", "function setTabs($a_tab = \"levels\")\n\t{\n\t\tglobal $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;\n\n\t\t$ilTabs->clearTargets();\n\t\t$ilHelp->setScreenIdComponent(\"skmg_skll\");\n//\t\t$ilTabs->setBackTarget($lng->txt(\"skmg_skill_hierarchie\"),\n//\t\t\t$ilCtrl->getLinkTargetByClass(\"ilobjskillmanagementgui\", \"editSkills\"));\n\n\t\tif (is_object($this->node_object))\n\t\t{\n\n\t\t\t// levels\n\t\t\t$ilTabs->addTab(\"levels\", $lng->txt(\"skmg_skill_levels\"),\n\t\t\t\t$ilCtrl->getLinkTarget($this, 'edit'));\n\t\n\t\t\t// properties\n\t\t\t$ilTabs->addTab(\"properties\", $lng->txt(\"settings\"),\n\t\t\t\t$ilCtrl->getLinkTarget($this, 'editProperties'));\n\n\t\t\t// usage\n\t\t\t$this->addUsageTab($ilTabs);\n\n\t\t\t$ilCtrl->setParameterByClass(\"ilskillrootgui\", \"obj_id\",\n\t\t\t\t$this->node_object->skill_tree->getRootId());\n\t\t\t$ilTabs->setBackTarget($lng->txt(\"obj_skmg\"),\n\t\t\t\t$ilCtrl->getLinkTargetByClass(\"ilskillrootgui\", \"listSkills\"));\n\t\t\t$ilCtrl->setParameterByClass(\"ilskillrootgui\", \"obj_id\",\n\t\t\t\t$_GET[\"obj_id\"]);\n\t\t\t\n\t\t\t$ilTabs->activateTab($a_tab);\n\n\t\t\t$tpl->setTitle($lng->txt(\"skmg_skill\").\": \".\n\t\t\t\t$this->node_object->getTitle());\n\t\t\n\t\t\t$this->setSkillNodeDescription();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tpl->setTitle($lng->txt(\"skmg_skill\"));\n\t\t\t$tpl->setDescription(\"\");\n\t\t}\n\t\tparent::setTitleIcon();\n\t}", "public function setup_help_tab()\n {\n }", "public function get_help_tabs()\n {\n }", "public function get_help_tab($id)\n {\n }", "function vertical_tab_index($page_id)\n {\n $data['website_folder_name'] = $this->admin_header->website_folder_name();\n $data['httpUrl'] = $this->admin_header->host_url();\n $data['ImageUrl'] = $this->admin_header->image_url();\n \n $data['website_id'] = $this->admin_header->website_id();\n // Get Tab details from settings\n $data['vertical_tab_title_data'] = $this->Vertical_tab_model->get_vertical_tab_setting_details($data['website_id'], $page_id, 'vertical_tab');\n \n // Tab title details from settings\n if (!empty($data['vertical_tab_title_data'])) {\n $keys = json_decode($data['vertical_tab_title_data'][0]->key);\n $values = json_decode($data['vertical_tab_title_data'][0]->value);\n $i = 0;\n foreach ($keys as $key) {\n $data[$key] = $values[$i];\n $i++;\n }\n } else {\n $data['tab_title'] = '';\n $data['title_color'] = '';\n $data['title_position'] = '';\n \n $data['component_background'] = '';\n $data['vertical_tab_background'] = '';\n $data['status'] = '';\n }\n \n $data['page_id'] = $page_id;\n $data['table'] = $this->get_table($page_id);\n $data['heading'] = 'Vertical Tab';\n $data['title'] = \"Vertical Tab | Administrator\";\n $this->load->view('template/meta_head', $data);\n $this->load->view('vertical_tab_header');\n $this->admin_header->index();\n $this->load->view('view', $data);\n $this->load->view('template/footer_content');\n $this->load->view('script');\n $this->load->view('template/footer');\n }", "function ipal_display_instructor_interface($cmid){\r\nglobal $DB;\r\n\tglobal $ipal;\r\n\r\n if(isset($_POST['clearQuestion'])){\r\n ipal_clear_question();\r\n }\r\n if(isset($_POST['question'])){\r\n ipal_send_question();\r\n }\r\n\r\n\t$state=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\tif($_POST['ipal_view']==\"changeState\"){\r\n if($state->preferredbehaviour == \"Graph\"){\r\n $result=$DB->set_field('ipal', 'preferredbehaviour', 'Grid',array('id'=>$ipal->id));\r\n\t\t\t $newstate = 'Histogram';\r\n }else{\r\n $result=$DB->set_field('ipal', 'preferredbehaviour','Graph',array('id'=>$ipal->id));\r\n\t\t\t $newstate = 'Spreadsheet';\r\n }\r\n\t}\r\n\telse\r\n\t{\r\n if($state->preferredbehaviour == \"Graph\"){$newstate = 'Spreadsheet';}\r\n\t\t else{$newstate = 'Histogram';}\r\n\t}\r\n if(($newstate == 'Histogram') and (ipal_get_qtype(ipal_show_current_question_id()) == 'essay')){\r\n\t $newstate = 'Responses';\r\n\t}\r\n\r\n ipal_java_graphupdate();\r\n\r\necho \"<table><tr><td>\".instructor_buttons().\"</td><td>\".ipal_show_compadre($cmid).\"</td><td>\".ipal_toggle_view($newstate).\"<td></tr></table>\";\r\necho ipal_make_instructor_form();\r\necho \"<br><br>\";\r\n$state=$DB->get_record('ipal',array('id'=>$ipal->id));\r\nif($state->preferredbehaviour ==\"Graph\"){\r\n\tif(ipal_show_current_question()==1){\r\necho \"<br>\";\r\necho \"<br>\";\r\necho \"<iframe id= \\\"graphIframe\\\" src=\\\"graphics.php?ipalid=\".$ipal->id.\"\\\" height=\\\"535\\\" width=\\\"723\\\"></iframe>\";\r\necho \"<br><br><a onclick=\\\"window.open('popupgraph.php?ipalid=\".$ipal->id.\"', '',\r\n 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes');\r\n return false;\\\"\r\n href=\\\"popupgraph.php?ipalid=\".$ipal->id.\"\\\" target=\\\"_blank\\\">Open a new window for the graph.</a>\";}\r\n}else{\r\necho \"<br>\";\r\necho \"<br>\";\r\necho \"<iframe id= \\\"graphIframe\\\" src=\\\"gridview.php?id=\".$ipal->id.\"\\\" height=\\\"535\\\" width=\\\"723\\\"></iframe>\";\r\n//echo \"<br><br><a href=\\\"gridview.php?refresh=true&id=\".$ipal->id.\"\\\" target=\\\"_blank\\\">Open a new window for the graph.</a>\";\r\necho \"<br><br><a onclick=\\\"window.open('popupgraph.php?id=\".$ipal->id.\"', '',\r\n 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes');\r\n return false;\\\"\r\n href=\\\"popupgraph.php?ipalid=\".$ipal->id.\"\\\" target=\\\"_blank\\\">Open a new window for the graph.</a>\";\r\n\r\n//ipal_grid_view();\t\r\n}}", "function AfficherEDT($tab_data, $entetes, $creneaux, $type_edt, $login_edt, $period) \r\n{\r\n\tglobal $icone_deposer_alerte;\r\n\t$peut_poster_message=peut_poster_message($_SESSION['statut']);\r\n echo (\"<div class=\\\"fenetre\\\">\\n\");\r\n\r\n echo(\"<div class=\\\"contenu\\\">\r\n\r\n\t\t<div class=\\\"coingh\\\"></div>\r\n <div class=\\\"coindh\\\"></div>\r\n <div class=\\\"partiecentralehaut\\\"></div>\r\n <div class=\\\"droite\\\"></div>\r\n <div class=\\\"gauche\\\"></div>\r\n\t\t<div class=\\\"coingb\\\"></div>\r\n\t\t<div class=\\\"coindb\\\"></div>\r\n\t\t<div class=\\\"partiecentralebas\\\"></div>\r\n\r\n <div class=\\\"tableau\\\">\\n\");\r\n\r\n\r\n// ===== affichage des colonnes\r\n// ===== Les \"display:none\" sont utilisés pour l'accessibilité\r\n $jour = 0;\r\n $isIconeAddUsable = true;\r\n while (isset($entetes['entete'][$jour])) {\r\n\r\n echo(\"<div class=\\\"colonne\".$creneaux['nb_creneaux'].\"\\\">\\n\");\r\n $jour_sem = $entetes['entete'][$jour];\r\n echo(\"<h2 class=\\\"entete\\\"><div class=\\\"cadre\\\"><strong>\".$jour_sem.\"</strong></div></h2>\\n\");\r\n $index_box = 0;\r\n while (isset($tab_data[$jour]['type'][$index_box]))\r\n {\r\n if ($tab_data[$jour]['type'][$index_box] == \"vide\") {\r\n \r\n echo(\"<div class=\\\"\".$tab_data[$jour]['duree'][$index_box].\"\\\">\");\r\n echo(\"<div style=\\\"display:none;\\\">\".$tab_data[$jour]['affiche_creneau'][$index_box].\" - durée = \".$tab_data[$jour]['duree_valeur'][$index_box].\" heure(s)</div>\\n\");\r\n echo (\"<div class=\\\"\".$tab_data[$jour]['couleur'][$index_box].\"\\\">\\n\");\r\n echo (\"<div class=\\\"ButtonBar\\\">\");\r\n AfficheIconePlusNew($type_edt,$tab_data[$jour]['heuredeb_dec'][$index_box],$login_edt,$jour_sem,$tab_data[$jour]['id_creneau'][$index_box], $period);\r\n echo (\"</div>\\n\");\r\n echo (\"</div></div>\\n\"); \r\n \r\n }\r\n else if ($tab_data[$jour]['type'][$index_box] == \"erreur\")\r\n {\r\n \r\n echo(\"<div class=\\\"\".$tab_data[$jour]['duree'][$index_box].\"\\\">\");\r\n echo(\"<div style=\\\"display:none;\\\">\".$tab_data[$jour]['affiche_creneau'][$index_box].\" - durée = \".$tab_data[$jour]['duree_valeur'][$index_box].\" heure(s)</div>\\n\");\r\n echo(\"<div class=\\\"cadreRouge\\\">\\n\");\r\n echo $tab_data[$jour]['contenu'][$index_box];\r\n echo (\"<div class=\\\"ButtonBar\\\">\");\r\n echo (\"</div>\\n\");\r\n echo (\"</div></div>\\n\"); \r\n \r\n }\r\n else if ($tab_data[$jour]['type'][$index_box] == \"conteneur\")\r\n {\r\n echo(\"<div class=\\\"\".$tab_data[$jour]['duree'][$index_box].\"\\\">\\n\");\r\n $isIconeAddUsable = false;\r\n \r\n }\r\n else if ($tab_data[$jour]['type'][$index_box] == \"cours\")\r\n {\r\n echo(\"<div class=\\\"\".$tab_data[$jour]['duree'][$index_box].\"\\\">\");\r\n echo(\"<div style=\\\"display:none;\\\">\".$tab_data[$jour]['affiche_creneau'][$index_box].\" - durée = \".$tab_data[$jour]['duree_valeur'][$index_box].\" heure(s)</div>\\n\");\r\n echo (\"<div class=\\\"\".$tab_data[$jour]['couleur'][$index_box].\"\\\">\");\r\n echo $tab_data[$jour]['contenu'][$index_box];\r\n echo (\"<div class=\\\"ButtonBar\\\">\");\r\n AfficheEffacerIcone($type_edt,$login_edt,$tab_data[$jour]['id_cours'][$index_box], $period);\r\n AfficheModifierIcone($type_edt,$login_edt,$tab_data[$jour]['id_cours'][$index_box], $period);\r\n if ($isIconeAddUsable)\r\n {\r\n AfficheIconePlusAdd($type_edt,0,$login_edt,$jour_sem,$tab_data[$jour]['id_creneau'][$index_box], $period);\r\n }\r\n\r\n\t\t\t\tif($peut_poster_message) {\r\n\t\t\t\t\tif((isset($_GET['appel_depuis_form_message']))&&($_GET['appel_depuis_form_message']==\"y\")) {\r\n\t\t\t\t\t\t$tmp_jour_suivant=get_next_tel_jour($jour+1);\r\n\t\t\t\t\t\tif(($tmp_jour_suivant!=\"\")&&(is_numeric($tmp_jour_suivant))) {\r\n\t\t\t\t\t\t\t$tmp_chaine_date=strftime(\"%d/%m/%Y\", time()+24*3600*$tmp_jour_suivant);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$tmp_chaine_date=strftime(\"%d/%m/%Y\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$chaine_heure_visibilite=\"\";\r\n\t\t\t\t\t\tif((isset($tab_data[$jour]['heuredebut'][$index_box]))&&($tab_data[$jour]['heuredebut'][$index_box]!='')) {\r\n\t\t\t\t\t\t\t$chaine_heure_visibilite=\"document.getElementById('heure_visibilite').value='\".$tab_data[$jour]['heuredebut'][$index_box].\"';\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\techo \"<div style='float:right;width:10px'><a href='#' onclick=\\\"document.getElementById('date_visibilite').value='$tmp_chaine_date';\".$chaine_heure_visibilite.\"return false;\\\" target='_blank' title=\\\"Fixer la date et l'heure du message\\ndans le module Alertes/Informations de Gepi\\\"><img src='../images/icons/sound.png' width='10' height='10' /></a></div>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif(isset($tab_data[$jour]['login_prof'][$index_box])) {\r\n\t\t\t\t\t\t// Récupérer le jour suivant\r\n\t\t\t\t\t\techo \"<div style='float:right;width:10px'><a href='../mod_alerte/form_message.php?message_envoye=y&amp;login_dest=\".$tab_data[$jour]['login_prof'][$index_box];\r\n\t\t\t\t\t\t$tmp_jour_suivant=get_next_tel_jour($jour+1);\r\n\t\t\t\t\t\tif(($tmp_jour_suivant!=\"\")&&(is_numeric($tmp_jour_suivant))) {\r\n\t\t\t\t\t\t\techo \"&date_visibilite=\".strftime(\"%d/%m/%Y\", time()+24*3600*$tmp_jour_suivant);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\techo \"&date_visibilite=\".strftime(\"%d/%m/%Y\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif((isset($tab_data[$jour]['heuredebut'][$index_box]))&&($tab_data[$jour]['heuredebut'][$index_box]!='')) {\r\n\t\t\t\t\t\t\techo \"&amp;heure_visibilite=\".$tab_data[$jour]['heuredebut'][$index_box];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\techo add_token_in_url().\"' target='_blank' title=\\\"Déposer pour ce professeur un message\\ndans le module Alertes/Informations de Gepi\\\"><img src='../images/icons/$icone_deposer_alerte' width='10' height='10' /></a></div>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n echo (\"</div>\\n\");\r\n echo (\"</div></div>\\n\"); \r\n \r\n }\r\n else if ($tab_data[$jour]['type'][$index_box] == \"fin_conteneur\")\r\n {\r\n echo(\"</div>\\n\");\r\n $isIconeAddUsable = true;\r\n }\r\n else \r\n {\r\n // ========= type de box non implémentée\r\n \r\n }\r\n\r\n $index_box++;\r\n }\r\n\r\n echo(\"</div>\\n\");\r\n\t\t/*\r\n\t\techo \"<hr /><pre>\";\r\n\t\tprint_r($tab_data[$jour]);\r\n\t\techo \"<pre>\";\r\n\t\t*/\r\n $jour++;\r\n }\r\n\r\n// ===== affichage de la colonne créneaux\r\n\r\n echo (\"<div class=\\\"creneaux\".$creneaux['nb_creneaux'].\"\\\">\\n\");\r\n echo (\"<div class=\\\"entete_creneaux\\\"></div>\\n\");\r\n for ($i = 0; $i < $creneaux['nb_creneaux']; $i++)\r\n {\r\n/*\r\n if(in_array($creneaux['creneaux'][$i], array('R0', 'R1', 'R2'))) {\r\n echo(\"<div class=\\\"demihoraires\\\"><div class=\\\"cadre\\\"><strong>\".$creneaux['creneaux'][$i].\"</strong></div></div>\\n\");\r\n }\r\n else {\r\n*/\r\n echo(\"<div class=\\\"horaires\\\"><div class=\\\"cadre\\\"><strong>\".$creneaux['creneaux'][$i].\"</strong></div></div>\\n\");\r\n// }\r\n }\r\n\r\n echo(\"</div></div><div class=\\\"spacer\\\"></div></div></div>\");\r\n\r\n/*\r\n//20141007\r\necho \"Tableau des créneaux<pre>\";\r\nprint_r($creneaux);\r\necho \"</pre>\";\r\n*/\r\n}", "function qode_lms_single_course_tabs( $tabs = array() ) {\n\t\tglobal $post;\n\t\t\n\t\t$course_sections = get_post_meta( get_the_ID(), 'qode_course_curriculum', true );\n\t\t$member_list = get_post_meta( get_the_ID(), 'qode_course_members_meta', true );\n\t\t$forum_id = get_post_meta( get_the_ID(), 'qode_course_forum_meta', true );\n\t\t\n\t\t$show_content = $post->post_content ? true : false;\n\t\tif( qode_lms_is_elementor_installed() ){\n if ( \\Elementor\\Plugin::$instance->preview->is_preview_mode() ) {\n $show_content = true;\n }\n }\n\t\t$show_curriculum = ! empty( $course_sections );\n\t\t$show_reviews = qode_lms_show_reviews();\n\t\t$show_members = ! empty( $member_list );\n\t\t$show_forum = ! empty( $forum_id );\n\t\t\n\t\tif ( ! empty( $forum_id ) ) {\n\t\t\t$forum_link = get_permalink( $forum_id );\n\t\t}\n\t\t\n\t\t// Description tab - shows course content\n\t\tif ( $show_content ) {\n\t\t\t$tabs['description'] = array(\n\t\t\t\t'title' => __( 'Description', 'qode-lms' ),\n\t\t\t\t'priority' => 10,\n\t\t\t\t'template' => 'content'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Curriculum tab - shows course curriculum\n\t\tif ( $show_curriculum ) {\n\t\t\t$tabs['curriculum'] = array(\n\t\t\t\t'title' => __( 'Curriculum', 'qode-lms' ),\n\t\t\t\t'priority' => 20,\n\t\t\t\t'template' => 'curriculum'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Reviews tab - shows reviews\n\t\tif ( $show_reviews ) {\n\t\t\t$tabs['reviews'] = array(\n\t\t\t\t'title' => __( 'Reviews', 'qode-lms' ),\n\t\t\t\t'priority' => 30,\n\t\t\t\t'template' => 'reviews-list'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Member tab - shows members\n\t\tif ( $show_members ) {\n\t\t\t$tabs['members'] = array(\n\t\t\t\t'title' => __( 'Members', 'qode-lms' ),\n\t\t\t\t'priority' => 40,\n\t\t\t\t'template' => 'members'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Forum tab - shows forum\n\t\tif ( $show_forum ) {\n\t\t\t$tabs['forum'] = array(\n\t\t\t\t'title' => __( 'Forum', 'qode-lms' ),\n\t\t\t\t'priority' => 40,\n\t\t\t\t'template' => 'forum',\n\t\t\t\t'link' => $forum_link\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $tabs;\n\t}", "public function draw();", "function render_tab($key,$tab){\n global $post;\n echo '<h2>'.apply_filters('GWP_custom_tab_title',$tab['title'],$tab,$key).'</h2>';\n echo apply_filters('GWP_custom_tab_content',$tab['content'],$tab,$key);\n }", "function turnitintooltwo_init_browser_assignment_table($tiicourseid) {\n global $OUTPUT, $DB;\n\n $table = new html_table();\n $table->id = \"assignmentBrowserTable\";\n $output = \"\";\n $courseid = 0;\n $coursetitle = '';\n\n $turnitincourse = $DB->get_records_sql(\"\n SELECT tc.turnitin_cid, tc.course_type, tc.courseid\n FROM {turnitintooltwo_courses} tc\n RIGHT JOIN {course} c ON c.id = tc.courseid\n WHERE tc.turnitin_cid = ? \", array($tiicourseid)\n );\n\n if (!empty($turnitincourse)) {\n $course = current($turnitincourse);\n $coursedetails = turnitintooltwo_assignment::get_course_data($course->courseid, $course->course_type);\n $courseid = $course->courseid;\n $coursetitle = $coursedetails->fullname;\n }\n\n $class = (empty($coursetitle)) ? ' hidden_class' : '';\n $coursetitle = html_writer::tag('span', $coursetitle, array('id' => 'existing_course_title_span'));\n $output .= html_writer::tag(\"h3\", get_string('courseexistsmoodle', 'turnitintooltwo').$coursetitle,\n array('class' => 'existing_course_title_h3'.$class));\n\n // Do the table headers.\n $cells = array();\n $cells[0] = new html_table_cell('&nbsp;');\n $cells[1] = new html_table_cell(get_string('turnitintooltwoname', 'turnitintooltwo'));\n $cells[2] = new html_table_cell(get_string('maxmarks', 'turnitintooltwo'));\n $cells[3] = new html_table_cell(get_string('turnitinid', 'turnitintooltwo'));\n $table->head = $cells;\n\n $elements = array();\n $elements[] = array('html', get_string('coursebrowserassignmentdesc', 'turnitintooltwo'));\n $elements[] = array('html', html_writer::table($table));\n $elements[] = array('text', 'assignmentname', get_string('assignmenttitle', 'turnitintooltwo'));\n $elements[] = array('button', 'create_assignment', get_string('downloadassignment', 'turnitintooltwo'));\n $customdata = array();\n $customdata[\"elements\"] = $elements;\n $customdata[\"hide_submit\"] = true;\n $customdata[\"disable_form_change_checker\"] = true;\n\n $assignmentform = new turnitintooltwo_form('', $customdata);\n\n $output .= $OUTPUT->box($_SESSION[\"stored_tii_courses\"][$tiicourseid], '', 'tii_course_name');\n $output .= $OUTPUT->box($tiicourseid, '', 'tii_course_id');\n $output .= $OUTPUT->box($courseid, '', 'course_id');\n $output .= $assignmentform->display();\n\n return $output;\n}", "public function bpfit_member_profile_fitness_tab(){\n\t\t\tglobal $bp, $bpfitness;\n\t\t\t$profile_menu_label = $bpfitness->profile_menu_label;\n\t\t\t$profile_menu_slug = $bpfitness->profile_menu_slug;\n\t\t\t\n\t\t\t$displayed_uid = bp_displayed_user_id();\n\t\t\t$displayed_user_link = bp_core_get_userlink( $displayed_uid, false, true );\n\n\t\t\t$tab_args = array(\n\t\t\t\t'name' => __( $profile_menu_label, 'bp-fitness' ),\n\t\t\t\t'slug' => $profile_menu_slug,\n\t\t\t\t'screen_function' => 'bpfit_fitness_menu_function_to_show_screen',\n\t\t\t\t'position' => 75,\n\t\t\t\t'default_subnav_slug' => 'walk',\n\t\t\t\t'show_for_displayed_user' => true,\n\t\t\t);\n\t\t\tbp_core_new_nav_item( $tab_args );\n\n\t\t\t//Add subnav walk\n\t\t\tbp_core_new_subnav_item(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'Walk',\n\t\t\t\t\t'slug' => 'walk',\n\t\t\t\t\t'parent_url' => $bp->loggedin_user->domain . $profile_menu_slug.'/',\n\t\t\t\t\t'parent_slug' => $profile_menu_slug,\n\t\t\t\t\t'screen_function' => array($this, 'bpfit_walk_subtab_show_screen'),\n\t\t\t\t\t'position' => 100,\n\t\t\t\t\t'link' => $displayed_user_link.$profile_menu_slug.'/walk',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t//Add subnav weight\n\t\t\tbp_core_new_subnav_item(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'Weight',\n\t\t\t\t\t'slug' => 'weight',\n\t\t\t\t\t'parent_url' => $bp->loggedin_user->domain . $profile_menu_slug.'/',\n\t\t\t\t\t'parent_slug' => $profile_menu_slug,\n\t\t\t\t\t'screen_function' => array($this, 'bpfit_weight_subtab_show_screen'),\n\t\t\t\t\t'position' => 100,\n\t\t\t\t\t'link' => $displayed_user_link.$profile_menu_slug.'/weight',\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function alert_histogram_dashlet_func($mode=DASHLET_MODE_PREVIEW, $id=\"\", $args=null) {\n $output = \"\";\n $args['graphtype'] = 'line'; \n\n switch($mode) {\n case DASHLET_MODE_GETCONFIGHTML:\n break;\n case DASHLET_MODE_OUTBOARD:\n $output = alert_histogram_dashlet($args);\n break;\n case DASHLET_MODE_INBOARD:\n $output = alert_histogram_dashlet($args, 1);\n break;\n case DASHLET_MODE_PREVIEW:\n $output = \"<img src='\".visualizations_component_get_baseurl().\"images/alerthistogram.jpg' height='100' />\";\n break;\n }\n return $output;\n}", "function CrearDetalleIndicador()\n{\n\tglobal $tablaCapacitados;\n\n\n\t//global $tabla;\n\tglobal $eventosAsistentes;\n\t$anioCurso = getAnioSeleccionado();\n\t$indicadorSel = getIndicador();\n\t$mesSel = getMes();\n\t$zonaSel = getZona();\n\t$lineasTabla = \"\";\n\t$tablaHeader = \"\";\n\n\t//echo $anioCurso . \" - \" . $indicadorSel . \" - \" . $mesSel. \" - \" . $zonaSel . \"<br>\";\n\n\tif($indicadorSel == 1)\n\t{\n\t\t$resIndicador = primer_indicador($mesSel, $zonaSel);\n\t\t//print_r2($resIndicador);\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t//provincias de las organizaciones\n\t\t\t$provOrg = RecuperarInfoOrg($resIndicador, 'provincia');\n\t\t\t//nombres de las organizaciones\n\t\t\t$nombresOrganizaciones = RecuperarInfoOrg($resIndicador, 'nombresOrg');\n\t\t\t// ruc de las organizaciones\n\t\t\t$rucProvisional = RecuperarInfoOrg($resIndicador, 'rucProvisionalOrg');\n\t\t\t$rucDefinitivo = RecuperarInfoOrg($resIndicador, 'rucDefinitivoOrg');\n\t\t\t//categoria Matriz productiva de las organizaciones\n\t\t\t$catMatrizProductivaOrg = RecuperarInfoOrg($resIndicador, 'categoriaMatriz');\n\t\t\t// numero de socios por cada organizacion\n\t\t\t$numSociosOrganizacion = NumSociosOrganizacion($resIndicador);\n\t\t\t// numero de personas Capacitadas\n\t\t\t$numPerCapacitadas = NumPersonasCapacitadas($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t//print_r2($eventosAsistentes);\n\t\t\t//Servicio Brindado por Fortalecimiento\n\t\t\t$servicioFortalecimiento = ServiciosBrindadosOrg($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t// identificacion actividad matriz productiva\n\t\t\t$actOrgMP = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//capacitados por Genero\n\t\t\t$capMujeres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel, 'mujer');\n\t\t\t$capHombres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel, 'hombre');\n\n\t\t\t// BORRAR LUEGO SOLO PARA FORTALECIMIENTO\n\t\t\t$tablaCapacitados .= \"</table>\";\n\n\n\t\t\t//print_r2($resIndicador);\n\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES REPORTE</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE SOCIOS</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS TOTAL</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS MUJERES TOTAL</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS HOMBRES TOTAL</th>\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t\t<th>CODIGO EVENTO</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nombresOrganizaciones[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo[$cont] . \" - \" . $rucProvisional[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actOrgMP[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numSociosOrganizacion[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numPerCapacitadas[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capMujeres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capHombres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $servicioFortalecimiento[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $eventosAsistentes[$cont] . \"</td>\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\n\t\t\n\t}\n\tif($indicadorSel == 2)\n\t{\n\t\t//print_r2($resIndicador);\n\t\t$resIndicador = segundo_indicador($mesSel,$zonaSel);\n\t\t//print_r2($resIndicador);\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t//provincias de las uep\n\t\t\t$provUep = RecuperarInfoOrg($resIndicador, 'provincia');\n\t\t\t//nombres de las uep\n\t\t\t$nombresUep = RecuperarInfoOrg($resIndicador, 'nombresOrg');\n\t\t\t// ruc de las uep\n\t\t\t$rucProvisional = RecuperarInfoOrg($resIndicador, 'rucProvisionalOrg');\n\t\t\t$rucDefinitivo = RecuperarInfoOrg($resIndicador, 'rucDefinitivoOrg');\n\t\t\t//categoria Matriz productiva de las uep\n\t\t\t$catMatrizProductivaOrg = RecuperarInfoOrg($resIndicador, 'categoriaMatriz');\n\t\t\t// numero de socios por cada organizacion\n\t\t\t$numSociosOrganizacion = NumSociosOrganizacion($resIndicador);\n\t\t\t// numero de personas Capacitadas\n\t\t\t$numPerCapacitadas = NumPersonasCapacitadas($resIndicador, $anioCurso, $mesSel, 'UEP', $zonaSel);\n\t\t\t//print_r2($eventosAsistentes);\n\t\t\t//Servicio Brindado por Fortalecimiento\n\t\t\t$servicioFortalecimiento = ServiciosBrindadosOrg($resIndicador, $anioCurso, $mesSel, 'UEP', $zonaSel);\n\t\t\t// identificacion actividad matriz productiva\n\t\t\t$actOrgMP = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//capacitados por Genero\n\t\t\t$capMujeres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'UEP', $zonaSel, 'mujer');\n\t\t\t$capHombres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'UEP', $zonaSel, 'hombre');\n\n\n\t\t\t// BORRAR LUEGO SOLO PARA FORTALECIMIENTO\n\t\t\t$tablaCapacitados .= \"</table>\";\n\n\n\n\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t<th>MES REPORTE</th>\n\t\t\t\t\t\t\t<th>ZONA</th>\n\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t<th>UEP</th>\n\t\t\t\t\t\t\t<th>RUC PROVISIONAL</th>\n\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\n\t\t\t\t\t\t\t<th>NUMERO DE SOCIOS</th>\n\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS TOTAL</th>\n\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS MUJERES TOTAL</th>\n\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS HOMBRES TOTAL</th>\n\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t<th>CODIGO EVENTO</th>\n\t\t\t\t\t\t</tr>\";\n\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provUep[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nombresUep[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo[$cont] . \" - \" . $rucProvisional[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actOrgMP[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numSociosOrganizacion[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numPerCapacitadas[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capMujeres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capHombres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $servicioFortalecimiento[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $eventosAsistentes[$cont] . \"</td>\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\t}\n\n\tif($indicadorSel == 3)\n\t{\n\t\t$resIndicador = tercer_indicador($mesSel,$zonaSel);\n\t\t//print_r2($resIndicador);\t\t\t\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t//provincias de las organizaciones\n\t\t\t$provOrg = RecuperarInfoOrg($resIndicador, 'provincia');\n\t\t\t//nombres de las organizaciones\n\t\t\t$nombresOrganizaciones = RecuperarInfoOrg($resIndicador, 'nombresOrg');\n\t\t\t// ruc de las organizaciones\n\t\t\t$rucProvisional = RecuperarInfoOrg($resIndicador, 'rucProvisionalOrg');\n\t\t\t$rucDefinitivo = RecuperarInfoOrg($resIndicador, 'rucDefinitivoOrg');\n\t\t\t// actividad de la organizacion\n\t\t\t$actividadOrg = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//categoria Matriz productiva de las organizaciones\n\t\t\t$catMatrizProductivaOrg = RecuperarInfoOrg($resIndicador, 'categoriaMatriz');\n\t\t\t// numero de socios por cada organizacion\n\t\t\t$numSociosOrganizacion = NumSociosOrganizacion($resIndicador);\t\t\t\n\t\t\t//Servicio Brindado por Fortalecimiento\n\t\t\t$servicioFortalecimiento = ServiciosBrindadosOrg($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t//print_r2($resIndicador);\n\t\t\t// identificacion actividad matriz productiva\n\t\t\t$actOrgMP = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//Asistentes al circuito\n\t\t\t$asistentesCircuito = GetAsistentesCircuitosEconomicos($resIndicador, $anioCurso, $mesSel, $zonaSel);\n\n\n\t\t\t// BORRAR LUEGO SOLO PARA FORTALECIMIENTO\n\t\t\t$tablaCapacitados .= \"</table>\";\n\n\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>ACTIVIDAD</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE ASISTENTES</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE SOCIOS</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo[$cont] . \" - \" . $rucProvisional[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nombresOrganizaciones[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actividadOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actOrgMP[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $servicioFortalecimiento[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $asistentesCircuito[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numSociosOrganizacion[$cont] . \"</td>\t\t\t\t\t\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\t}\n\n\tif($indicadorSel == 4)\n\t{\n\t\tglobal $orgSocios;\n\t\t$resIndicador = cuarto_indicador($mesSel, $zonaSel);\n\t\t$provNombre = \"\";\n\t\t$rucSocio = \"\";\n\t\t$cedulaSocio = \"\";\n\t\t$apellidosSocio = \"\";\n\t\t$orgSocio = \"\";\n\t\t$actividadOrgSocio = \"\";\n\t\t$categoriaOrgSocio = \"\";\n\t\t$identificacionCategoriaOrgSocio = \"\";\n\t\t$campoFortalecimiento = \"\";\n\t\t$generoSocio = \"\";\n\t\t$poblacionSocio = \"\";\n\t\t$grupoEtnicoSocio = \"\";\n\n\n\t\t//print_r2($resIndicador);\n\t\t//print_r2($orgSocios);\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t$provNombre = \"\";\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CEDULA</th>\n\t\t\t\t\t\t\t\t<th>APELLIDOS Y NOMBRES</th>\n\t\t\t\t\t\t\t\t<th>GENERO</th>\n\t\t\t\t\t\t\t\t<th>POBLACION</th>\n\t\t\t\t\t\t\t\t<th>GRUPO ETNICO</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>ACTIVIDAD</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\t\t\t\t\t\n\t\t\t\t$rucSocio = \"\";\n\t\t\t\t$cedulaSocio = \"\";\n\t\t\t\t$apellidosSocio = \"\";\n\t\t\t\t$orgSocio = \"\";\n\t\t\t\t$actividadOrgSocio = \"\";\n\t\t\t\t$categoriaOrgSocio = \"\";\n\t\t\t\t$identificacionCategoriaOrgSocio = \"\";\n\t\t\t\t$campoFortalecimiento = \"\";\n\t\t\t\t$generoSocio = \"\";\n\t\t\t\t$poblacionSocio = \"\";\n\t\t\t\t$grupoEtnicoSocio = \"\";\n\n\t\t\t\t$sqlOrgSocios = \"select cod_u_organizaciones from socios where cedula = '\" . $valor . \"' and estado = 1 group by cod_u_organizaciones\";\n\n\t\t\t\t$resSqlOrgSocios = query($sqlOrgSocios);\n\t\t\t\t$numRegistros = mysql_num_rows($resSqlOrgSocios);\n\t\t\t\t//echo $sqlOrgSocios . \"<br>\";\n\t\t\t\t//echo $cont . \" \" . $numRegistros . \"<br>\";\n\n\t\t\t\tif($numRegistros > 1)\n\t\t\t\t{\n\t\t\t\t\t// El socio existe en mas de una organizacion, por lo cual se debe de tomar los cod_u_organizaciones\n\t\t\t\t\t$codOrgSocio = array();\n\t\t\t\t\t$codOrgReportada = array();\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlOrgSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($codOrgSocio, $fila['cod_u_organizaciones']);\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t// Se busca las organizaciones que han sido reportadas en el mes\n\t\t\t\t\tforeach($codOrgSocio as $codigoOrg)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array($codigoOrg, $orgSocios))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//si el codigo de organizacion se encuentra reportada se guarda en codOrgReportada\n\t\t\t\t\t\t\tarray_push($codOrgReportada, $codigoOrg);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//print_r2($codOrgReportada);\n\n\t\t\t\t\t// Se completa la informacion correspondiente\n\t\t\t\t\t$sqlNombresSocios = \"select apellidos, cedula, zona, cod_provincia, cod_canton, cod_parroquia, genero, grupo_etnico, poblacion, fecha_nacimiento, discapacidad, tipo_discapacidad, fecha_reporte from socios where cedula = '\" . $valor . \"' group by cedula\";\n\n\t\t\t\t\t$resSqlSocios = query($sqlNombresSocios);\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo $fila['cod_provincia'] . \" $indice<br>\";\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $fila['cedula'];\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\n\t\t\t\t\t\t$aux = 0;\n\t\t\t\t\t\tforeach($codOrgReportada as $codigoOrg)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sqlRucOrgSocio = \"select ruc_definitivo, ruc_provisional, organizacion, actividad, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $codigoOrg;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$resSqlRucOrgSocio = query($sqlRucOrgSocio);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resSqlRucOrgSocio))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($aux == 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rucSocio = $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t\t\t$orgSocio = $fila1['organizacion'];\n\t\t\t\t\t\t\t\t\t$actividadOrgSocio = $fila1['actividad'];\n\t\t\t\t\t\t\t\t\t$categoriaOrgSocio = $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio = $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rucSocio .= \" - \" . $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t\t\t$orgSocio .= \" - \" . $fila1['organizacion'];\n\t\t\t\t\t\t\t\t\t$actividadOrgSocio .= \" - \" . $fila1['actividad'];\n\t\t\t\t\t\t\t\t\t$categoriaOrgSocio .= \" - \" . $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio .= \" - \" . $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$sqlFortalecimiento = \"select e.campo_fortalecimiento, e.cod_evento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.cod_u_organizaciones = \" . $codigoOrg . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.campo_fortalecimiento\";\n\t\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t\t$aux1 = 0;\n\t\t\t\t\t\t\tif(mysql_num_rows($resFortalecimiento) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resFortalecimiento))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//se tiene que revisar si hay mas de un evento relacionado con esta org\n\t\t\t\t\t\t\t\t\tif($aux1 == 0) $campoFortalecimiento .= $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\t\telse $campoFortalecimiento .= \" - \" . $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\t\t$aux1++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sqlFortalecimiento = \"select e.cod_asistencia_legal from asistencia_legal_org e where e.cod_u_organizaciones = \" . $fila['cod_u_organizaciones'] . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.cod_asistencia_legal\";\n\t\t\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t\t\tif(mysql_num_rows($resFortalecimiento) > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$campoFortalecimiento = \"asistencia_legal\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$aux++;\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t\tif($numRegistros == 1)\n\t\t\t\t{\n\t\t\t\t\t$sqlNombresSocios = \"select apellidos, cedula, zona, cod_provincia, cod_canton, cod_parroquia, genero, grupo_etnico, poblacion, fecha_nacimiento, discapacidad, tipo_discapacidad, fecha_reporte , cod_u_organizaciones from socios where cedula = '\" . $valor . \"' order by cod_u_organizaciones\";\n\n\t\t\t\t\t$resSqlSocios = query($sqlNombresSocios);\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo $fila['cod_provincia'] . \" $indice - $zonaSel<br>\";\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $fila['cedula'];\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\n\t\t\t\t\t\t$sqlRucOrgSocio = \"select ruc_definitivo, ruc_provisional, organizacion, actividad, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $fila['cod_u_organizaciones'];\n\t\t\t\t\t\t//echo $sqlRucOrgSocio . \"<br>\";\n\t\t\t\t\t\t$resSqlRucOrgSocio = query($sqlRucOrgSocio);\n\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resSqlRucOrgSocio))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rucSocio = $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t$orgSocio = $fila1['organizacion'];\n\t\t\t\t\t\t\t$actividadOrgSocio = $fila1['actividad'];\n\t\t\t\t\t\t\t$categoriaOrgSocio = $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio = $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\t$sqlFortalecimiento = \"select e.campo_fortalecimiento, e.cod_evento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.cod_u_organizaciones = \" . $fila['cod_u_organizaciones'] . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.campo_fortalecimiento\";\n\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t$aux = 0;\n\t\t\t\t\t\tif(mysql_num_rows($resFortalecimiento) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resFortalecimiento))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//se tiene que revisar si hay mas de un evento relacionado con esta org\n\t\t\t\t\t\t\t\tif($aux == 0) $campoFortalecimiento .= $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\telse $campoFortalecimiento .= \" - \" . $fila1['campo_fortalecimiento'];\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$sqlFortalecimiento = \"select e.cod_asistencia_legal from asistencia_legal_org e where e.cod_u_organizaciones = \" . $fila['cod_u_organizaciones'] . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.cod_asistencia_legal\";\n\t\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t\tif(mysql_num_rows($resFortalecimiento) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$campoFortalecimiento = \"asistencia_legal\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$aux++;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provNombre . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $cedulaSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $apellidosSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $generoSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $poblacionSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $grupoEtnicoSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $orgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actividadOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $categoriaOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $identificacionCategoriaOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $campoFortalecimiento . \"</td>\t\t\t\t\t\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\t\t\n\t}\n\n\tif($indicadorSel == 5)\n\t{\n\t\t$resIndicador = quinto_indicador($mesSel,$zonaSel);\n\t\t//print_r2($resIndicador);\n\n\t\t$numRegistros = count($resIndicador);\n\t\tif($numRegistros > 0)\n\t\t{\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE HORAS DE CAPACITACION</th>\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t\t<th>EVENTO</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\n\t\t\tfor($i = 0; $i < count($resIndicador); $i = $i + 2)\n\t\t\t{\n\t\t\t\t$orgEvento = array();\n\t\t\t\t$orgFortalecimiento = array();\n\t\t\t\t$sqlOrgEventos = \"select ev.cod_u_organizaciones, e.campo_fortalecimiento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.anio = \" . $anioCurso . \" and ev.cod_evento = '\" . $resIndicador[$i] . \"' group by ev.cod_u_organizaciones\";\n\t\t\t\t//echo $sqlOrgEventos . \"<br>\";\n\t\t\t\t$resOrgEventos = query($sqlOrgEventos);\n\n\t\t\t\tif(mysql_num_rows($resOrgEventos) > 0)\n\t\t\t\t{\n\t\t\t\t\twhile($fila = mysql_fetch_array($resOrgEventos))\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($orgEvento, $fila['cod_u_organizaciones']);\n\t\t\t\t\t\tarray_push($orgFortalecimiento, $fila['campo_fortalecimiento']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$cont1 = 0;\t\t\t\t\t\n\t\t\t\t\tforeach($orgEvento as $valor)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$sqlOrganizacion = \"select cod_provincia, organizacion, ruc_definitivo, ruc_provisional, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $valor;\n\t\t\t\t\t\t$resOrganizacion = query($sqlOrganizacion);\n\t\t\t\t\t\t$provOrg = \"\";\n\t\t\t\t\t\t$nombreOrg = \"\";\n\t\t\t\t\t\t$catMatrizProductivaOrg = \"\";\n\t\t\t\t\t\t$actividadOrg = \"\";\n\t\t\t\t\t\twhile($fila = mysql_fetch_array($resOrganizacion))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$provOrg = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t\t$nombreOrg = $fila['organizacion'];\n\t\t\t\t\t\t\t$rucDefinitivo = $fila['ruc_definitivo'] . \" - \" . $fila['ruc_provisional'];\n\t\t\t\t\t\t\t$catMatrizProductivaOrg = $fila['categoria_actividad_mp'];\n\t\t\t\t\t\t\t$actividadOrg = $fila['identificacion_actividad_mp'];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $provOrg . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $nombreOrg . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $actividadOrg . \"</td>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $resIndicador[$i + 1] . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $orgFortalecimiento[$cont1] . \"</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\" . $resIndicador[$i] . \"</td>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t\t\t$cont++;\n\t\t\t\t\t\t$cont1++;\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$indice = $cont + 1;\n\n\t\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\n\t\t\t\t\t\t\t\t\t\t<td>NO EXISTEN ORGANIZACIONES REGISTRADAS</td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t<td>\" . $resIndicador[$i + 1] . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td> - </td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $resIndicador[$i] . \"</td>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t\t$cont++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\t\t\n\n\t\t\n\n\t}\n\n\tif($indicadorSel == 6)\n\t{\n\t\t$resIndicador = sexto_indicador($mesSel, $zonaSel);\n\t\t//print_r2($resIndicador);\n\t\t$numRegistros = count($resIndicador);\n\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t// si hay registros se debe crear la tabla de detalle\n\t\tif($numRegistros > 0)\n\t\t{\n\t\t\t// armado del header de la tabla\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>CEDULA</th>\n\t\t\t\t\t\t\t\t<th>APELLIDOS Y NOMBRES</th>\n\t\t\t\t\t\t\t\t<th>GRUPO ETNICO</th>\n\t\t\t\t\t\t\t\t<th>GENERO</th>\n\t\t\t\t\t\t\t\t<th>POBLACION</th>\n\t\t\t\t\t\t\t\t<th>CODIGO DIALOGO SOCIAL</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t//tengo el array con codigos del dialgo social devuelto por el indicador\n\t\t\t$cont = 0;\n\t\t\t$lineasTabla = \"\";\t\t\t\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\t\t\t\t// debe buscar la informacion del dialogo social\n\t\t\t\t$sqlDetalleDialogo = \"select cod_provincia, cedula, nombres, apellidos, grupo_etnico, poblacion, genero from asistentes where cod_evento = '\" . $valor . \"' and anio = \" . $anioCurso . \" group by cedula\";\n\t\t\t\t//echo $sqlDetalleDialogo . \"<br>\";\n\t\t\t\t$resDetalleDialogo = query($sqlDetalleDialogo);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\twhile($fila = mysql_fetch_array($resDetalleDialogo))\n\t\t\t\t{\n\t\t\t\t\t$indice = $cont + 1;\n\t\t\t\t\t$provOrg = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t$cedulaA = $fila['cedula'];\n\t\t\t\t\t$apellidosNombres = $fila['apellidos'];\n\t\t\t\t\t$grupoEtnico = $fila['grupo_etnico'];\n\t\t\t\t\t$generoA = $fila['genero'];\n\t\t\t\t\t$poblacionA = $fila['poblacion'];\n\n\t\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $provOrg . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $cedulaA . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $apellidosNombres . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $grupoEtnico . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $generoA . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $poblacionA . \"</td>\n\t\t\t\t\t\t\t\t\t\t<td>\" . $valor . \"</td>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t\t$cont++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// si no existe registros lo hacemos saber al usuario\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\t\t\n\t\t\n\n\t}\n\n\tif($indicadorSel == 7)\n\t{\n\t\t$resIndicador = septimo_indicador($mesSel, $zonaSel);\n\t\t//print_r2($resIndicador);\n\n\t\t// si el indicador regresa datos comenzamos a armar la tabla de detalle\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t// armado del header de la tabla\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>CEDULA</th>\n\t\t\t\t\t\t\t\t<th>APELLIDOS Y NOMBRES</th>\n\t\t\t\t\t\t\t\t<th>GRUPO ETNICO</th>\n\t\t\t\t\t\t\t\t<th>GENERO</th>\n\t\t\t\t\t\t\t\t<th>POBLACION</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\t\t\t$cont = 0;\n\t\t\t$lineasTabla = \"\";\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\t\t\t\t// consulto el detalle de los asistentes a eps\n\t\t\t\t$sqlAsistentes = \"select cod_provincia, apellidos, grupo_etnico, genero, poblacion from asistentes where tipo_evento = 'EPS' and zona=\" . $zonaSel . \" and month(fecha_reporte) = \" . $mesSel . \" and year(fecha_reporte) =\" . $anioCurso . \" and anio =\" . $anioCurso . \" and cedula = '\" . $valor . \"'\";\n\t\t\t\t$resAsistentes = query($sqlAsistentes);\n\t\t\t\twhile($fila = mysql_fetch_array($resAsistentes))\n\t\t\t\t{\n\t\t\t\t\t$provOrg = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t$apellidosNombres = $fila['apellidos'];\n\t\t\t\t\t$grupoEtnico = $fila['grupo_etnico'];\n\t\t\t\t\t$generoA = $fila['genero'];\n\t\t\t\t\t$poblacionA = $fila['poblacion'];\n\n\t\t\t\t}\n\n\t\t\t\t$indice = $cont + 1;\n\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provOrg . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $valor . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $apellidosNombres . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $grupoEtnico . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $generoA . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $poblacionA . \"</td>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\n\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// si no hay registros\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\t}\n\n\tif($indicadorSel == 8)\n\t{\n\t\t$resIndicador = octavo_indicador($mesSel, $zonaSel);\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t//provincias de las organizaciones\n\t\t\t$provOrg = RecuperarInfoOrg($resIndicador, 'provincia');\n\t\t\t//nombres de las organizaciones\n\t\t\t$nombresOrganizaciones = RecuperarInfoOrg($resIndicador, 'nombresOrg');\n\t\t\t// ruc de las organizaciones\n\t\t\t$rucProvisional = RecuperarInfoOrg($resIndicador, 'rucProvisionalOrg');\n\t\t\t$rucDefinitivo = RecuperarInfoOrg($resIndicador, 'rucDefinitivoOrg');\n\t\t\t//categoria Matriz productiva de las organizaciones\n\t\t\t$catMatrizProductivaOrg = RecuperarInfoOrg($resIndicador, 'categoriaMatriz');\n\t\t\t// numero de socios por cada organizacion\n\t\t\t$numSociosOrganizacion = NumSociosOrganizacion($resIndicador);\n\t\t\t// numero de personas Capacitadas\n\t\t\t$numPerCapacitadas = NumPersonasCapacitadas($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t//print_r2($eventosAsistentes);\n\t\t\t//Servicio Brindado por Fortalecimiento\n\t\t\t$servicioFortalecimiento = ServiciosBrindadosOrg($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel);\n\t\t\t//print_r2($resIndicador);\n\t\t\t// identificacion actividad matriz productiva\n\t\t\t$actOrgMP = RecuperarInfoOrg($resIndicador, 'identificacionMatriz');\n\t\t\t//capacitados por Genero\n\t\t\t$capMujeres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel, 'mujer');\n\t\t\t$capHombres = NumCapacitadosGenero($resIndicador, $anioCurso, $mesSel, 'ORG', $zonaSel, 'hombre');\n\n\n\t\t\t// BORRAR LUEGO SOLO PARA FORTALECIMIENTO\n\t\t\t$tablaCapacitados .= \"</table>\";\n\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES REPORTE</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE SOCIOS</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS MUJERES</th>\n\t\t\t\t\t\t\t\t<th>NUMERO DE CAPACITADOS HOMBRES</th>\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\n\t\t\t\t\t\t\t\t<th>CODIGO EVENTO</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nombresOrganizaciones[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucDefinitivo[$cont] . \" - \" . $rucProvisional[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $catMatrizProductivaOrg[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actOrgMP[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numSociosOrganizacion[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $numPerCapacitadas[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capMujeres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $capHombres[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $servicioFortalecimiento[$cont] . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $eventosAsistentes[$cont] . \"</td>\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\t}\n\n\tif($indicadorSel == 9)\n\t{\n\t\t$resIndicador = noveno_indicador($mesSel, $zonaSel);\n\t\t//print_r2($resIndicador);\n\t\t//global $orgSocios;\n\n\t\t$provNombre = \"\";\n\t\t$rucSocio = \"\";\n\t\t$cedulaSocio = \"\";\n\t\t$apellidosSocio = \"\";\n\t\t$orgSocio = \"\";\n\t\t$actividadOrgSocio = \"\";\n\t\t$categoriaOrgSocio = \"\";\n\t\t$identificacionCategoriaOrgSocio = \"\";\n\t\t$campoFortalecimiento = \"\";\n\t\t$generoSocio = \"\";\n\t\t$poblacionSocio = \"\";\n\t\t$grupoEtnicoSocio = \"\";\n\n\t\t//print_r2($resIndicador);\n\t\t//print_r2($orgSocios);\n\n\t\tif(count($resIndicador) > 0)\n\t\t{\n\t\t\t$provNombre = \"\";\n\t\t\t\n\t\t\t$nomMes = GetNombreMes($mesSel);\n\t\t\t$tablaHeader = \"<tr class='cabecera'>\n\t\t\t\t\t\t\t\t<th>INDICE</th>\n\t\t\t\t\t\t\t\t<th>MES</th>\n\t\t\t\t\t\t\t\t<th>ZONA</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>PROVINCIA</th>\n\t\t\t\t\t\t\t\t<th>RUC</th>\n\t\t\t\t\t\t\t\t<th>CEDULA</th>\n\t\t\t\t\t\t\t\t<th>APELLIDOS Y NOMBRES</th>\n\t\t\t\t\t\t\t\t<th>GENERO</th>\n\t\t\t\t\t\t\t\t<th>GRUPO ETNICO</th>\n\t\t\t\t\t\t\t\t<th>POBLACION</th>\n\t\t\t\t\t\t\t\t<th>ORGANIZACION</th>\n\t\t\t\t\t\t\t\t<th>ACTIVIDAD</th>\n\t\t\t\t\t\t\t\t<th>CATEGORIA ACTIVIDAD MATRIZ PRODUCTIVA</th>\n\t\t\t\t\t\t\t\t<th>IDENTIFICACION ACTIVIDAD MP</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>CAMPO FORTALECIMIENTO</th>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\n\n\t\t\t$lineasTabla = \"\";\n\t\t\t$cont = 0;\n\t\t\t$indice = 0;\n\n\t\t\tforeach($resIndicador as $valor)\n\t\t\t{\t\t\t\t\t\n\t\t\t\t$rucSocio = \"\";\n\t\t\t\t$cedulaSocio = \"\";\n\t\t\t\t$apellidosSocio = \"\";\n\t\t\t\t$orgSocio = \"\";\n\t\t\t\t$actividadOrgSocio = \"\";\n\t\t\t\t$categoriaOrgSocio = \"\";\n\t\t\t\t$identificacionCategoriaOrgSocio = \"\";\n\t\t\t\t$campoFortalecimiento = \"\";\n\t\t\t\t$generoSocio = \"\";\n\t\t\t\t$poblacionSocio = \"\";\n\t\t\t\t$grupoEtnicoSocio = \"\";\n\n\t\t\t\t$sqlOrgSocios = \"select cod_u_organizaciones from socios where cedula = '\" . $valor . \"' group by cod_u_organizaciones\";\n\n\t\t\t\t$resSqlOrgSocios = query($sqlOrgSocios);\n\t\t\t\t$numRegistros = mysql_num_rows($resSqlOrgSocios);\n\t\t\t\t//echo $numRegistros . \"<br>\";\n\n\t\t\t\tif($numRegistros > 1)\n\t\t\t\t{\n\t\t\t\t\t// El socio existe en mas de una organizacion, por lo cual se debe de tomar los cod_u_organizaciones\n\t\t\t\t\t$codOrgSocio = array();\n\t\t\t\t\t$codOrgReportada = array();\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlOrgSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($codOrgSocio, $fila['cod_u_organizaciones']);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Se busca las organizaciones que han sido reportadas en el mes\n\t\t\t\t\t/*foreach($codOrgSocio as $codigoOrg)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array($codigoOrg, $orgSocios))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//si el codigo de organizacion se encuentra reportada se guarda en codOrgReportada\n\t\t\t\t\t\t\tarray_push($codOrgReportada, $codigoOrg);\n\t\t\t\t\t\t}\n\t\t\t\t\t}*/\n\n\t\t\t\t\t// Se completa la informacion correspondiente\n\t\t\t\t\t$sqlNombresSocios = \"select apellidos, cedula, zona, cod_provincia, cod_canton, cod_parroquia, genero, grupo_etnico, poblacion, fecha_nacimiento, discapacidad, tipo_discapacidad, fecha_reporte from socios where cedula = '\" . $valor . \"' group by cedula\";\n\n\t\t\t\t\t$resSqlSocios = query($sqlNombresSocios);\n\t\t\t\t\t$codOrgReportada = $codOrgSocio;\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $fila['cedula'];\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\n\t\t\t\t\t\t$aux = 0;\n\t\t\t\t\t\tforeach($codOrgReportada as $codigoOrg)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sqlRucOrgSocio = \"select ruc_definitivo, ruc_provisional, organizacion, actividad, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $codigoOrg;\n\t\t\t\t\t\t\t$resSqlRucOrgSocio = query($sqlRucOrgSocio);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resSqlRucOrgSocio))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($aux == 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rucSocio = $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t\t\t$orgSocio = $fila1['organizacion'];\n\t\t\t\t\t\t\t\t\t$actividadOrgSocio = $fila1['actividad'];\n\t\t\t\t\t\t\t\t\t$categoriaOrgSocio = $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio = $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rucSocio .= \" - \" . $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t\t\t$orgSocio .= \" - \" . $fila1['organizacion'];\n\t\t\t\t\t\t\t\t\t$actividadOrgSocio .= \" - \" . $fila1['actividad'];\n\t\t\t\t\t\t\t\t\t$categoriaOrgSocio .= \" - \" . $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio .= \" - \" . $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$sqlFortalecimiento = \"select e.campo_fortalecimiento, e.cod_evento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.cod_u_organizaciones = \" . $codigoOrg . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.campo_fortalecimiento\";\n\n\t\t\t\t\t\t\t//echo $sqlFortalecimiento . \"<br>\";\n\t\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t\t$aux1 = 0;\n\t\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resFortalecimiento))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//se tiene que revisar si hay mas de un evento relacionado con esta org\n\t\t\t\t\t\t\t\tif($aux1 == 0) $campoFortalecimiento .= $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\telse $campoFortalecimiento .= \" - \" . $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t\t$aux1++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$aux++;\n\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t\tif($numRegistros == 1)\n\t\t\t\t{\n\t\t\t\t\t$sqlNombresSocios = \"select apellidos, cedula, zona, cod_provincia, cod_canton, cod_parroquia, genero, grupo_etnico, poblacion, fecha_nacimiento, discapacidad, tipo_discapacidad, fecha_reporte , cod_u_organizaciones from socios where cedula = '\" . $valor . \"' order by cod_u_organizaciones\";\n\n\t\t\t\t\t$resSqlSocios = query($sqlNombresSocios);\n\t\t\t\t\twhile($fila = mysql_fetch_array($resSqlSocios))\n\t\t\t\t\t{\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $fila['cedula'];\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\n\t\t\t\t\t\t$sqlRucOrgSocio = \"select ruc_definitivo, ruc_provisional, organizacion, actividad, categoria_actividad_mp, identificacion_actividad_mp from u_organizaciones where cod_u_organizaciones = \" . $fila['cod_u_organizaciones'];\n\t\t\t\t\t\t//echo $sqlRucOrgSocio . \"<br>\";\n\t\t\t\t\t\t$resSqlRucOrgSocio = query($sqlRucOrgSocio);\n\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resSqlRucOrgSocio))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rucSocio = $fila1['ruc_definitivo'] . \" - \" . $fila1['ruc_provisional'];\n\t\t\t\t\t\t\t$orgSocio = $fila1['organizacion'];\n\t\t\t\t\t\t\t$actividadOrgSocio = $fila1['actividad'];\n\t\t\t\t\t\t\t$categoriaOrgSocio = $fila1['categoria_actividad_mp'];\n\t\t\t\t\t\t\t$identificacionCategoriaOrgSocio = $fila1['identificacion_actividad_mp'];\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\t$sqlFortalecimiento = \"select e.campo_fortalecimiento, e.cod_evento from eventos_u_organizaciones ev inner join eventos e on (e.cod_evento = ev.cod_evento) where ev.cod_u_organizaciones = \" . $fila['cod_u_organizaciones'] . \" and month(e.fecha_reporte) = \" . $mesSel . \" and e.anio = \" . $anioCurso . \" group by e.campo_fortalecimiento\";\n\t\t\t\t\t\t$resFortalecimiento = query($sqlFortalecimiento);\n\t\t\t\t\t\t$aux = 0;\n\t\t\t\t\t\twhile($fila1 = mysql_fetch_array($resFortalecimiento))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//se tiene que revisar si hay mas de un evento relacionado con esta org\n\t\t\t\t\t\t\tif($aux == 0) $campoFortalecimiento .= $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\telse $campoFortalecimiento .= \" - \" . $fila1['campo_fortalecimiento'];\n\t\t\t\t\t\t\t$aux++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($numRegistros == 0)\n\t\t\t\t{\n\t\t\t\t\t// No es un asistente que pertnezca a una organizacion\n\t\t\t\t\t$rucSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$orgSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$actividadOrgSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$categoriaOrgSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$identificacionCategoriaOrgSocio = \"No pertenece a una ORG/UEP\";\n\t\t\t\t\t$sqlAsisten = \"select cod_provincia, cedula, apellidos, campo_fortalecimiento, genero, grupo_etnico, poblacion from asistentes where cedula = '\" . $valor . \"' and month(fecha_reporte) = \" . $mesSel . \" and year(fecha_reporte) = \" . $anioCurso . \" and anio = \" . $anioCurso;\n\t\t\t\t\t$resAsisten = query($sqlAsisten);\n\t\t\t\t\twhile($fila = mysql_fetch_array($resAsisten))\n\t\t\t\t\t{\n\t\t\t\t\t\t$provNombre = GetNombreProvincia($zonaSel, $fila['cod_provincia']);\n\t\t\t\t\t\t$cedulaSocio = $valor;\n\t\t\t\t\t\t$apellidosSocio = $fila['apellidos'];\n\t\t\t\t\t\t$campoFortalecimiento = $fila['campo_fortalecimiento'];\n\t\t\t\t\t\t$generoSocio = $fila['genero'];\n\t\t\t\t\t\tif($generoSocio == '') $generoSocio = \"No registrado\";\n\t\t\t\t\t\t$poblacionSocio = $fila['poblacion'];\n\t\t\t\t\t\tif($poblacionSocio == '') $poblacionSocio = \"No registrado\";\n\t\t\t\t\t\t$grupoEtnicoSocio = $fila['grupo_etnico'];\n\t\t\t\t\t\tif($grupoEtnicoSocio == '') $grupoEtnicoSocio = \"No registrado\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$indice = $cont + 1;\n\n\t\t\t\t$lineasTabla .= \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" . $indice . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $nomMes . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $zonaSel . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $provNombre . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $rucSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $cedulaSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $apellidosSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $generoSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $grupoEtnicoSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $poblacionSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $orgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $actividadOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $categoriaOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $identificacionCategoriaOrgSocio . \"</td>\n\t\t\t\t\t\t\t\t\t<td>\" . $campoFortalecimiento . \"</td>\t\t\t\t\t\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t$cont++;\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tabla .= \"<tr>\n\t\t\t\t\t\t<td>ESTE INDICADOR TIENE 0 REGISTROS REPORTADOS</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\n\n\n\t}\n\t$resultadoFinal = $tablaHeader . $lineasTabla;\n\treturn $resultadoFinal;\n}", "function tab_get_extra_capabilities() {\n return array('moodle/site:accessallgroups');\n}", "function paintDiagramASM() {\n global $answer;\n $div = \"diagramASM\";\n //$image = elementImage(\"\", 400, 400);\n $text = \"<table><tr></tr><tr></tr><tr></tr><tr><td></td></tr>\";\n $selectDiagramASM = select(\"\", \"\", \"\", \"Name Diagram\");\n $text .=\"<tr><td><center>DIagram ASM:</center></td></tr>\";\n /* @var $selectDiagramASM type */\n $text .=\"<tr><td id=td><center>$selectDiagramASM</center></td></tr></table>\";\n $answer->addAssign($div, \"innerHTML\", $text);\n return $answer;\n}", "function add_dashboard() {\n}", "function display_graphic($piece)\n{\n}", "function TablaVentasDiariasAdmin()\n {\n //Logo\n $this->Image(\"./assets/img/logo.png\" , 35 ,12, 80 , 25 , \"PNG\"); \n //Arial bold 15\n $this->SetFont('Courier','B',18);\n //Movernos a la derecha\n $this->Cell(130);\n //Título\n $this->Cell(180,25,'LISTADO DE VENTAS GENERAL DEL DIA '.date(\"d-m-Y\"),0,0,'C');\n //Salto de línea\n $this->Ln(30);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'CÉDULA GERENTE :',0,0,'');\n\t$this->CellFitSpace(95,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->CellFitSpace(42,5,'NOMBRE GERENTE :',0,0,'');\n\t$this->CellFitSpace(120,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'TELÉFONO GERENTE :',0,0,'');\n $this->CellFitSpace(95,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->CellFitSpace(42,5,'CORREO GERENTE :',0,0,'');\n $this->CellFitSpace(120,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(10,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'CÓDIGO VENTA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'CAJA',1,0,'C', True);\n\t$this->CellFitSpace(60,8,'CLIENTES',1,0,'C', True);\n\t$this->CellFitSpace(35,8,'FECHA VENTA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'ARTIC',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'SUBTOTAL CON IVA',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'SUBTOTAL IVA 0%',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'IVA',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'TOTAL IVA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'DESC',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'TOTAL DESC',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'TOTAL PAGO',1,1,'C', True);\n\t\n $tra = new Login();\n $reg = $tra->ListarVentasDiarias();\n\t$totalarticulos=0;\n\t$Subtotalconiva=0;\n\t$Subtotalsiniva=0;\n\t$Totaliva=0;\n\t$Totaldescuento=0;\n\t$pagoDescuento=0;\n\t$Pagototal=0;\n\t$PagototalCompras=0;\n\t$a=1;\n\t\n for($i=0;$i<sizeof($reg);$i++){\n\t\n $totalarticulos+=$reg[$i]['articulos'];\n $Subtotalconiva+=$reg[$i]['subtotalivasive'];\n $Subtotalsiniva+=$reg[$i]['subtotalivanove'];\n\t$Totaliva+=$reg[$i]['totalivave']; \n\t$Totaldescuento+=$reg[$i]['totaldescuentove']; \n\t$Pagototal+=$reg[$i]['totalpago'];\n $PagototalCompras+=$reg[$i]['totalpago2']; \n\t\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(10,5,$a++,1,0,'C');\n\t$this->CellFitSpace(32,5,$reg[$i][\"codventa\"],1,0,'C');\n\t$this->CellFitSpace(15,5,utf8_decode($reg[$i][\"nrocaja\"]),1,0,'C');\n\t$this->CellFitSpace(60,5,utf8_decode($reg[$i][\"nomcliente\"]),1,0,'C');\n\t$this->CellFitSpace(35,5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($reg[$i]['fechaventa']))),1,0,'C');\n\t$this->CellFitSpace(15,5,utf8_decode($reg[$i][\"articulos\"]),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['subtotalivasive'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['subtotalivanove'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(15,5,utf8_decode(number_format($reg[$i]['ivave'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totalivave'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(15,5,utf8_decode(number_format($reg[$i]['descuentove'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totaldescuentove'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['totalpago'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(10,5,'',0,0,'C');\n $this->Cell(32,5,'',0,0,'C');\t\t\n $this->Cell(15,5,'',0,0,'C');\n $this->Cell(60,5,'',0,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n\n $this->Cell(35,5,'TOTAL GENERAL',1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n\t$this->Cell(15,5,utf8_decode($totalarticulos),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Subtotalconiva, 2, '.', ',')),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Subtotalsiniva, 2, '.', ',')),1,0,'C');\n $this->Cell(15,5,\"\",1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($Totaliva, 2, '.', ',')),1,0,'C');\n $this->Cell(15,5,\"\",1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($Totaldescuento, 2, '.', ',')),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Pagototal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n\t$UtilidadBruto= $Pagototal-$PagototalCompras;\n\t$MargenBruto = ( $UtilidadBruto == '' ? \"0.00\" : number_format($UtilidadBruto/$PagototalCompras, 2, '.', ','));\n\t\n\t$this->Cell(10,5,'',0,0,'C');\n $this->Cell(32,5,'',0,0,'C');\t\t\n $this->Cell(15,5,'',0,0,'C');\n $this->Cell(60,5,'',0,0,'C');\t\n\t$this->Cell(35,5,'',0,0,'C');\n\t$this->Cell(15,5,'',0,0,'C');\n $this->Cell(30,5,'',0,0,'C');\n $this->Cell(30,5,'',0,0,'C');\n $this->Cell(15,5,'',0,0,'C');\n $this->Cell(22,5,'',0,0,'C');\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(37,5,\"TOTAL GANANCIAS\",1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n $this->Cell(30,5,utf8_decode(number_format($MargenBruto*100, 2, '.', ',')),1,0,'C');\n $this->Ln();\n \n $this->Ln(12); \n $this->SetFont('courier','B',9);\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]),0,0,'');\n $this->Cell(80,6,'RECIBIDO:__________________________________',0,0,'');\n $this->Ln();\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'FECHA/HORA ELABORACIÓN: '.date('d-m-Y h:i:s A'),0,0,'');\n $this->Cell(80,6,'',0,0,'');\n $this->Ln(4);\n }", "public function get_tab( $tabs ) {\n\t\t$tabs['goaccess'] = array(\n\t\t\t'label' => __( 'Goaccess', 'wpcd' ),\n\t\t\t'icon' => 'fad fa-user-chart',\n\t\t);\n\t\treturn $tabs;\n\t}", "function tab_update_instance($tab) {\n global $CFG, $DB;\n\n require_once(\"$CFG->libdir/resourcelib.php\");\n\n $cmid = $tab->coursemodule;\n\n $tab->timemodified = time();\n $tab->id = $tab->instance;\n\n foreach ($tab->tabname as $key => $value) {\n\n // we need to use context now, so we need to make sure all needed info is already in db\n $DB->set_field('course_modules', 'instance', $tab->id, array('id' => $cmid));\n $context = context_module::instance($cmid);\n $editoroptions = array('subdirs' => 1, 'maxbytes' => $CFG->maxbytes, 'maxfiles' => -1, 'changeformat' => 1, 'context' => $context, 'noclean' => 1, 'trusttext' => true);\n\n\n $value = trim($value);\n $option = new stdClass();\n $option->tabname = $value;\n $option->tabcontentorder = $tab->tabcontentorder[$key];\n $option->externalurl = $tab->externalurl[$key];\n //tab content is now an array due to the new editor\n $draftitemid = $tab->content[$key]['itemid'];\n\n if ($draftitemid) {\n $option->tabcontent = file_save_draft_area_files($draftitemid, $context->id, 'mod_tab', 'content', $tab->optionid[$key], $editoroptions, $tab->content[$key]['text']);\n }\n $option->contentformat = $tab->content[$key]['format'];\n $option->tabid = $tab->id;\n $option->timemodified = time();\n\n if (isset($tab->optionid[$key]) && !empty($tab->optionid[$key])) {//existing tab record\n $option->id = $tab->optionid[$key];\n if (isset($value) && $value <> '') {\n $DB->update_record(\"tab_content\", $option);\n } else { //empty old option - needs to be deleted.\n $DB->delete_records(\"tab_content\", array(\"id\" => $option->id));\n }\n } else {\n if (isset($value) && $value <> '') {\n $newtab_content_id = $DB->insert_record(\"tab_content\", $option);\n //tab content is now an array due to the new editor\n //In order to enter file information from the editor\n //We must now update the record once it has been created\n\n if (isset($tab->content[$key]['text'])) {\n $draftitemid = $tab->content[$key]['itemid'];\n if ($draftitemid) {\n $tabcontentupdate = new stdClass();\n $tabcontentupdate->id = $newtab_content_id;\n $tabcontentupdate->tabcontent = file_save_draft_area_files($draftitemid, $context->id, 'mod_tab', 'content', $newtab_content_id, $editoroptions, $tab->content[$key]['text']);\n $DB->update_record('tab_content', $tabcontentupdate);\n }\n }\n }\n }\n }\n return $DB->update_record(\"tab\", $tab);\n}", "function modificarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tabla','id_tabla','int4');\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function getTable($pageID){\r\n require_once 'static/classes/class_light.php';\r\n require_once 'static/classes/class_material.php';\r\n require_once 'static/classes/class_particle.php';\r\n require_once 'static/classes/class_page.php';\r\n require_once 'static/classes/class_rendershader.php';\r\n require_once 'static/classes/class_scriptinclude.php';\r\n require_once 'static/classes/class_skybox.php';\r\n\r\n // Connects to your Database \r\n mysql_connect(mysql_server, mysql_username, mysql_password) or die(mysql_error()); \r\n mysql_select_db(mysql_database) or die(mysql_error()); \r\n $data = mysql_query(\"SELECT * FROM pages WHERE id = $pageID\") \r\n or die(mysql_error());\r\n\r\n //grab those vars\r\n $info = mysql_fetch_array($data);\r\n //assign them\r\n $tpl_args['id'] = $info['id'];\r\n $tpl_args['publicationDate'] = $info['publicationDate'];\r\n $tpl_args['title'] = $info['title'];\r\n $tpl_args['summary'] = $info['summary'];\r\n $tpl_args['canvasTarget'] = $info['canvastarget'];\r\n\r\n /*\r\n $tpl_args['scriptIncludes'] = array(\r\n 'jQuery' => 'static/js/jquery-1.11.0.min.js',\r\n 'threemin' => 'static/js/threejs/three.min.js'\r\n );\r\n */\r\n $tpl_args['scriptIncludes'] = unserialize($info['scriptincludes']);\r\n \r\n\r\n $tpl_args['usePixelShaders'] = $info['usepixelshaders'];\r\n /*\r\n $rendershaders[] = new rendershader;\r\n //$rendershaders[0]->colorifyShader = 'static/js/threejs/shaders/ColorifyShader.js';\r\n //$rendershaders[0]->filmShader = 'static/js/threejs/shaders/FilmShader.js';\r\n //$rendershaders[0]->bleachBypassShader = 'static/js/threejs/shaders/BleachBypassShader.js';\r\n //$rendershaders[0]->colorifyShader = 'static/js/threejs/shaders/ColorifyShader.js';\r\n //$rendershaders[0]->dotScreenShader = 'static/js/threejs/shaders/DotScreenShader.js';\r\n //$rendershaders[0]->brightnessContrastShader = 'static/js/threejs/shaders/BrightnessContrastShader.js';\r\n //$rendershaders[0]->colorCorrectionShader = 'static/js/threejs/shaders/ColorCorrectionShader.js';\r\n $rendershaders[0]->filmShader = 'static/js/threejs/shaders/FilmShader.js';\r\n //$rendershaders[0]->focusShader = 'static/js/threejs/shaders/FocusShader.js';\r\n //$rendershaders[0]->horizontalBlurShader = 'static/js/threejs/shaders/HorizontalBlurShader.js';\r\n //$rendershaders[0]->verticalBlurShader = 'static/js/threejs/shaders/VerticalBlurShader.js';\r\n //$rendershaders[0]->verticalTiltShiftShader = 'static/js/threejs/shaders/VerticalTiltShiftShader.js';\r\n //$rendershaders[0]->hueSaturationShader = 'static/js/threejs/shaders/HueSaturationShader.js';\r\n //$rendershaders[0]->kaleidoShader = 'static/js/threejs/shaders/KaleidoShader.js';\r\n //$rendershaders[0]->luminosityShader = 'static/js/threejs/shaders/LuminosityShader.js';\r\n //$rendershaders[0]->mirrorShader = 'static/js/threejs/shaders/MirrorShader.js';\r\n //$rendershaders[0]->rgbShiftShader = 'static/js/threejs/shaders/RGBShiftShader.js';\r\n //$rendershaders[0]->sepiaShader = 'static/js/threejs/shaders/SepiaShader.js';\r\n $rendershaders[0]->vignetteShader = 'static/js/threejs/shaders/VignetteShader.js';\r\n //$rendershaders[0]->edgeDetectionFreiChenShader = 'static/js/threejs/shaders/EdgeShader.js';\r\n //$rendershaders[0]->edgeDetectionSobelShader = 'static/js/threejs/shaders/EdgeShader2.js';\r\n */\r\n $tpl_args['shaderIncludes'] = unserialize($info['shaderincludes']);\r\n\r\n\r\n $tpl_args['showStats'] = $info['showstats'];\r\n $tpl_args['renderMode'] = $info['rendermode'];\r\n $tpl_args['ao_bit'] = $info['aobit'];\r\n $tpl_args['aa_bit'] = $info['aabit'];\r\n $tpl_args['enablePhysics_bit'] = $info['enablePhysics_bit'];\r\n $tpl_args['controlMode'] = $info['controlmode'];\r\n $tpl_args['cameraPosition'] = $info['cameraposition'];\r\n $tpl_args['cameraPerspective'] = $info['cameraperspective'];\r\n $tpl_args['camNear'] = $info['camnear'];\r\n $tpl_args['camFar'] = $info['camfar'];\r\n \r\n /*\r\n $lights[] = new light;\r\n $lights[0]->lightMode = 'hemisphere';\r\n $lights[0]->lightIntensity = 0.1;\r\n $lights[0]->lightColor = '0x55FF99';\r\n $lights[] = new light;\r\n $lights[1]->lightMode = 'spot';\r\n $lights[1]->lightIntensity = 1.5;\r\n $lights[1]->lightColor = '0xFFFFFF';\r\n */\r\n $tpl_args['lights'] = unserialize($info['lights']);\r\n\r\n /*\r\n $materials[] = new material;\r\n $materials[0]->matName = 'TreeTex';\r\n //OPTIONS: 'lambert', 'wire'\r\n $materials[0]->matType = 'lambert';\r\n $materials[0]->matColor = '0x00FF33';\r\n $materials[0]->matMap = view_path . 'img/DreamOak.jpg';\r\n */\r\n $tpl_args['materials'] = unserialize($info['materials']);\r\n\r\n $tpl_args['realtimeShadows_bit'] = $info['realtimeshadowsbit'];\r\n $tpl_args['realtimeShadowSmooth'] = $info['realtimeshadowsmooth'];\r\n $tpl_args['linearFog_bit'] = $info['linearfogbit'];\r\n $tpl_args['linearFogColor'] = $info['linearfogcolor'];\r\n $tpl_args['linearFogNear'] = $info['linearfognear'];\r\n $tpl_args['linearFogFar'] = $info['linearfogfar'];\r\n $tpl_args['exponentialFog_bit'] = $info['exponentialfogbit'];\r\n $tpl_args['exponentialFogColor'] = $info['exponentialfogcolor'];\r\n $tpl_args['exponentialFogDensity'] = $info['exponentialfogdensity'];\r\n $tpl_args['sceneFile'] = $info['scenefile'];\r\n $tpl_args['sceneTex'] = $info['scenetex'];\r\n $tpl_args['useSkybox'] = $info['useskybox'];\r\n $tpl_args['skyboxScale'] = $info['skyboxscale'];\r\n\r\n /*\r\n $tpl_args['skyboxTextures'] = array(\r\n 'right' => 'static/skybox/px.jpg',\r\n 'left' => 'static/skybox/nx.jpg',\r\n 'top' => 'static/skybox/py.jpg',\r\n 'bottom' => 'static/skybox/ny.jpg',\r\n 'back' => 'static/skybox/pz.jpg',\r\n 'front' => 'static/skybox/nz.jpg'\r\n );\r\n */\r\n $tpl_args['skyboxTextures'] = unserialize($info['skyboxtextures']);\r\n\r\n $tpl_args['customInits'] = $info['custominits'];\r\n $tpl_args['customBody'] = $info['custombody'];\r\n $tpl_args['customRender'] = $info['customrender'];\r\n $tpl_args['pageContent'] = $info['pagecontent'];\r\n $tpl_args['components'] = $info['components'];\r\n return $tpl_args;\r\n}", "function rename_tab( $tabs ) \n{\n\t$tabs['additional_information']['title'] = __( 'O Produto' );\n\treturn $tabs;\n}", "function dashboard_bundles()\r\n{\r\n\t$Templatic_connector = New Templatic_connector;\r\n\trequire_once(TEVOLUTION_PAGE_TEMPLATES_DIR.'classes/main.connector.class.php' );\t\r\n\tif(isset($_REQUEST['tab']) && $_REQUEST['tab'] =='extend') { \t\r\n\t\t$Templatic_connector->templ_extend();\r\n\t}else if(isset($_REQUEST['tab']) && $_REQUEST['tab'] =='payment-gateways') { \t\r\n\t\t$Templatic_connector->templ_payment_gateway();\r\n\t}else if(isset($_REQUEST['tab']) && $_REQUEST['tab'] =='system_status') { \t\r\n\t\t$Templatic_connector->templ_system_status();\r\n\t}\r\n\telse if((!isset($_REQUEST['tab'])&& @$_REQUEST['tab']=='') || isset($_REQUEST['tab']) && $_REQUEST['tab'] =='overview') { \t\r\n\t\t$Templatic_connector->templ_overview();\r\n\t\t$Templatic_connector->templ_dashboard_extends();\r\n\t}\r\n \r\n}", "function cspm_add_locations_tabs($metabox_object, $metabox_options){\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Setting tabs */\r\n\t\t\t \r\n\t\t\t$tabs_setting = array(\r\n\t\t\t\t'args' => $metabox_options,\r\n\t\t\t\t'tabs' => array()\r\n\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t * Tabs array */\r\n\t\t\t\t \r\n\t\t\t\t$cspm_tabs = array(\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**\r\n\t\t\t\t \t * Coordinates */\r\n\t\t\t\t\t \r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'post_coordinates', \r\n\t\t\t\t\t\t'title' => 'GPS Coordinates', \r\n\t\t\t\t\t\t'callback' => 'cspm_post_coordinates_fields'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**\r\n\t\t\t\t \t * Marker */\r\n\t\t\t\t\t \r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'post_marker', \r\n\t\t\t\t\t\t'title' => 'Marker', \r\n\t\t\t\t\t\t'callback' => 'cspm_post_marker_fields'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**\r\n\t\t\t\t \t * Marker Label\r\n\t\t\t\t\t * @since 5.5 */\r\n\t\t\t\t\t \r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'post_marker_label', \r\n\t\t\t\t\t\t'title' => 'Marker Label', \r\n\t\t\t\t\t\t'callback' => 'cspm_post_marker_label_fields'\r\n\t\t\t\t\t),\r\n\r\n\t\t\t\t\t/**\r\n\t\t\t\t \t * Format & Media */\r\n\t\t\t\t\t \r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'post_format_and_media', \r\n\t\t\t\t\t\t'title' => 'Format & Media', \r\n\t\t\t\t\t\t'callback' => 'cspm_post_format_and_media'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\r\n\t\t\t\t/**\r\n\t\t\t\t * Custom Fields of the extension \"Submit locations\"\r\n\t\t\t\t * @since 5.3 */\r\n\t\t\t\t\r\n\t\t\t\tif(class_exists('CspmSubmitLocations')){ \r\n\t\t\t\t\t$cspm_tabs[] = array(\r\n\t\t\t\t\t\t'id' => 'post_submited_custom_fields', \r\n\t\t\t\t\t\t'title' => 'Custom Fields', \r\n\t\t\t\t\t\t'callback' => 'cspm_post_submit_locations_custom_fields'\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tforeach($cspm_tabs as $tab_data){\r\n\t\t\t\t \r\n\t\t\t\t\t$tabs_setting['tabs'][] = array(\r\n\t\t\t\t\t\t'id' => 'cspm_' . $tab_data['id'],\r\n\t\t\t\t\t\t'title' => '<span class=\"cspm_tabs_menu_image\"><img src=\"'.$this->plugin_url.'admin/img/add-locations-metabox/'.str_replace('_', '-', $tab_data['id']).'.png\" style=\"width:20px;\" /></span> <span class=\"cspm_tabs_menu_item\">'.esc_attr__( $tab_data['title'], 'cspm' ).'</span>',\t\t\t\t\t\t\r\n\t\t\t\t\t\t'fields' => call_user_func(array($this, $tab_data['callback'])),\r\n\t\t\t\t\t);\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * Set tabs */\r\n\t\t\t \r\n\t\t\t$metabox_object->add_field( array(\r\n\t\t\t\t'id' => 'cspm_add_locations_tabs',\r\n\t\t\t\t'type' => 'tabs',\r\n\t\t\t\t'tabs' => $tabs_setting\r\n\t\t\t) );\r\n\t\t\t\r\n\t\t\treturn $metabox_object;\r\n\t\t\t\r\n\t\t}", "function dfcg_plugin_help() {\n\t\n\tglobal $current_screen;\n\t\n\t$sidebar = dfcg_help_sidebar();\n\t\n\t$current_screen->set_help_sidebar( $sidebar );\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-general',\n\t\t'title' => __( 'General info', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_general'\n\t));\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-theme',\n\t\t'title' => __( 'Theme integration', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_theme'\n\t));\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-quick',\n\t\t'title' => __( 'Quick Start', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_quick'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-gallery',\n\t\t'title' => __( 'Gallery Method', DFCG_DOMAIN ),\n\t\t'callback' => \"dfcg_help_gallery\"\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-images',\n\t\t'title' => __( 'Image Management', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_images'\n\t));\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-desc',\n\t\t'title' => __( 'Descriptions', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_desc'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-css',\n\t\t'title' => __( 'Gallery CSS', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_css'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-scripts',\n\t\t'title' => __( 'Load Scripts', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_scripts'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-troubleshooting',\n\t\t'title' => __( 'Troubleshooting', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_trouble'\n\t));\n}", "function draw() {\n }", "function TablaVentasDiariasVendedor()\n {\t\n\t\n\t $this->Image(\"./assets/img/logo.png\" , 35 ,12, 80 , 25 , \"PNG\"); \n\t $this->SetXY(10, 15); \n //Arial bold 15\n $this->SetFont('Courier','B',18);\n //Movernos a la derecha\n //$this->Cell(130);\n //Título\n $this->Cell(140,8,'',0,0,'');\n\t$this->Cell(180,8,'LISTADO DE VENTAS DIARIAS DEL '.date(\"d-m-Y\"),0,1,'C');\n\t\n $this->Cell(140,8,'',0,0,'');\n\t$this->Cell(180,8,'DE CAJA N°.'.base64_decode($_GET['caja']),0,0,'C');\n //Salto de línea\n $this->Ln(15);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'CÉDULA GERENTE :',0,0,'');\n\t$this->CellFitSpace(95,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->CellFitSpace(42,5,'NOMBRE GERENTE :',0,0,'');\n\t$this->CellFitSpace(120,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'TELÉFONO GERENTE :',0,0,'');\n $this->CellFitSpace(95,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->CellFitSpace(42,5,'CORREO GERENTE :',0,0,'');\n $this->CellFitSpace(120,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(10,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'CÓDIGO VENTA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'CAJA',1,0,'C', True);\n\t$this->CellFitSpace(60,8,'CLIENTES',1,0,'C', True);\n\t$this->CellFitSpace(35,8,'FECHA VENTA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'ARTIC',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'SUBTOTAL CON IVA',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'SUBTOTAL IVA 0%',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'IVA',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'TOTAL IVA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'DESC',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'TOTAL DESC',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'TOTAL PAGO',1,1,'C', True);\n\t\n $tra = new Login();\n $reg = $tra->ListarVentasDiarias();\n\t$totalarticulos=0;\n\t$Subtotalconiva=0;\n\t$Subtotalsiniva=0;\n\t$Totaliva=0;\n\t$Totaldescuento=0;\n\t$pagoDescuento=0;\n\t$Pagototal=0;\n\t$PagototalCompras=0;\n\t$a=1;\n\t\n for($i=0;$i<sizeof($reg);$i++){\n\t\n $totalarticulos+=$reg[$i]['articulos'];\n $Subtotalconiva+=$reg[$i]['subtotalivasive'];\n $Subtotalsiniva+=$reg[$i]['subtotalivanove'];\n\t$Totaliva+=$reg[$i]['totalivave']; \n\t$Totaldescuento+=$reg[$i]['totaldescuentove']; \n\t$Pagototal+=$reg[$i]['totalpago'];\n $PagototalCompras+=$reg[$i]['totalpago2']; \n\t\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(10,5,$a++,1,0,'C');\n\t$this->CellFitSpace(32,5,$reg[$i][\"codventa\"],1,0,'C');\n\t$this->CellFitSpace(15,5,utf8_decode($reg[$i][\"nrocaja\"]),1,0,'C');\n\t$this->CellFitSpace(60,5,utf8_decode($reg[$i][\"nomcliente\"]),1,0,'C');\n\t$this->CellFitSpace(35,5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($reg[$i]['fechaventa']))),1,0,'C');\n\t$this->CellFitSpace(15,5,utf8_decode($reg[$i][\"articulos\"]),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['subtotalivasive'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['subtotalivanove'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(15,5,utf8_decode(number_format($reg[$i]['ivave'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totalivave'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(15,5,utf8_decode(number_format($reg[$i]['descuentove'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totaldescuentove'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['totalpago'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(10,5,'',0,0,'C');\n $this->Cell(32,5,'',0,0,'C');\t\t\n $this->Cell(15,5,'',0,0,'C');\n $this->Cell(60,5,'',0,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n\n $this->Cell(35,5,'TOTAL GENERAL',1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n\t$this->Cell(15,5,utf8_decode($totalarticulos),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Subtotalconiva, 2, '.', ',')),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Subtotalsiniva, 2, '.', ',')),1,0,'C');\n $this->Cell(15,5,\"\",1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($Totaliva, 2, '.', ',')),1,0,'C');\n $this->Cell(15,5,\"\",1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($Totaldescuento, 2, '.', ',')),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Pagototal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n\t$UtilidadBruto= $Pagototal-$PagototalCompras;\n\t$MargenBruto = ( $UtilidadBruto == '' ? \"0.00\" : number_format($UtilidadBruto/$PagototalCompras, 2, '.', ','));\n\t\n\t$this->Cell(10,5,'',0,0,'C');\n $this->Cell(32,5,'',0,0,'C');\t\t\n $this->Cell(15,5,'',0,0,'C');\n $this->Cell(60,5,'',0,0,'C');\t\n\t$this->Cell(35,5,'',0,0,'C');\n\t$this->Cell(15,5,'',0,0,'C');\n $this->Cell(30,5,'',0,0,'C');\n $this->Cell(30,5,'',0,0,'C');\n $this->Cell(15,5,'',0,0,'C');\n $this->Cell(22,5,'',0,0,'C');\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(37,5,\"TOTAL GANANCIAS\",1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n $this->Cell(30,5,utf8_decode(number_format($MargenBruto*100, 2, '.', ',')),1,0,'C');\n $this->Ln();\n\n $this->Ln(12); \n $this->SetFont('courier','B',9);\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]),0,0,'');\n $this->Cell(80,6,'RECIBIDO:__________________________________',0,0,'');\n $this->Ln();\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'FECHA/HORA ELABORACIÓN: '.date('d-m-Y h:i:s A'),0,0,'');\n $this->Cell(80,6,'',0,0,'');\n $this->Ln(4);\n }", "public function create_tabs_script(){\n\t\treturn $this->style.'\n<script>\n\tjQuery(function () {\n\t\tjQuery(\".nav-tab-wrapper a\").click(function (e) {\n\t\t\te.preventDefault();\n\t\t\tvar tab_class = jQuery(this).data(\"tab\"); \n\t\t\tvar target = jQuery(this).data(\"target\");\n\t\t\tvar title = jQuery(this).text();\n\n\t\t\tjQuery(\".tabs-title\").fadeOut(function(){\n\t \tjQuery(\".tabs-title\").text(title).fadeIn();\n\t })\n\n\t\t\tjQuery(this).parent().find(\".nav-tab\").removeClass(\"nav-tab-active\");\n\t\t\tjQuery(this).addClass(\"nav-tab-active\");\n\t\t\n\t\t\tjQuery(\".tab\").not(\".\"+tab_class).parentsUntil(\".cmb-repeat-group-wrap\").fadeOut(600);\n\t\t\tjQuery(\".\"+tab_class).parentsUntil(\".cmb-repeat-group-wrap\").fadeIn(1000);\n\n\t\t});\n\t\tjQuery(\".hide-clone\").parentsUntil(\".cmb-row\").fadeOut();\n\t\tjQuery(\".hide-remove\").parentsUntil(\".cmb-remove-field-row\").fadeOut();\n\t});\n</script>\n<style>\n\t.page, .component{\n\t\tbackground:#6bb1a3;\n\t\tborder-radius: 10px 10px 0px 0px;\n\t\tborder:solid 2px gray;\n\t\tcolor:white;\n\n\t}\n\t.page:hover, .component:hover{\n\t\tbackground:#4b9183;\n\t\tcolor:black;\n\n\t}\n\t.component{\n\t\tbackground:#8bd1c3;\n\t}\n</style>';\n\t}", "function morepagestable($datas,$lineheight=8) {\n $l = $this->lMargin;\n $startheight = $h = $this->GetY();\n $startpage = $currpage = $this->page;\n // calculate the whole width\n foreach($this->tablewidths AS $width) {\n $fullwidth += $width;\n }\n $this->SetFont('Arial','',6);\n // Now let's start to write the table\n foreach($datas AS $row => $data) {\n $this->page = $currpage;\n // write the horizontal borders\n $this->Line($l,$h,$fullwidth+$l,$h);\n // write the content and remember the height of the highest col\n $posicion = 0;\n $fil=0;\n foreach($data AS $col => $txt) {\n \tif($posicion == 0 AND strpos($txt,\".\")===false){\n \t\t$fil=1;\n \t}\n \t\n \t$posicion++;\n \t$this->SetFillColor(60,100,200);\n \t$this->SetTextColor(0,0,0);\n $this->page = $currpage;\n $this->SetXY($l,$h);\n $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,1,$fil);\n $l += $this->tablewidths[$col];\n\t\t\t$this->SetFillColor(0,0,0);\n if($tmpheight[$row.'-'.$this->page] < $this->GetY()) {\n $tmpheight[$row.'-'.$this->page] = $this->GetY();\n }\n if($this->page > $maxpage)\n $maxpage = $this->page;\n }\n\n // get the height we were in the last used page\n $h = $tmpheight[$row.'-'.$maxpage];\n // set the \"pointer\" to the left margin\n $l = $this->lMargin;\n // set the $currpage to the last page\n $currpage = $maxpage;\n }\n // draw the borders\n // we start adding a horizontal line on the last page\n $this->page = $maxpage;\n $this->Line($l,$h,$fullwidth+$l,$h);\n // now we start at the top of the document and walk down\n for($i = $startpage; $i <= $maxpage; $i++) {\n $this->page = $i;\n $l = $this->lMargin;\n $t = ($i == $startpage) ? $startheight : $this->tMargin+140;\n $lh = ($i == $maxpage) ? $h : $this->h-$this->bMargin;\n $this->Line($l,$t,$l,$lh);\n foreach($this->tablewidths AS $width) {\n $l += $width;\n $this->Line($l,$t,$l,$lh);\n }\n }\n // set it to the last page, if not it'll cause some problems\n $this->page = $maxpage;\n}", "function bp_videossubnav_tab_action() {\n\t\techo $this->get_instance( \\MyVideoRoomExtrasParking\\Library\\SectionTemplates::class )->control_panel_store_video();\n\t}", "public function actionRenderTab() {\n\n if (isset($_GET['name']) && isset($_GET['type'])) {\n $model = $this->loadModel();\n $this->renderPartial('/project/' . $_GET['type'] . 'Wrapper',\n array('model' => $model,\n 'render' => $_GET['name'],\n 'tab_fk' => $_GET['tab_fk']));\n } elseif (isset($_GET['ajaxPanel']) && $_GET['ajaxPanel']) {\n if (!isset($_GET['ajax'])) {\n echo CJSON::encode(array('status' => 't',\n 'response' => $this->renderPartial('/project/ajaxInterface', array('params' => $_GET), true, true)));\n } elseif (isset($_GET['ajax'])) {\n echo $this->renderPartial('/project/ajaxInterface', array('params' => $_GET), true, true);\n }\n Yii::app()->end();\n } else {\n echo CJSON::encode(array('status' => 'f',\n 'response' => 'There was a problem rendering this panel.'));\n Yii::app()->end();\n }\n }", "function tabCom()\n{\n $adminManager = new AdminManager();\n \n $comments = $adminManager->getCom();\n\n require('vue/admin/gestCom.php');\n}", "function media_upload_tabs()\n {\n }", "function TablaComprasProveedor()\n {\t\t \n\t\n\t$tra = new Login();\n $reg = $tra->BuscarComprasReportes();\n\t\n\t//Logo\n $this->Image(\"./assets/img/logo.png\" , 35 ,12, 80 , 25 , \"PNG\"); \n //Arial bold 15\n $this->SetFont('Courier','B',18);\n //Movernos a la derecha\n $this->Cell(130);\n //Título\n $this->Cell(180,10,'LISTADO DE COMPRAS POR PROVEEDOR',0,0,'C');\n $this->Ln();\n $this->Cell(130);\n $this->Cell(180,10,'PROVEEDOR '.utf8_decode($reg[0][\"nomproveedor\"]),0,0,'C');\n $this->Ln(20);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'CÉDULA GERENTE :',0,0,'');\n\t$this->CellFitSpace(95,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->CellFitSpace(42,5,'NOMBRE GERENTE :',0,0,'');\n\t$this->CellFitSpace(120,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'TELÉFONO GERENTE :',0,0,'');\n $this->CellFitSpace(95,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->CellFitSpace(42,5,'CORREO GERENTE :',0,0,'');\n $this->CellFitSpace(120,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(10,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(40,8,'CÓDIGO COMPRA',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'STATUS COMPRA',1,0,'C', True);\n\t$this->CellFitSpace(40,8,'FECHA COMPRA',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'ARTICULOS',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'SUBTOTAL CON IVA',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'SUBTOTAL IVA 0%',1,0,'C', True);\n\t$this->CellFitSpace(20,8,'IVA',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'TOTAL IVA',1,0,'C', True);\n\t$this->CellFitSpace(20,8,'DESCUENTO',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'TOTAL DESC',1,0,'C', True);\n\t$this->CellFitSpace(35,8,'TOTAL PAGO',1,1,'C', True);\n\t\n\t$totalarticulos=0;\n\t$Subtotalconiva=0;\n\t$Subtotalsiniva=0;\n\t$Totaliva=0;\n\t$Totaldescuento=0;\n\t$pagoDescuento=0;\n\t$Pagototal=0;\n\t$a=1;\n\t\n for($i=0;$i<sizeof($reg);$i++){\n\t\n $totalarticulos+=$reg[$i]['articulos'];\n $Subtotalconiva+=$reg[$i]['subtotalivasic'];\n $Subtotalsiniva+=$reg[$i]['subtotalivanoc'];\n\t$Totaliva+=$reg[$i]['totalivac']; \n\t$Totaldescuento+=$reg[$i]['totaldescuentoc']; \n\t$Pagototal+=$reg[$i]['totalc']; \n\t\n\t//$dias = ( $reg[$i]['fechavencecredito'] == '0000-00-00' ? \"0\" : Dias_Transcurridos($reg[$i]['fechavencecredito'],date(\"Y-m-d\")));\n\t\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(10,5,$a++,1,0,'C');\n\t$this->CellFitSpace(40,5,$reg[$i][\"codcompra\"],1,0,'C');\n\t\n\tif($reg[$i]['fechavencecredito']== '0000-00-00') { \n\t$this->CellFitSpace(30, 5,utf8_decode($reg[$i]['statuscompra']),1,0,'C');\n\t} elseif($reg[$i]['fechavencecredito'] >= date(\"Y-m-d\")) { \n\t$this->CellFitSpace(30, 5,utf8_decode($reg[$i]['statuscompra']),1,0,'C');\n\t} elseif($reg[$i]['fechavencecredito'] < date(\"Y-m-d\")) { \n\t$this->CellFitSpace(30, 5,utf8_decode(\"VENCIDA\"),1,0,'C');\n\t}\n\t$this->CellFitSpace(40,5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($reg[$i]['fechacompra']))),1,0,'C');\n\t$this->CellFitSpace(25,5,utf8_decode($reg[$i][\"articulos\"]),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['subtotalivasic'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['subtotalivanoc'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(20,5,utf8_decode(number_format($reg[$i]['ivac'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(25,5,utf8_decode(number_format($reg[$i]['totalivac'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(20,5,utf8_decode(number_format($reg[$i]['descuentoc'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(25,5,utf8_decode(number_format($reg[$i]['totaldescuentoc'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(35,5,utf8_decode(number_format($reg[$i]['totalc'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(10,5,'',0,0,'C');\n $this->Cell(40,5,'',0,0,'C');\t\n $this->Cell(30,5,'',0,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(40,5,'TOTAL GENERAL',1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n\t$this->Cell(25,5,utf8_decode($totalarticulos),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Subtotalconiva, 2, '.', ',')),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Subtotalsiniva, 2, '.', ',')),1,0,'C');\n $this->Cell(20,5,\"\",1,0,'C');\n $this->Cell(25,5,utf8_decode(number_format($Totaliva, 2, '.', ',')),1,0,'C');\n $this->Cell(20,5,\"\",1,0,'C');\n $this->Cell(25,5,utf8_decode(number_format($Totaldescuento, 2, '.', ',')),1,0,'C');\n $this->Cell(35,5,utf8_decode(number_format($Pagototal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n \n $this->Ln(12); \n $this->SetFont('courier','B',9);\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]),0,0,'');\n $this->Cell(80,6,'RECIBIDO:__________________________________',0,0,'');\n $this->Ln();\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'FECHA/HORA ELABORACIÓN: '.date('d-m-Y h:i:s A'),0,0,'');\n $this->Cell(80,6,'',0,0,'');\n $this->Ln(4);\n\t\n }", "function siteorigin_panels_add_help_tab_content(){\n\tinclude 'tpl/help.php';\n}", "function tab_user_outline($course, $user, $mod, $tab) {\n global $DB;\n\n if ($logs = $DB->get_records('log', array('userid' => $user->id, 'module' => 'tab',\n 'action' => 'view', 'info' => $tab->id . ' - ' . $tab->name), 'time ASC')) {\n\n $numviews = count($logs);\n $lastlog = array_pop($logs);\n\n $result = new stdClass();\n $result->info = get_string('numviews', '', $numviews);\n $result->time = $lastlog->time;\n\n return $result;\n }\n return NULL;\n}", "function _updateDraw()\r\n\t{\r\n\t\t$ut = $this->_ut;\r\n\t\t$dt = $this->_dt;\r\n\r\n\t\t// Get the informations\r\n\t\t$infos = array('draw_id' => kform::getInput(\"drawId\"),\r\n\t\t \t\t'draw_name' => kform::getInput(\"drawName\"),\r\n\t\t \t\t'draw_serial'=> kform::getInput(\"drawSerial\"),\r\n\t\t \t\t'draw_stamp' => kform::getInput(\"drawStamp\"),\r\n 'draw_type' => kform::getInput(\"drawType\"),\r\n 'draw_catage'=> kform::getInput(\"drawCatage\"),\r\n 'draw_numcatage'=> kform::getInput(\"drawNumcatage\"),\n \t\t\t\t'draw_rankdefId' => kform::getInput(\"drawRank\"),\r\n 'draw_disci' => kform::getInput(\"drawDisci\"),\r\n\t\t);\r\n\r\n\t\t// Control the informations\r\n\t\tif ($infos['draw_name'] == \"\")\r\n\t\t{\r\n\t\t\t$infos['errMsg'] = 'draw_name';\r\n\t\t\t$this->_displayFormEditDraw($infos);\r\n\t\t}\n\r\n\t\t// Mise a jour de la definition du tabldeau\r\n\t\t$res = $dt->updateDraw($infos);\r\n\t\tif (is_array($res))\r\n\t\t{\r\n\t\t\t$infos['errMsg'] = $res['errMsg'];\r\n\t\t\t$this->_displayFormEditDraw($infos);\r\n\t\t}\r\n\t\t$page = new utPage('none');\r\n\t\t$page->close();\r\n\t\texit();\r\n\t}", "function MakeTab($docID, $recID, $PageNumber, $X=null, $Y=null, $Type, $Name=null, $TabLabel=null, $Value=null,$AnchorTabString=null, $AnchorXOffset=null, $AnchorYOffset=null){\n\t$tab = new Tab();\n\t$tab->DocumentID = $docID;\n\t$tab->RecipientID = $recID;\n\t$tab->PageNumber = $PageNumber;\n\tif(isset($X)){\n\t\t$tab->XPosition = $X;\n\t}\n\tif(isset($Y)){\n\t\t$tab->YPosition = $Y;\n\t}\n\t$tab->Type = $Type;\n\tif(isset($Name)){\n\t\t$tab->Name = $Name;\n\t}\n\tif(isset($TabLabel)){\n\t\t$tab->TabLabel = $TabLabel;\n\t}\n\tif(isset($Value)){\n\t\t$tab->Value = $Value;\n\t}\n\tif(isset($AnchorTabString)){\n\t\t$tab->AnchorTabItem->AnchorTabString = $AnchorTabString;\n\t}\n\tif(isset($AnchorXOffset)){\n\t\t$tab->AnchorTabItem->XOffset = $AnchorXOffset;\n\t}\n\tif(isset($AnchorYOffset)){\n\t\t$tab->AnchorTabItem->YOffset = $AnchorYOffset;\n\t}\n\treturn $tab;\n}", "function tab_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload) {\n global $CFG, $DB;\n\n //The following code is for security\n require_course_login($course, true, $cm);\n\n if ($context->contextlevel != CONTEXT_MODULE) {\n return false;\n }\n\n $fileareas = array('mod_tab', 'content');\n if (!in_array($filearea, $fileareas)) {\n return false;\n }\n //id of the content row\n $tabcontentid = (int)array_shift($args);\n\n //Security - Check if exists\n if (!$tabcontent = $DB->get_record('tab_content', array('id' => $tabcontentid))) {\n return false;\n }\n\n if (!$tab = $DB->get_record('tab', array('id' => $cm->instance))) {\n return false;\n }\n\n //Now gather file information\n $fs = get_file_storage();\n $relativepath = implode('/', $args);\n $fullpath = \"/$context->id/mod_tab/$filearea/$tabcontentid/$relativepath\";\n\n if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) {\n return false;\n }\n\n // finally send the file\n send_stored_file($file, 0, 0, $forcedownload);\n}", "function create(){\n // cls_hermes_plugin::cls_hermes_plugin($options); \nglobal $xoopsModuleConfig, $xoopsDB;\n\n //------------------------------------------- \n $decomodele = $this->name;\n $sql = \"('{$decomodele}', 'content','multiline',0,01,'12',''),\n ('{$decomodele}', 'type','list',0,02,'|css|html|text','');\";\n\n \n //--------------------------------------------------\n cls_decoration:: createModele($decomodele, $sql);\n //-------------------------------------------------- \n\n\n}", "protected function _addTab(\n TDProject_Core_Interfaces_Block_Widget_Tab $tab) {\n \t$this->addBlock($tab);\n \treturn $tab;\n }", "private function screenNavigationTabs($tab)\n {\n $url = 'options-general.php?page=plugin_wordpress.php';\n echo '<p>';\n if (empty($tab)) $tab = 'general';\n echo '<a href=\"' . admin_url($url . '&tab=general') . '\"' . ($tab == 'general' ? ' style=\"font-weight: bold; text-decoration:none;\"' : '') . '>' . 'General Settings' . '</a> | ';\n echo '<a href=\"' . admin_url($url . '&tab=set_schedule') . '\"' . ($tab == 'set_schedule' ? ' style=\"font-weight: bold; text-decoration:none;\"' : '') . '>' . 'Set Schedule' . '</a> | ';\n echo '<a href=\"' . admin_url($url . '&tab=save_database') . '\"' . ($tab == 'save_database' ? ' style=\"font-weight: bold; text-decoration:none;\"' : '') . '>' . 'Save Database' . '</a> | ';\n echo '</p><hr/>';\n }", "function cs_pb_tabs($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$tabs_element_size = '50';\n\t\t$tab_title = '';\n\t\t$tab_text = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$tabs_element_size = $cs_node->tabs_element_size;\n\t\t\t$tab_title = $cs_node->tab_title;\n\t\t\t$tab_text = $cs_node->tab_text;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $tabs_element_size?>\" item=\"tabs\" data=\"<?php echo element_size_data_array_index($tabs_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"tabs_element_size[]\" class=\"item\" value=\"<?php echo $tabs_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Tabs Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n\t\t\t\t<div class=\"wrapptabbox\">\n <div class=\"clone_append\">\n <?php\n\t\t\t\t\t\t$tabs_num = 0;\n if ( isset($cs_node) ){\n\t\t\t\t\t\t\t$tabs_num = count($cs_node->tab);\n foreach ( $cs_node->tab as $tab ){\n\t\t\t\t\t\t\t\tif ( $tab->tab_active == \"yes\" ) { $tab_active = \"selected\"; }\n\t\t\t\t\t\t\t\telse { $tab_active = \"\"; }\n\t\t\t\t\t\t\t\techo \"<div class='clone_form'>\";\n\t\t\t\t\t\t\t\t\techo \"<a href='#' class='deleteit_node'>Delete it</a>\";\n\t\t\t\t\t\t\t\t\techo '<label>Tab Title:</label> <input class=\"txtfield\" type=\"text\" name=\"tab_title[]\" value=\"'.$tab->tab_title.'\" />';\n\t\t\t\t\t\t\t\t\techo '<label>Tab Text:</label> <textarea class=\"txtfield\" name=\"tab_text[]\">'.$tab->tab_text.'</textarea>';\n\t\t\t\t\t\t\t\t\techo '<label>Title Icon:</label> <input class=\"txtfield\" type=\"text\" name=\"tab_title_icon[]\" value=\"'.$tab->tab_title_icon.'\" />';\n\t\t\t\t\t\t\t\t\techo '<label>Active:</label> <select name=\"tab_active[]\"><option>no</option><option '.$tab_active.'>yes</option></select> ';\n\t\t\t\t\t\t\t\techo \"</div>\";\n }\n }\n ?>\n </div>\n <div class=\"opt-conts\">\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label></label></li>\n <li class=\"to-field\"><a href=\"#\" class=\"addedtab\">Add Tab</a></li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n <input type=\"hidden\" name=\"tabs_num[]\" value=\"<?php echo $tabs_num?>\" class=\"fieldCounter\" />\n <input type=\"hidden\" name=\"cs_orderby[]\" value=\"tabs\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n \t</div>\n \n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "function TablaVentasCajas()\n {\n $ca = new Login(); \n\t$ca = $ca->CajerosPorId();\t\n\t\n\t//Logo\n $this->Image(\"./assets/img/logo.png\" , 20 ,12, 60 , 20 , \"PNG\");\n\t$this->SetXY(10, 15);\n\t$this->SetFont('courier','B',18);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(120,8,'',0,0,'');\n\t$this->Cell(180,8,'LISTADO DE VENTAS DESDE '.$_GET[\"desde\"].' HASTA '.$_GET[\"hasta\"],0,1,'C');\n \n\t$this->Cell(150,8,'',0,0,'');\n $this->Cell(120,8,'Y CAJA N°.'.$ca[0]['nrocaja'],0,0,'C');\n //Salto de línea\n $this->Ln(15);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'CÉDULA GERENTE :',0,0,'');\n\t$this->CellFitSpace(95,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->CellFitSpace(42,5,'NOMBRE GERENTE :',0,0,'');\n\t$this->CellFitSpace(120,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(30,5,'',0,0,'');\n\t$this->CellFitSpace(42,5,'TELÉFONO GERENTE :',0,0,'');\n $this->CellFitSpace(95,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->CellFitSpace(42,5,'CORREO GERENTE :',0,0,'');\n $this->CellFitSpace(120,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(10,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'CÓDIGO VENTA',1,0,'C', True);\n\t$this->CellFitSpace(70,8,'CLIENTES',1,0,'C', True);\n\t$this->CellFitSpace(17,8,'STATUS',1,0,'C', True);\n\t$this->CellFitSpace(35,8,'FECHA VENTA',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'ARTIC',1,0,'C', True);\n\t$this->CellFitSpace(28,8,'SUBTOT CON IVA',1,0,'C', True);\n\t$this->CellFitSpace(28,8,'SUBTOT IVA 0%',1,0,'C', True);\n\t$this->CellFitSpace(12,8,'IVA',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'TOTAL IVA',1,0,'C', True);\n\t$this->CellFitSpace(12,8,'DESC',1,0,'C', True);\n\t$this->CellFitSpace(20,8,'TOT DESC',1,0,'C', True);\n\t$this->CellFitSpace(30,8,'TOTAL PAGO',1,1,'C', True);\n\t\n $tra = new Login();\n $reg = $tra->BuscarVentasCajas();\n\t$totalarticulos=0;\n\t$Subtotalconiva=0;\n\t$Subtotalsiniva=0;\n\t$Totaliva=0;\n\t$Totaldescuento=0;\n\t$pagoDescuento=0;\n\t$Pagototal=0;\n\t$a=1;\n\t\n for($i=0;$i<sizeof($reg);$i++){\n\t\n $totalarticulos+=$reg[$i]['articulos'];\n $Subtotalconiva+=$reg[$i]['subtotalivasive'];\n $Subtotalsiniva+=$reg[$i]['subtotalivanove'];\n\t$Totaliva+=$reg[$i]['totalivave']; \n\t$Totaldescuento+=$reg[$i]['totaldescuentove']; \n\t$Pagototal+=$reg[$i]['totalpago']; \n\t\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(10,5,$a++,1,0,'C');\n\t$this->CellFitSpace(32,5,$reg[$i][\"codventa\"],1,0,'C');\n\t$this->CellFitSpace(70,5,utf8_decode($reg[$i][\"nomcliente\"]),1,0,'C');\n\tif($reg[$i]['fechavencecredito']== '0000-00-00') { \n\t$this->CellFitSpace(17, 5,utf8_decode($reg[$i]['statusventa']),1,0,'C');\n\t} elseif($reg[$i]['fechavencecredito'] >= date(\"Y-m-d\")) { \n\t$this->CellFitSpace(17, 5,utf8_decode($reg[$i]['statusventa']),1,0,'C');\n\t} elseif($reg[$i]['fechavencecredito'] < date(\"Y-m-d\")) { \n\t$this->CellFitSpace(17, 5,utf8_decode(\"VENCIDA\"),1,0,'C');\n\t}\n\t$this->CellFitSpace(35,5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($reg[$i]['fechaventa']))),1,0,'C');\n\t$this->CellFitSpace(15,5,utf8_decode($reg[$i][\"articulos\"]),1,0,'C');\n\t$this->CellFitSpace(28,5,utf8_decode(number_format($reg[$i]['subtotalivasive'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(28,5,utf8_decode(number_format($reg[$i]['subtotalivanove'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(12,5,utf8_decode(number_format($reg[$i]['ivave'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totalivave'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(12,5,utf8_decode(number_format($reg[$i]['descuentove'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(20,5,utf8_decode(number_format($reg[$i]['totaldescuentove'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(30,5,utf8_decode(number_format($reg[$i]['totalpago'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(10,5,'',0,0,'C');\n $this->Cell(32,5,'',0,0,'C');\t\t\n $this->Cell(70,5,'',0,0,'C');\t\t\n $this->Cell(17,5,'',0,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n\n $this->Cell(35,5,'TOTAL GENERAL',1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n\t$this->Cell(15,5,utf8_decode($totalarticulos),1,0,'C');\n $this->Cell(28,5,utf8_decode(number_format($Subtotalconiva, 2, '.', ',')),1,0,'C');\n $this->Cell(28,5,utf8_decode(number_format($Subtotalsiniva, 2, '.', ',')),1,0,'C');\n $this->Cell(12,5,\"\",1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($Totaliva, 2, '.', ',')),1,0,'C');\n $this->Cell(12,5,\"\",1,0,'C');\n $this->Cell(20,5,utf8_decode(number_format($Totaldescuento, 2, '.', ',')),1,0,'C');\n $this->Cell(30,5,utf8_decode(number_format($Pagototal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n \n $this->Ln(12); \n $this->SetFont('courier','B',9);\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]),0,0,'');\n $this->Cell(80,6,'RECIBIDO:__________________________________',0,0,'');\n $this->Ln();\n $this->Cell(40,6,'',0,0,'');\n $this->Cell(140,6,'FECHA/HORA ELABORACIÓN: '.date('d-m-Y h:i:s A'),0,0,'');\n $this->Cell(80,6,'',0,0,'');\n $this->Ln(4);\n }", "function & _displayHeadDraw($draw, $select, $act)\r\n\t{\r\n\t\t$utd =& $this->_utd;\r\n\t\t$dt =& $this->_dt;\r\n\t\t$ut =& $this->_utd;\r\n\t\t$utr = new utround();\n\r\n\t\t// Creation de la page\r\n\t\t$this->_utpage = new utPage_A('draws', true, 'itDraws');\r\n\t\t$content =& $this->_utpage->getContentDiv();\r\n\t\t$drawId = $draw['draw_id'];\r\n\n\t\t// Bouton d'ajout\n\t\t$form =& $content->addForm('formPlus');\n\t\t$form->addBtn('btnNewDraw', KAF_NEWWIN, 'draws', DRAW_SERIAL_NEW, 0, 500, 250);\n\t\t$form->addBtn('itDeleteDraw', KAF_NEWWIN, 'draws', KID_CONFIRM, $drawId, 350, 150);\r\n\t\t$form->addBtn('btnAllDraws', KAF_UPLOAD, 'draws', DRAW_LIST);\n\n\t\t// Liste des tableaux\r\n\t\t$sort = array(5,4);\r\n\t\t$draws = $utd->getDraws($sort);\r\n\t\tforeach($draws as $theDraw)\r\n\t\t$list[$theDraw['draw_id']] = $theDraw['draw_name'];\r\n\t\t$kcombo=& $form->addCombo('selectList', $list, $list[$drawId]);\r\n\t\t$acts[1] = array(KAF_UPLOAD, 'draws', $act);\r\n\t\t$kcombo->setActions($acts);\n\n\t\t// Liste des groupes du tableau\n\t\t$oGroup = new objgroup();\n\t\t$groups = $oGroup->getListGroups($drawId);\n\t\t$utr = new utround();\n\t\t$list = array();\n\t\t$groupname = empty($draw['groupname'])?'':$draw['groupname'];\n\t\tforeach($groups as $group)\n\t\t{\n\t\t\t$url = urlencode($drawId . ';' . $group);\n\t\t\t$list[$url] = $group;\n\t\t\tif (empty($groupname)) $groupname = $group;\n\t\t}\n\t\tif (count($list) > 1)\n\t\t{\n\t\t\t$kcombo=& $form->addCombo('roundList', $list, urlencode($drawId . ';' . $groupname));\n\t\t\t$acts[1] = array(KAF_UPLOAD, 'draws', DRAW_GROUPS_DISPLAY);\n\t\t\t$kcombo->setActions($acts);\n\t\t}\n\n\t\t// Lien de redirection vers tous les tableaux\n\t\t$form->addBtn('itNewPlayer', KAF_NEWWIN, 'regi', REGI_SEARCH, 0, 650, 450);\n\t\tif($draw['draw_discipline'] == WBS_SINGLE) $form->addBtn('itPlayers', KAF_UPLOAD, 'draws',\tDRAW_DISPLAY, $drawId);\n\t\telse $form->addBtn('itPairs', KAF_UPLOAD, 'draws',\tDRAW_DISPLAY, $drawId);\n\t\t$isSquash = $this->_ut->getParam('issquash', false);\n\t\tif($isSquash) $form->addBtn('itClasse', KAF_NEWWIN, 'live', LIVE_CLASSE, 0, 500, 400);\n\t\telse $form->addBtn('itPalma', KAF_NEWWIN, 'live', LIVE_PALMARES, 0, 500, 400);\n\r\n\t\t// Menu de gestion des groupes\r\n\t\t$itemSel = $select;\n\t\t//$items['itDefinition'] = array(KAF_UPLOAD, 'draws', DRAW_DEFINITION, $drawId);\n\t\t$items['itNewGroup'] = array(KAF_NEWWIN, 'draws', DRAW_GROUP_NEW, $drawId, 350, 460);\n\t\t$rounds = $utr->getRounds($drawId, null, null, $groupname);\n\t\tif(count($rounds))\n\t\t{\n\t\t\t$items['itDeleteGroup'] = array(KAF_NEWWIN, 'draws', DRAW_GROUP_CONFIRM, urlencode($drawId .';' . $groupname), 300, 100);\n\t\t\t$items['itModifGroup'] = array(KAF_NEWWIN, 'draws', DRAW_GROUP_EDIT, urlencode($drawId. ';' . $groupname));\n\t\t}\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_GROUP, null, $groupname);\n\t\tif (!empty($rounds) )\n\t\t{\n\t\t\t$items['itGroup'] = array(KAF_UPLOAD, 'draws', DRAW_GROUPS_DISPLAY, urlencode($drawId. ';' . $groupname));\n\t\t}\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_MAINDRAW, null, $groupname);\n\t\tif ( !empty($rounds) )\n\t\t{\n\t\t\t$items['itMainDraw'] = array(KAF_UPLOAD, 'draws', DRAW_KO_DISPLAY, $rounds[0]['rund_id']);\n\t\t}\n\t\t$items['itCalendar'] = array(KAF_UPLOAD,'draws', DRAW_CALENDAR, $drawId);\n\r\n\t\t$kdiv =& $content->addDiv('choix', 'onglet3');\r\n\t\t$kdiv->addMenu(\"menuDiv\", $items, $itemSel);\r\n\t\t$kdiv =& $content->addDiv('contDiv', 'cont3');\r\n\r\n\t\treturn $kdiv;\r\n\t}", "function modChrome_zero_horz($module, &$params, &$attribs)\r\n{\r\nif (!empty ($module->content)) :\r\n?>\r\n <table cellspacing=\"1\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td>\r\n <?php modChrome_zero_table($module, $params, $attribs); ?>\r\n </td>\r\n </tr>\r\n </table>\r\n <?php endif;\r\n}", "function offcanvas_active_tab() {\n?>\n\n<script>\n\t\n\tjQuery('.menu-icon, #list-link').click( function() {\n\t\tjQuery('#off-canvas').foundation('open');\n\t});\n\t\n\tjQuery('.search-icon').click( function() {\n\t\tjQuery('#off-canvas').foundation('open');\n\t\tjQuery('#list-tab, #list').removeClass('is-active');\n\t\tjQuery('#list-tab > a').attr('aria-selected', 'false');\n\t\tjQuery('#search-tab, #search').addClass('is-active');\n\t\tjQuery('#search-tab > a').attr('aria-selected', 'true');\n\t});\n\t\n\tjQuery('#cat-link').click( function() {\n\t\tjQuery('#off-canvas').foundation('open');\n\t\tjQuery('#list-tab, #list').removeClass('is-active');\n\t\tjQuery('#list-tab > a').attr('aria-selected', 'false');\n\t\tjQuery('#categories-tab, #categories').addClass('is-active');\n\t\tjQuery('#categories-tab > a').attr('aria-selected', 'true');\n\t});\n\t\n\tjQuery('.offcanvas-full-screen-close').click( function() {\n\t\tjQuery('#search-tab, #search, #categories-tab, #categories').delay( 500 ).removeClass('is-active');\n\t\tjQuery('#search-tab > a, #categories-tab > a').delay( 500 ).attr('aria-selected', 'false');\n\t\tjQuery('#list-tab, #list').delay( 500 ).addClass('is-active');\n\t\tjQuery('#list-tab > a').delay( 500 ).attr('aria-selected', 'true');\n\t});\n\n</script>\n\n\n<?php\n}", "function email_print_tabs_options($courseid, $folderid, $action=NULL) {\n\n \tglobal $CFG;\n\n \tif ($courseid == SITEID) {\n $context = get_context_instance(CONTEXT_SYSTEM, SITEID); // SYSTEM context\n } else {\n $context = get_context_instance(CONTEXT_COURSE, $courseid); // Course context\n }\n\n \t// Declare tab array\n \t$tabrow = array();\n\n \t// Tab for writting new email\n \tif ( has_capability('block/email_list:sendmessage', $context)) {\n\t\t$tabrow[] = new email_tabobject('newmail', $CFG->wwwroot.'/blocks/email_list/email/sendmail.php?course='.$courseid.'&amp;folderid='.$folderid, get_string('newmail', 'block_email_list'), '<img alt=\"'.get_string('edit').'\" width=\"15\" height=\"13\" src=\"'. $CFG->pixpath .'/i/edit.gif\" />' );\n \t}\n\n \tif ( has_capability('block/email_list:createfolder', $context)) {\n\t\t$tabrow[] = new email_tabobject('newfolderform', $CFG->wwwroot.'/blocks/email_list/email/folder.php?course='.$courseid.'&amp;folderid='.$folderid, get_string('newfolderform', 'block_email_list'), '<img alt=\"'.get_string('edit').'\" width=\"15\" height=\"15\" src=\"'. $CFG->wwwroot .'/blocks/email_list/email/images/folder_add.png\" />' );\n \t}\n\n\t/// FUTURE: Implement filters\n\t//$tabrow[] = new tabobject('newfilter', $CFG->wwwroot.'/blocks/email_list/email/view.php?'.$url .'&amp;action=\\'newfilter\\'', get_string('newfilter', 'email') );\n\n\t// If empty tabrow, add vspace. Only apply on Site Course.\n\tif (empty($tabrow) ) {\n\t\tprint_spacer(50, 1);\n\t}\n\n\t$tabrows = array($tabrow);\n\n\t// Print tabs, and if it's in case, selected this\n\tswitch($action)\n\t{\n\t\tcase 'newmail':\n\t\t\t \tprint_email_tabs($tabrows, 'newmail');\n\t\t\tbreak;\n\t case 'newfolderform':\n\t\t\t \tprint_email_tabs($tabrows, 'newfolderform');\n\t\t\tbreak;\n\t\tcase 'newfilter':\n\t\t\t print_email_tabs($tabrows, 'filter');\n\t\t\tbreak;\n\t default:\n\t\t\t print_email_tabs($tabrows);\n\t}\n\n\treturn true;\n }", "function make_interface()\n{\n global $url_plugin;\n global $base_plugin;\n global $section;\n global $plugin;\n \n \n if(file_exists($base_plugin.'data/google_key.value'))\n {\n $key=file($base_plugin.'data/google_key.value');\n }\n $list='<div class=\"title\">GPS</div>\n <div class=\"title2\">Google key</div>\n <div class=\"plugin_content\">\n <input type=\"text\" value=\"'.trim($key[0]).'\" id=\"google_key\" name=\"google_key\">\n <input type=\"button\" class=\"bsave\" onclick=\"save_google_key(\\''.$section.'\\',\\''.$plugin.'\\',\\'output\\');\" value=\"Save\">\n </div>\n <div id=\"output\"></div>\n ';\n $list.='\n <div class=\"title2\">GPS NMEA Info</div>\n <div class=\"plugin_content\">';\n $list.='<button type=\"button\" id=\"NMEA_info\" onclick=\"show_nmea(\\''.$section.'\\',\\''.$plugin.'\\',\\'NMEA_info_output\\');\">Show NMEA data</button>';\n $list.=\"<div id='NMEA_info_output' class='nmea'></div>\";\n $list.=\"</div>\";\n $list.='<div class=\"title2\">Map geolocation</div>\n <div class=\"plugin_content\">';\n $list.='<button type=\"button\" id=\"GPS_map_info\" onclick=\"$(\\'#map\\').addClass(\\'map2\\');draw_center(\\''.$section.'\\',\\''.$plugin.'\\',\\'map\\');\">Show map</button>';\n \n $list.='<div id=\"map\" class=\"map\"></div></div>';\n //$list.='<script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAxn-X4TVGr_dB3O7qL3vTWBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQccHTstjr5hNv-96qkCEjZLlXVVg\" type=\"text/javascript\"></script>';\n $list.='<script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;key='.trim($key[0]).'\" type=\"text/javascript\"></script>';\n\treturn $list;\n}", "function training_menu_tabs($arg) {\n return t('This is the tab \"%arg\" in the \"basic tabs\" example', array('%arg' => $arg));\n}", "public function display_tablenav( $which ) \n{\n ?>\n <div class=\"tablenav <?php echo esc_attr( $which ); ?>\">\n\n <div class=\"alignleft actions\">\n <?php $this->bulk_actions(); ?>\n </div>\n <?php\n $this->extra_tablenav( $which );\n $this->pagination( $which );\n ?>\n <br class=\"clear\" />\n </div>\n <?php\n}" ]
[ "0.60516214", "0.5771939", "0.5499494", "0.54204106", "0.536496", "0.5340804", "0.5325748", "0.52133566", "0.5121222", "0.5110195", "0.51094055", "0.50951904", "0.50829667", "0.50597686", "0.50427544", "0.5019478", "0.49688765", "0.495233", "0.4933551", "0.4931426", "0.4921576", "0.4914437", "0.4913107", "0.488954", "0.4884644", "0.48782095", "0.48716104", "0.48620412", "0.48548296", "0.48403624", "0.4838115", "0.48336837", "0.4824926", "0.48196158", "0.48157337", "0.4796403", "0.47806954", "0.47776592", "0.47597516", "0.47594285", "0.47352538", "0.4733756", "0.47329476", "0.47319323", "0.47202963", "0.47177044", "0.47139102", "0.47090542", "0.47044775", "0.47028357", "0.4695989", "0.4688118", "0.4685155", "0.46808407", "0.46727327", "0.46690017", "0.46688533", "0.46669024", "0.46467876", "0.46437663", "0.46377185", "0.4635964", "0.46259797", "0.4617063", "0.46109584", "0.46095312", "0.46090817", "0.46061245", "0.46005082", "0.45965886", "0.45948136", "0.45920452", "0.4589856", "0.45878655", "0.45767626", "0.45706788", "0.4568185", "0.45628953", "0.45595643", "0.45503548", "0.45461756", "0.4545281", "0.4545107", "0.4545068", "0.45409107", "0.4530989", "0.45276836", "0.45237666", "0.45226508", "0.4521366", "0.45148823", "0.4514792", "0.45139617", "0.4510199", "0.45068145", "0.45060632", "0.450572", "0.4501016", "0.4498503", "0.4497989" ]
0.6692174
0
Returns the number of rows in the result set.
public function countRows(): int { $result = $this->_getResult()->numRows(); // Returns an integer on success and an \PEAR_Error object on failure return is_int($result) ? $result : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rowCount()\n {\n return sasql_num_rows($this->result);\n }", "function getNumRows() {\r\n\t\t\tif($this->privateVars['resultset']) {\r\n\t\t\t\tif(@mysql_num_rows($this->privateVars['resultset']))\r\n\t\t\t\t\treturn mysql_num_rows($this->privateVars['resultset']);\r\n\t\t\t}\r\n\t\t\treturn -1;\r\n\t\t}", "public function num_rows() {\n\t\treturn $this->GetNumRows();\n\t}", "public function numRows() : int\n\t{\n\t\treturn $this->handle->numRows($this->result);\n\t}", "public function getNumberOfRows()\r\n {\r\n return count($this->data);\r\n }", "public function getNumberOfRows() {\n return count($this->rows);\n }", "public function getNumRows() {\n\t\treturn $this->_num_rows;\n\t}", "public function GetNumberOfRows() {\n return $this->num_rows;\n }", "public function GetRowCount() : INT\r\n {\r\n return($this->preparedStatement->rowCount());\r\n }", "public function getNumRows(): int\n {\n if (is_int($this->numRows)) {\n return $this->numRows;\n }\n if ($this->resultArray !== []) {\n return $this->numRows = count($this->resultArray);\n }\n if ($this->resultObject !== []) {\n return $this->numRows = count($this->resultObject);\n }\n\n return $this->numRows = count($this->getResultArray());\n }", "public function rowCount()\n {\n return oci_num_rows($this->sth);\n }", "function NumRows() {\n\t\t\t$result = pg_num_rows($this->result);\n\t\t\treturn $result;\n\t\t}", "public function countRows()\n {\n return $this->_result !== null ? $this->_result->rowCount() : 0;\n }", "public function getRowCount()\n {\n return $this->row_count;\n }", "public function getRowCount()\n {\n return $this->row_count;\n }", "public function getRowCount()\n {\n return $this->row_count;\n }", "public function count()\n\t{\n\t\treturn (int) $this->getStatement()->rowCount();\n\t}", "public function num_rows() {\n\t\t\treturn $this->count();\n\t\t}", "public function getNumRows() {\n\t\t$this->_numRows = mysqli_num_rows($this->_result);\n\t\treturn $this->_numRows;\n\t}", "public function getRowsCount()\n {\n if ($this->num_rows === 0 && count($this->resultArray()) > 0) {\n $this->num_rows = count($this->resultArray());\n @oci_execute($this->stmt_id, OCI_DEFAULT);\n\n if ($this->curs_id) {\n @oci_execute($this->curs_id, OCI_DEFAULT);\n }\n }\n\n return $this->num_rows;\n }", "public function countRows()\n {\n return count($this->rows);\n }", "public function get_rows_count()\n\t{\n\t\treturn count($this->get_rows());\n\t}", "public function count()\n {\n return count($this->_rows);\n }", "public function count() {\n return count($this->__rows__);\n }", "public function getNumberOfRows();", "public function count() {\n return $this->row_count();\n }", "public function getRowCount() {\n\t\treturn $this->ROW_COUNT;\n\t}", "public function getNumRows()\n {\n \treturn $this->previouslyExecuted->num_rows;\n }", "function numrows() {\r\n\t\treturn $this->numrows;\r\n\t}", "public function count_rows()\n {\n $m_num_rows = $this->c_obj_stmt->rowCount();\n return $m_num_rows;\n }", "function numRows()\n {\n $this->getRows();\n return $this->row_counter;\n }", "public function getRowCount()\n {\n return $this->statement->rowCount();\n }", "public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}", "public function getRowCount() {\n return $this->statement->rowCount();\n }", "function getNumRows() {\r\n return mysql_num_rows($this->m_Result);\r\n }", "public function rowCount() {\n\t\tif( !$this->_result ) return 0;\n\t\treturn mssql_num_rows($this->_result);\n\t}", "public abstract function row_count();", "public function count()\n\t{\n\t\treturn $this->query->rowCount();\n\t}", "function nbrRows() {\n return mysqli_num_rows($this->result);\n }", "public function numRows() {\n\t\treturn $this->sth->rowCount();\n\t}", "public function num_rows()\r\n {\r\n return $this->num_rows;\r\n }", "public function getRowCount(): int\n {\n return $this->rowCount;\n }", "function RowCount() {}", "public function numRows() {\n\t\t$val = $this->numResults;\n\t\t$this->numResults = array();\n\t\treturn $val;\n\t}", "function num_rows() {\r\n\t\treturn $this->dbh->num_rows();\r\n\t}", "public function num_rows()\n\t{\n\t\tif ( ! is_int($this->num_rows))\n\t\t{\n\t\t\tif (count($this->result_array) > 0)\n\t\t\t{\n\t\t\t\treturn $this->num_rows = count($this->result_array);\n\t\t\t}\n\t\t\telseif (count($this->result_object) > 0)\n\t\t\t{\n\t\t\t\treturn $this->num_rows = count($this->result_array);\n\t\t\t}\n\n\t\t\treturn $this->num_rows = count($this->result_array());\n\t\t}\n\n\t\treturn $this->num_rows;\n\t}", "function get_row_count() {\n return $this->row_count;\n }", "public function get_row_count() {\n return 0;\n }", "public function count(): int\n {\n return $this->statement->rowCount();\n }", "public function count(): int\n {\n if ($this->numberOfRows === null) {\n if (is_array($this->rows)) {\n $this->numberOfRows = count($this->rows);\n } else {\n $this->numberOfRows = $this->query->count();\n }\n }\n return $this->numberOfRows;\n }", "public function getNumRows();", "public function count()\n {\n return $this->rows;\n }", "function RecordCount() {\r\n return $this->result->numRows();\r\n }", "public function num_rows()\n\t{\n\t\tif ($this->sqlResource)\n\t\t{\n\t\t\treturn (mysql_num_rows($this->sqlResource));\n\t\t}\n\t}", "public function getNumberOfRecords() {\r\n\t\treturn mysqli_num_rows($this->result);\r\n\t}", "function count()\n{\n\tif (!$this->getSql()) return 0;\n\t$rows = $this->getClone()->select('count(*) as n');\n\treturn (int)$rows[0]['n'];\n}", "public function numRows() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\treturn mysql_num_rows($this->result);\r\n\t}", "public function rows(): int\n {\n return $this->rows;\n }", "function getNRows() \n { \n if($this->rsQry)\n {\n return true;\n }\n else\n {\n\t\t\t return mysql_num_rows($this->rsQry);\n }\n\t\t}", "public function getRowCount() {\n return $this->Read->rowCount();\n }", "public function num_rows() {\n if($this->result) {\n $num = mysqli_num_rows ($this->result);\n }else {\n $num = 0;\n }\n return $num;\n }", "function get_count()\n\t{\n\t\treturn $this->__num_rows;\n\t}", "function num_rows()\n\t{\n\t\t$num_rows=0;\n\t\treturn !$num_rows = sqlsrv_num_rows($this->result_id) ? 0 : $num_rows;\n\t}", "public function rowCount()\n {\n return $this->exec()->rowCount();\n }", "public function getRowsCount()\n {\n if (is_null($this->summaryRow)) {\n return count($this->rows);\n } else {\n return count($this->rows) + 1;\n }\n }", "public function numOfRows();", "function numRows()\n\t{\n\t\treturn $this->_num_rows;\n\t}", "public function num_rows()\n {\n if($this->result)\n {\n $num = mysqli_num_rows($this->result);\n }\n else\n {\n $num = 0;\n }\n return $num; \n }", "public function count_rows() {\r\n return $this->db->count_all_results($this->table_name);\r\n }", "public function number_of_rows()\n {\n if (is_bool($this->result))\n {\n return $this->mysqli->affected_rows;\n }\n else\n {\n return $this->result->num_rows;\n }\n }", "public function rowCount () {\n return $this->query->rowCount();\n }", "function NumRows() {\n\t\t\tif ($this->result) {\n\t\t\t\treturn mysql_num_rows($this->result);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n \t}", "public function getNumberOfRows() {\n\n $query = $this->db->prepare(\"SELECT COUNT(*) FROM `products`\");\n\n try {\n\n $query->execute();\n $rows = $query->fetchColumn();\n\n return $rows;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function getNumRows(){\n return $this->numrows;\n }", "public function count()\n {\n if (null === $this->count) {\n $this->count = count($this->resultSet);\n }\n return $this->count;\n }", "public function numberRows(): int\n {\n $number = 0;\n $dbResult = $this->query(\"SELECT FOUND_ROWS() AS number\");\n $data = $dbResult->fetch();\n if (isset($data[\"number\"])) {\n $number = $data[\"number\"];\n }\n return (int) $number;\n }", "public function num_rows()\n\t{\n\t\t$regex = '/^SELECT\\s+(?:ALL\\s+|DISTINCT\\s+)?(?:.*?)\\s+FROM\\s+(.*)$/i';\n\t\t$output = array();\n\n\t\tif (preg_match($regex, $this->last_query, $output) > 0)\n\t\t{\n\t\t\t$stmt = $this->query(\"SELECT COUNT(*) FROM {$output[1]}\");\n\t\t\treturn (int) $stmt->fetchColumn();\n\t\t}\n\n\t\treturn NULL;\n\t}", "function numRows()\n{\n\t$num = mysql_num_rows($this->res);\n\treturn $num;\n}", "public function getNumRows()\n\t {\n\t\tif (($this->_result instanceof mysqli_result) === false)\n\t\t {\n\t\t\treturn false;\n\t\t }\n\t\telse\n\t\t {\n\t\t\treturn $this->_result->num_rows;\n\t\t }\n\t }", "public function getFoundRows()\n\t{\n\t\treturn (int) $this->value('SELECT FOUND_ROWS()', [], null);\n\t}", "public function numRows(){\n $val = $this->numResults;\n $this->numResults = array();\n return $val;\n }", "public function count() {\n\t\t$results = $this->execute();\n\t\treturn $results ? count($results) : 0;\n\t}", "public function RowCount() {\n return $this->_row == '' ? $this->_rown : $this->_rown + 1;\n }", "public abstract function GetNumRows();", "public function num_rows($result_set){\n return mysql_fetch_array($result_set);\n }", "public function rowCount() {\n return $this->stmt->rowCount();\n }", "public function count()\n {\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "public function getNbResults()\n {\n return $this->select->count();\n }", "function num_rows() {\n\t\n\t\t$num = @mysql_num_rows($this->rstemp);\n\t\tif ($this->debug) echo \"$num records returneds <br>\\n\\n\";\t\n\t\t\n\t\treturn $num;\t\t\n\t}", "public function nbRows();", "public function RowCount()\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\tif( !$this->IsConnected() )\r\n\t\t{\r\n\t\t\t$this->SetError('No connection', -1);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telseif( !$this->last_result )\r\n\t\t{\r\n\t\t\t$this->SetError('No query results exist', -1);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$result = @mysql_num_rows( $this->last_result );\r\n\t\t\tif( !$result )\r\n\t\t\t{\r\n\t\t\t\t$this->SetError();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn $result;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"partdata\");\n\t}", "public function rowCount() {\n return $this->stmt->rowCount();\n }", "function numResults() {\n\t\treturn $this->num_rows();\n\t}", "public function numRows() {\n\t\t$q = \"SELECT COUNT(*) FROM {$this->_name}\";\n\t\t$r = @sqlite_query($q, $this->_connection);\n\t\tlist($numRows) = sqlite_fetch_array($r, SQLITE_NUM);\n\t\treturn $numRows;\n\t}", "abstract public function getNumRows();", "abstract public function getNumRows();", "public function num_rows($result){\n return count($result); \n }", "public function getRowCount()\n {\n return $this->rowCount;\n }", "public function getRowCount() {\n return $this->rowCount;\n }" ]
[ "0.87383956", "0.86342347", "0.853513", "0.84997714", "0.8485993", "0.848368", "0.8483505", "0.84724575", "0.84670234", "0.84536296", "0.8445434", "0.84350556", "0.84254295", "0.84165835", "0.84165835", "0.84165835", "0.84159964", "0.8402735", "0.8380751", "0.8377546", "0.8372135", "0.83439434", "0.8333148", "0.8329093", "0.83204573", "0.8284617", "0.82837313", "0.8275313", "0.8243534", "0.8236339", "0.8235335", "0.8224248", "0.8208101", "0.8206123", "0.8196527", "0.8193933", "0.8182419", "0.8181915", "0.8173419", "0.81646645", "0.81523865", "0.8110173", "0.81078404", "0.8099913", "0.8079455", "0.80737203", "0.8065915", "0.80621815", "0.80564505", "0.80549765", "0.804202", "0.804103", "0.80311686", "0.8014791", "0.80140215", "0.8011857", "0.8008595", "0.80079335", "0.8002583", "0.8000325", "0.79772735", "0.7976328", "0.79602355", "0.7957935", "0.7957475", "0.79547244", "0.7950808", "0.79506147", "0.79501766", "0.79483616", "0.7937017", "0.7935293", "0.79163724", "0.79067594", "0.7894218", "0.7888841", "0.7881513", "0.7877637", "0.7874236", "0.78525686", "0.78483593", "0.7847861", "0.7842096", "0.784085", "0.7827023", "0.7817388", "0.7816865", "0.7810618", "0.7801887", "0.77980286", "0.7797993", "0.7795102", "0.77938426", "0.7792484", "0.7782745", "0.77670777", "0.77670777", "0.77596104", "0.77572674", "0.7744702" ]
0.8635328
1
Fetch a row from the resultset. Returns the entry at index $i of the result set.
public function fetchRow(int $rowNumber) { $fetchMode = defined('MDB2_FETCHMODE_ASSOC') ? \MDB2_FETCHMODE_ASSOC : 2; $result = $this->_getResult()->fetchRow($fetchMode, $rowNumber); // Returns an array on success and an \PEAR_Error object on failure return !is_object($result) ? $result : array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetch() {\n\t\t$this->checkResultSet();\n\t\treturn $this->fetchRowAssoc();\n\t}", "public function fetch()\n {\n $row = oci_fetch_row($this->statement);\n return $row;\n }", "protected function fetch_row()\n\t{\n\t\treturn $this->resResult->fetch(PDO::FETCH_NUM);\n\t}", "function FetchRow() {\n\t\t\treturn pg_fetch_row($this->result);\n\t\t}", "public function fetchRow()\n\t{\n\t\t$this->_query();\n\n\t\treturn $this->stmt->fetch(\\PDO::FETCH_ASSOC);\n\t}", "public function get_row( $query, $i = 0 ) {\n\t\t$result = $this->query( $query );\n\n\t\tif ( empty( $this->_last_result ) )\n\t\t\treturn null;\n\n\t\tif ( ! isset( $this->_last_result[ $i ] ) )\n\t\t\treturn null;\n\n\t\treturn $this->_last_result[ $i ];\n\t}", "function fetchRow() {\r\n if($this->getNumRows() > 0)\r\n return mysql_fetch_array($this->m_Result);\r\n else\r\n return false;\r\n }", "public function fetch_row()\n {\n return $this->fetch_assoc();\n }", "function fetch() {\n\t\t$this->i++;\n\t\treturn $this->result->fetch_object($this->class_name);\n\t}", "abstract public function FetchRow();", "public function fetchRow($result_set)\n\t{\n\t\treturn $result_set->fetch_row();\n\t}", "function FetchRow() {}", "public function fetchRow();", "public function fetch_row()\n\t{\n\t\t$row = array();\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $value) {\n\t\t\t\t$row[] = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$row = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $row;\n\t}", "public function fetch_row() {\n\t\tif ($this->opencursor === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$row = $this->opencursor->fetch(PDO::FETCH_ASSOC);\n\t\tif ($row === false) {\n\t\t\t$this->close_open_cursor();\n\t\t\treturn false;\n\t\t}\n\t\treturn $row;\n\t}", "public abstract function FetchRow();", "public function get_row() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->get_rows();\n\t\t}\n\t\t$value = current($this->rows);\n\t\tnext($this->rows);\n\t\treturn $value;\n\t}", "public function fetchRow()\n {\n if (!$this->_rs) {\n return false;\n }\n\n return new $this->_rowClass($this->_rs->FetchRow());\n }", "public function fetch_row()\r\n{\r\n\t$tmp2 = $this->_result->fetch_row();\r\n\t$this->type = 1; // MYSQLI_ASSOC = 0, MYSQLI_NUM = 1, or MYSQLI_BOTH (To implement). \r\n\t$this->push_in($tmp2);\r\n\t\r\n\treturn $tmp2;\r\n}", "public function fetch() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn @mysql_fetch_assoc($this->result);\r\n\t}", "function fetchRow ()\n {\n return pg_fetch_array($this->_result);\n }", "public function fetch()\n {\n return mysqli_fetch_assoc($this->lastResults);\n }", "public function queryRow()\n\t{\n\t\treturn $this->queryInternal('fetch',$this->_fetchMode);\n\t}", "function & fetch() {\n // Call the PEAR::DB Result fetchRow() method\n if ( $row = & $this->result->fetchRow(DB_FETCHMODE_ASSOC) ) {\n return $row;\n } else {\n return false;\n }\n }", "public function row($index = 0) {\n if($this->result) {\n if(isset($this->result[$index])) {\n return $this->result[$index];\n }\n }\n return null;\n }", "public function getRow()\n\t {\n\t\tif (($this->_result instanceof mysqli_result) === false)\n\t\t {\n\t\t\treturn false;\n\t\t }\n\t\telse\n\t\t {\n\t\t\treturn $this->_result->fetch_assoc();\n\t\t }\n\t }", "function db_get_row($result)\n{\n\treturn $result->fetch_assoc();\n}", "function fetchRow() {\n $result = $this->_conn->fetchRow();\n if ($result == false) {\n return false;\n }\n $dm = $this->_formatTag($result);\n return $dm;\n }", "public function current()\n {\n mysql_data_seek($this->res, $this->index);\n \n return $this->fetch();\n }", "public abstract function fetchRow($result_set);", "private function fetch()\n\t{\n\t\tif ($this->sqlResource)\n\t\t{\n\t\t\treturn mysql_fetch_assoc($this->sqlResource);\n\t\t}\n\t\telse\n\t\t\treturn FALSE;\n\t}", "protected function db_fetch_row($result)\n {\n return $result->fetch_row();\n }", "public function FetchObject()\n\t{\n\t\tif (!$this->Result){\t//check if we have a valid result set\n\t\t\treturn false;\n\t\t}\n\n\t\t$row = mysqli_fetch_object($this->Result);\n\n\t\tif (!$row){\t//if last row, free the result set\n\t\t\tmysqli_free_result($this->Result);\n\t\t}\n\n\t\treturn $row;\n\t}", "public function safe_fetch_row()\n {\n $m_record_set = $this->c_obj_stmt->fetch(PDO::FETCH_NUM);\n return $m_record_set;\n }", "public function fetchRow(){\n $this->debugBacktrace();\n $this->fetchType = \"fetch_row\";\n return $this;\n }", "public function fetch(&$statement)\n {\n return $this->db_handler->fetchSingleRow($statement);\n }", "public function fetch_row(&$result){\r\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_NUM;\r\n\t\tif(!$result->EOF){\r\n\t\t \t$rs = $result->fields;\r\n\t\t \t$result->MoveNext(); \r\n\t\t \treturn $rs;\r\n\t\t}\r\n\t}", "function getRow() {\r\n\t\t\tif($this->privateVars['resultset']) {\r\n\t\t\t\t$resultArray = mysql_fetch_array($this->privateVars['resultset']);\r\n\t\t\t\tif ($resultArray !== false) $this->privateVars['resultpointer']++;\r\n\t\t\t\treturn $resultArray;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "public function fetchRow($result)\n {\n return $result->fetch(PDO::FETCH_NUM);\n }", "public function fetchRow($sql);", "public function fetchRow($sql);", "public function fetch_row($row=0)\n {\n if(is_resource($this->resource) && is_int($row))\n {\n return pg_fetch_row($this->resource, $row);\n }\n else\n {\n return false;\n }\n }", "public function current() {\n\t\t$this->checkResultSet();\n\t\treturn $this->fetchRowAssoc($this->index, true);\n\t}", "public function fetch()\n {\n return $this->statement->fetch();\n }", "public function fetchRow( $type = FETCH_OBJ );", "public function find(){\n\t\t$row = mysql_fetch_assoc($this->result);\n\t\treturn $row;\n\t}", "public function fetch()\r\n {\r\n $this->query();\r\n return $this->sth->fetch();\r\n }", "public function fetch()\n {\n\n if ($this->_result !== null) {\n if (($row = $this->_result->fetch(PDO::FETCH_ASSOC))=== false ) {\n $this->freeResult();\n\n }\n return $row;\n }\n return false;\n }", "public function fetch_one()\n {\n if (!$this->limit) $this->limit(1);\n $rows = $this->fetch_all();\n return count($rows) ? array_shift($rows): null;\n }", "public function fetchOne() {\r\n\t\t$data = $this->fetch();\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $data ? current($data) : null;\r\n\t}", "public function fetch()\n {\n return mysql_fetch_object($this->res);\n }", "public function fetch() {\r\n $this->resource_fetched=true;\r\n return new dbconnect_rowset($this, $this->result);\r\n }", "public function fetchRow($result)\n {\n return @mysqli_fetch_row($result);\n }", "public function fetchRecord()\n {\n $ret = $this->readCurrentRecord();\n if ($ret !== false) {\n $this->next();\n }\n return $ret;\n }", "public function fetchRow($result = false){\n $this->resCalc($result);\n return mysql_fetch_row($result);\n }", "public function fetch()\n {\n $this->execute();\n return $this->dbStmt->fetch(PDO::FETCH_ASSOC);\n }", "public function fetchRow() : array\n\t{\n\t\treturn $this->handle->fetchRow($this->result);\n\t}", "public function sql_fetch_row($result) {\n return @mysql_fetch_row($result);\n }", "public function fetchRow($where = null, $order = null, $offset = null)\n {\n// $row = $this->fetchAll($where, $order, 1, $offset)->toArray();\n//\n// $data = array(\n// 'table' => $this,\n// 'data' => (isset($row[0])) ? $row[0] : null,\n// );\n//\n// return new $this->_rowClass($data);\n return $this->fetchAll($where, $order, 1, $offset)->getRow(0);\n }", "public function exec_SELECTgetSingleRow() {}", "function FetchRow(){\n if ($this->parse){\n $this->data =PHP_MAJOR_VERSION>5?mysqli_fetch_assoc($this->parse):mysql_fetch_assoc($this->parse);\n return $this->data;\n }else{\n return false;\n };\n }", "function fetchRow($consulta = NULL){\n if(!$consulta) \n $consulta = $this->consulta;\n return pg_fetch_row($consulta);\n }", "public function fetchSingleRow($result){\r\n\t\t\r\n\t\t$row = mysqli_fetch_assoc($result);\r\n\t\treturn $row;\r\n\t}", "public function row($query,$fetchMode = PDO::FETCH_BOTH)\n {\n $this->_init( $query );\n return $this->doQuery->fetch( $fetchMode );\n }", "public function getNextRow() {\n $row = mssql_fetch_object($this->result);\n\n // Might be totally out of data, or just out of this batch - request another\n // batch and see\n if (!is_object($row)) {\n mssql_fetch_batch($this->result);\n $row = mssql_fetch_object($this->result);\n }\n if (is_object($row)) {\n return $row;\n }\n else {\n return NULL;\n }\n }", "function db_fetch_next_row( $fetch_mode = DB_FETCHMODE_ASSOC ) {\n\n $this->pm_clear_cols();\n if( ! is_object( $this->dataset_obj )) return NULL;\n\n $this->curr_row_array = $this->dataset_obj->fetchRow( $fetch_mode );\n $this->pm_die_if_error( 'curr_row_array' );\n\n if( is_array( $this->curr_row_array )) { # Some data was retrieved\n $this->curr_rowno++;\n $this->cols_in_curr_row = count( $this->curr_row_array );\n }\n\n return $this->curr_row_array;\n }", "function row($resource) {\n return mysql_fetch_assoc($resource);\n }", "public function fetch($id){\n\t\t$row = $this->query(\"SELECT * FROM $this->tabla WHERE id='$id'\");\n\t\t\n\t\t$row = $this->fetchRow();\n\t\t\t\n\t\t//if(!$row=mysql_query(\"SELECT * FROM $this->tabla WHERE id='$id'\")){\n\t\t\t//throw new Exception('Error en el fetch');\n\t\t\n\t\treturn $row;\n\t}", "public function fetchSingle() {\n $this->execute();\n return $this->stmt->fetch(PDO::FETCH_OBJ);\n }", "function fetch(){\n\t\tif($this->result==null){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif($this->result==false){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn $this->result->fetch_assoc();\n\t}", "function fetch()\n\t{\n\t\t// check if results has content\n\t\tif($this->result == false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t//return result\n\t\treturn mysqli_fetch_assoc($this->result);\n\t}", "public function getRow($arg)\n {\n $result = $this->resulter($arg);\n return $this->hasRows() ? $result->fetch_assoc() : false;\n }", "public function loadNextRow()\n {\n $this->connect();\n\n // Execute the query and get the result set cursor.\n if (!$this->executed) {\n if (!($this->execute())) {\n return $this->errorNum ? null : false;\n }\n }\n\n // Get the next row from the result set as an object of type $class.\n if ($row = $this->fetchArray()) {\n return $row;\n }\n\n // Free up system resources and return.\n $this->freeResult();\n\n return false;\n }", "public function fetchRow($result)\n {\n // phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved\n return mysql_fetch_row($result);\n }", "protected function getOne()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetch($statement);\n }", "function fetch_row( $handle='', $return_as_array = FALSE, $close_on_finish = TRUE, )\n\t{\n\t\t$result = $this->get_handle($handle);\n\t\tif( !$result )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the row\n\t\t$row = mysql_fetch_assoc( $result );\n\t\t\n\t\t//if loop has finished, close the result\n\t\tif( $row === FALSE )\n\t\t{\n\t\t\tif( $close_on_finish )\n\t\t\t\tmysql_free_result( $result );\n\t\t\t\t\n\t\t\treturn FALSE;\t\n\t\t}\n\t\t\n\t\t//return an object by default, but also allow for arrays\n\t\tif( $return_as_array )\n\t\t\treturn $row;\n\n\t\treturn (object)$row;\n\t}", "public function get($id)\n\t{\n\t\t$id = (int) $id;\n $rowset = $this->select(array('id' => $id));\n $rowset->setObjectPrototype($this->objectPrototype);\n\t\t$row = $rowset->current();\n if (!$row) throw new \\Exception(\"Could not find row $id\");\n \n return $row;\n\t}", "public function singleRow(){\n $this->execute();\n return $this->statement->fetch(PDO::FETCH_OBJ);\n }", "public function get_row($sql) {\n if ( !$results = $this->query($sql . \" LIMIT 1\") )\n return false;\n \n return $results->fetch_object();\n }", "function get_row($query=null,$y=0) {\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query ) {\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\treturn $this->last_result[$y]?$this->last_result[$y]:null;\n\t\t}", "public function offsetGet($offset) {\n\t\tsettype($offset, 'integer');\n\n\t\tif ($offset < 0 || $offset >= $this->indexMax) {\n\t\t\tthrow new Exception('Illegal offset for ' . $this->indexMax . ' rows');\n\t\t}\n\n\t\treturn $this->fetchRowAssoc($offset);\n\t}", "public function get_row();", "function fetch_row($result)\n{\n\treturn mysqli_fetch_row($result); \n}", "public function get() {\n\t\treturn $this->rows[$this->rowIndex];\n\t}", "function GetRow($handle = false)\n {\n if ($handle) $handle = $this->_lastHandle;\n switch ($this->_DB) {\n case 'mysql':\n $row = mysqli_fetch_assoc($handle);\n break;\n }\n return $row;\n }", "public function fetch_assoc()\r\n {\r\n return $this->resultID->fetch_assoc();\r\n }", "public function fetchRow($query = false)\r\n\t{\r\n\t\r\n\t\treturn mysqli_fetch_row($query);\r\n\t}", "public function get_row($query) {\n if (!($res =$this->database_query($query))) {\n die( \"Database error: \" . mysqli_error($this->connection) . \"<br/>In query: \" . $query);\n }\n return mysqli_fetch_assoc($res);\n }", "public function Row( $optional_row_number = NULL )\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\tif( !$this->last_result )\r\n\t\t{\r\n\t\t\t$this->SetError( 'No query results exist', -1 );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telseif( $optional_row_number === NULL )\r\n\t\t{\r\n\t\t\tif( ( $this->active_row ) > $this->RowCount() )\r\n\t\t\t{\r\n\t\t\t\t$this->SetError('Cannot read past the end of the records', -1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->active_row++;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif( $optional_row_number >= $this->RowCount() )\r\n\t\t\t{\r\n\t\t\t\t$this->SetError('Row number is greater than the total number of rows', -1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->active_row = $optional_row_number;\r\n\t\t\t\t$this->Seek( $optional_row_number );\r\n\t\t\t}\r\n\t\t}\r\n\t\t$row = mysql_fetch_object( $this->last_result );\r\n\t\tif( !$row )\r\n\t\t{\r\n\t\t\t$this->SetError();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $row;\r\n\t\t}\r\n\t}", "function fetchSingleRow($query) \t{\n\t\tif($query != '') \t\t{\n\t $res = $this->execute($query);\n\t $data = $this->fetchAll($res);\n\t if($data) return $data[0]; \n\t\t}\n\t}", "function firstrow() {\r\n\t\t$result=@mysql_data_seek($this->result,0);\r\n\t\tif ($result) {\r\n\t\t\t$result=$this->getrow();\r\n\t\t}\r\n\t\treturn $this->row;\r\n\t}", "function fetch_assoc()\n {\n if (!$this->res_result) {\n $this->error = \"No Resultset can be fetched from query\";\n return null;\n } else {\n $_rec = @isis_fetch_flat_array($this->res_result);\n }\n\n return $_rec;\n }", "public function current() {\n if (isset($this->results[$this->cursor_offset])) {\n return $this->results[$this->cursor_offset];\n }\n return $this->results[$this->cursor_offset] = $this->fetch();\n }", "function get_row( $query = null ){\r\n\t\treturn mysql_fetch_assoc( $this->query( $query ) );\r\n\t}", "public function fetch_row($query_id = \"\") {\r\n\t\treturn $this->fetch_array ( $query_id, \"assoc\" );\r\n\t}", "function pdo_fetch_row($stmt) {\r\n return pdo_stmt($stmt)->fetch(PDO::FETCH_NUM);\r\n }", "function fetch($result)\n\t{\n\t\treturn mysql_fetch_assoc($result);\n\t}", "function fetch($result) {\n\t\n\t$row = mysql_fetch_array($result);\n\t\n\treturn $row;\n}", "protected function fetch_row($query)\n {\n $res = $this->query($query);\n if ($res)\n {\n return mysql_fetch_row($res);\n }\n else\n {\n return NULL;\n }\n }", "function mysqli_result($result, $row, $field = 0) {\n $result->data_seek($row);\n // Fetch result array\n $data = $result->fetch_array();\n \n return $data[$field];\n }", "public function get() {\n $where = func_get_args();\n $this->_set_where($where);\n\n $this->_callbacks('before_get', array($where));\n\n if ($this->result_mode == 'object') {\n $row = $this->db->get($this->_table())->row();\n } else {\n $row = $this->db->get($this->_table())->row_array();\n }\n\n $row = $this->_callbacks('after_get', array($row));\n\n return $row;\n }" ]
[ "0.73296666", "0.72471863", "0.7115753", "0.71148026", "0.7083625", "0.70492256", "0.69811034", "0.6924426", "0.6916434", "0.69108367", "0.69106585", "0.68850267", "0.6874188", "0.6841943", "0.6804316", "0.673232", "0.67134947", "0.66592777", "0.66526955", "0.6618312", "0.66042334", "0.6577828", "0.6576884", "0.6527087", "0.6507606", "0.6500759", "0.6471348", "0.6471232", "0.6469216", "0.64301056", "0.64153576", "0.6391071", "0.637314", "0.6354504", "0.63445896", "0.63418156", "0.6337", "0.63146967", "0.6312746", "0.6307792", "0.6307792", "0.63047063", "0.6291657", "0.62864107", "0.62764996", "0.6274552", "0.6268367", "0.62571216", "0.6248783", "0.6238694", "0.6235683", "0.62271774", "0.620877", "0.619963", "0.6197153", "0.6177318", "0.61757785", "0.61609834", "0.6155957", "0.6153552", "0.61531216", "0.61458856", "0.6118388", "0.6113042", "0.61021286", "0.60673976", "0.60643107", "0.60555375", "0.60378456", "0.6031967", "0.60146636", "0.6013847", "0.60045063", "0.60021144", "0.59939647", "0.5993632", "0.59869254", "0.59821135", "0.5975052", "0.5972789", "0.59684104", "0.59645396", "0.5962361", "0.5910598", "0.590872", "0.5906728", "0.5902277", "0.5889474", "0.58816314", "0.58809936", "0.58749086", "0.5870191", "0.5857162", "0.58570653", "0.58429426", "0.58423346", "0.5836828", "0.58364546", "0.58247614", "0.5823573", "0.58149713" ]
0.0
-1
Fetch and return all rows from the result set.
public function fetchAll(): array { $fetchMode = defined('MDB2_FETCHMODE_ASSOC') ? \MDB2_FETCHMODE_ASSOC : 2; $result = $this->_getResult()->fetchAll($fetchMode); // Returns an array on success and an \PEAR_Error object on failure return is_array($result) ? $result : array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchRowset()\n\t{\n\t\t$this->_query();\n\n\t\treturn $this->stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t}", "public function fetchAll()\r\n {\r\n $this->query();\r\n return $this->sth->fetchAll();\r\n }", "public function fetchAll() {\n\n if (!$this->results) {\n\n $this->results = [];\n while ($row = $this->nextRow()) {\n $this->results[] = $row;\n }\n\n }\n\n return $this->results;\n }", "public function result_set() {\n $this -> execute();\n return $this -> stmt -> fetchAll();\n }", "public function fetchAll(){\n $resultSet = $this->tableGateway->select();\n return $resultSet;\n }", "public function fetchAll()\n { \n $resultSet = $this->tableGateway->select();\n return $resultSet;\n }", "public function fetchAll()\n {\n $this->execute();\n return $this->dbStmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetchAll() {\n $this->execute();\n return $this->stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function fetchAll() {\r\n\t\t$result = array();\r\n\r\n\t\twhile ($data = $this->fetch()) {\r\n\t\t\t$result[] = $data;\r\n\t\t}\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $result;\r\n\t}", "public function fetchAll() {\n\t\t$queryBuilder = $this->db->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t->select('*')\n\t\t\t->from($this->table_name, 't1')\n\t\t;\n\t\t$result = $queryBuilder->execute()->fetchAll();\n\n\t\treturn $result;\n\t}", "public function fetchAll() {\r\n\t\treturn $this->getMapper()->fetchAll();\r\n\t\t\r\n\t}", "public function fetchAll(){\n $adapter = $this->adapter;\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from('flota');\n $selectString = $sql->getSqlStringForSqlObject($select);\n $data = $adapter->query($selectString, $adapter::QUERY_MODE_EXECUTE);\n \n return $data;\n }", "function fetchAll() {\r\n if($this->getNumRows() <= 0)\r\n throw new Exception(\"No Recored Found\");\r\n \r\n while ($row = mysql_fetch_array($this->m_Result)) {\r\n $a_rs[] = $row;\r\n }\r\n mysql_free_result($this->m_Result);\r\n return $a_rs;\r\n \r\n }", "public function fetchAll()\r\n {\r\n $sql = new Sql($this->dbAdapter);\r\n $select = $sql->select();\r\n $select\r\n ->from(array('a_s' => $this->table))\r\n ->order('a_s.sector_order ASC');\r\n \r\n $selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result = $execute->toArray();\r\n return $result;\r\n }", "public function fetchAll()\n {\n $result = $this->select();\n return $result;\n }", "public function fetch(){\n\n $rows = [];\n\n while($row = $this->result->fetch(PDO::FETCH_ASSOC)) {\n $rows[]=$row;\n }\n\n $this->result=null;\n\n return $rows;\n\n }", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public function resultset(){\n\t\t$this->execute() ;\n\t\treturn $this->statement->fetchAll(PDO::FETCH_ASSOC) ;\n\t}", "public function all(): ResultSetContract;", "public function fetchAll()\n\t{\n\t\t$aReturn = Array();\n\t\twhile( $oRecord = $this->next() )\n\t\t\tarray_push( $aReturn, $oRecord );\n\t\t$this->rewind();\n\t\treturn $aReturn;\n\t}", "public abstract function fetchAll();", "public function fetchAll(){\n\t\treturn $this->instance->fetchAll();\n\t}", "public function fetch()\r\n {\r\n $this->query();\r\n return $this->sth->fetch();\r\n }", "public function fetchAll()\n {\n return mysqli_fetch_all($this->lastResults);\n }", "public function fetch() {\n\t\t$this->checkResultSet();\n\t\treturn $this->fetchRowAssoc();\n\t}", "public function fetch() {\r\n $this->resource_fetched=true;\r\n return new dbconnect_rowset($this, $this->result);\r\n }", "public function resultSet(){\n\t\t$this->execute();\n\t\treturn $this->stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function fetchAll()\n {\n //*** your code goes here\n //*** if there is an error, return an array which includes an error code of 2 and message == ERROR_UNABLE\n $listing = $this->table->select();\n if ($listing) {\n $data = [];\n $hydrator = $this->table->getResultSetPrototype()->getHydrator();\n foreach ($listing as $entity) $data[] = $hydrator->extract($entity);\n $result = ['success' => 1, 'data' => $data];\n } else {\n $result = ['success' => 0, 'error' => 1, 'message' => self::ERROR_UNABLE];\n }\n return $result;\n }", "public function resultSet()\n\t{\n\t\t$this->execute();\n\t\treturn $this->stm->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function fetch()\n\t{\n\t\treturn $this->data = $this->df->fetchAll();\n\t}", "public function resultSet(){\n $this->execute();\n return $this->statement->fetchAll(PDO::FETCH_OBJ);\n }", "public function fetchAll(&$statement)\n {\n return $this->db_handler->fetchAllRows($statement);\n }", "function all() {\n\t\t$results = array();\n\t\twhile ($result = $this->fetch())\n\t\t\t$results[] = $result;\n\t\treturn $results;\n\t}", "public function fetchAll()\n {\n return new QueryResult(\n $this->execute()->fetchAll(PDO::FETCH_ASSOC),\n $this->entity\n );\n }", "public abstract function fetchRow($result_set);", "public function fetchAll()\n {\n return $this->tableGateway->select();\n }", "public function fetchAll()\n {\n return $this->tableGateway->select();\n }", "public function resultSet(){\n $this->executeQuery($this->statement);\n return $this->fetchAll($this->statement);\n }", "protected function dbFetchAll() {\r\n\r\n //@@TODO RESOURCE CHECK IS_A ?\r\n\r\n $return_array = array();\r\n\r\n while ($row = $this->query_result->fetch_array(MYSQLI_ASSOC)) {\r\n $return_array[] = $this->dbOutArray($row);\r\n }\r\n return $return_array;\r\n }", "abstract protected function doFetchAll();", "public function fetchRow();", "public function fetchRow() : array\n\t{\n\t\treturn $this->handle->fetchRow($this->result);\n\t}", "public function fetchAll(){\r\n$table=$this->getTable();\r\nreturn $this->fetch_array($this->query(\"SELECT * FROM {$table}\"));\r\n}", "public function queryAll() {\r\n $sql = \"SELECT * FROM $this->table\";\r\n $stmt = ConnectionFactory::prepare($sql);\r\n $stmt->execute();\r\n return $stmt->fetchAll();\r\n }", "public function fetchAll() {\n\t\t$rows = array();//Default\n\t\t//SQL\n\t\t$sql = \"SELECT * FROM `$this->table` WHERE 1 ORDER BY sort_order, uuid ASC\";\n\t\t// excecute SQL statement\n\t\t$result = mysqli_query ( $this->adapter, $sql );\n\t\tif (mysqli_num_rows($result) > 0) {\n\t\t\t// output data of each row\n\t\t\twhile($row = mysqli_fetch_assoc($result)){\n\t\t\t\t$row['done'] = $row['done'] == 0 ? false : true;\n\t\t\t\t$rows[] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $rows;\t\t\n\t}", "public function resultSet()\n {\n $this->execute();\n return $this->stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetch_all(){\n $data = array();\n while( ($obj = oci_fetch_object($this->result)) != false ){\n $data[] = $obj;\n }\n return $data;\n }", "function fetchAll()\n {\n $rows=array();\n if ($this->consulta)\n {\n //la funcion oci_fetch_array devuelve cada fila de la consulta en forma de array\n while($row = oci_fetch_array($this->consulta, OCI_BOTH))\n { //luego cada fila (como un array) se agrega a otro array... creando un array de 2 dimsnesiones\n $rows[]=$row;\n }\n }\n return $rows;\n }", "function fetchAll($res = null, $fmt = 'a')\n{\n\t$rows = array();\n\twhile ($row = $this->drv->fetch($res, $fmt)) {\n\t\t$rows[] = $row;\n\t}\n\treturn $rows;\n}", "public static function all()\n {\n self::select(self::tableName());\n return self::fetchAll();\n }", "function readAll(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name .\"\";\n\t\t$stmt = $this->conn->prepare($query);\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}", "public function fetchAll($table = null)\n {\n if ($table){\n $this->table = $table;\n }\n\n $sql = $this->fetchStatement();\n\n $query = $this->query($sql , $this->bindings);\n $results = $query->fetchAll();\n $this->rows = $query->rowCount();\n\n $this->reset();\n return $results;\n }", "public function fetchAll(): array\n {\n if (!$this->wasExecuted()) {\n $this->exec();\n }\n\n return $this->getAdapter()->getStatement()->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function fetchData()\n\t{\n\t\tif (isset($this->rows))\n\t\t{\n\t\t\treturn $this->rows;\n\t\t}\n\t\t$this->rows = parent::fetchData();\n\t\tif ($this->force_count)\n\t\t{\n\t\t\treturn $this->rows;\n\t\t}\n\n\t\tif (count($this->rows) > $this->pagination->pageSize)\n\t\t{\n\t\t\t$this->hasMore = true;\n\t\t\tarray_pop($this->rows);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->hasMore = false;\n\t\t}\n\t\t$this->totalItemCount = $this->pagination->offset + count($this->rows);\n\t\t$this->pagination->itemCount = $this->totalItemCount + ($this->hasMore ? 1 : 0);\n\t\treturn $this->rows;\n\t}", "public function fetchAll($table = null)\n\t{\n\t\tif ($table)\n\t\t{\n\t\t\t$this->table = $table;\n\t\t}\n\t\t\n\t\t$sql = $this->fetchStatement();\n\t\t\n\t\t$query = $this->query($sql, $this->bindings);\n\t\t\n\t\t$results = $query->fetchAll();\n\t\t\n\t\t$this->rows = $query->rowCount();\n\t\t\n\t\t$this->reset();\n\t\t\n\t\treturn $results;\n\t}", "public function fetch_row()\n\t{\n\t\t$row = array();\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $value) {\n\t\t\t\t$row[] = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$row = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $row;\n\t}", "protected function getAll()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetchAll($statement);\n }", "abstract public function FetchRow();", "public function getAll()\n {\n $sql = \"SELECT * FROM \" . self::table . \";\";\n\n $conn = $this->dbc->Get();\n $statement = $conn->prepare($sql);\n $statement->execute();\n $data = $statement->fetchAll();\n $conn = null;\n\n return $data;\n }", "public function fetchAll($statement, array $params = array());", "function get_all_records(){\n\t\tglobal $db;\n\t\t$sql=\"SELECT * FROM $this->table order by id asc\";\n\t\t$db->query($sql);\n\t\t$row=$db->fetch_assoc_all();\n\t\treturn $row;\n\t}", "public function fetchAll(){\n $sql = \"SELECT * FROM reservation \";\n $result = $this->connection()->query($sql);\n if ($result->rowCount()>0){\n while($rows = $result->fetch()){\n $data [] = $rows;\n }return $data;\n }\n }", "public abstract function FetchRow();", "function fetchAll()\n {\n //select all data\n $query = \"SELECT\n id, tag\n FROM\n \" . $this->table_name . \"\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n\n\n return $result;\n }", "public function fetch()\n {\n $this->execute();\n return $this->dbStmt->fetch(PDO::FETCH_ASSOC);\n }", "public function fetchAll($sql);", "public function fetchAll($sql);", "public function queryRow()\n\t{\n\t\treturn $this->queryInternal('fetch',$this->_fetchMode);\n\t}", "function get_all(){\r\n\t\t$rows = array();\r\n\t\twhile($row = $this->get_row()){\r\n\t\t\t$rows[] = $row;\r\n\t\t}\r\n\t\treturn $rows;\r\n\t}", "function selectAll() {\n $query = $this->getStatement(\n \"SELECT * FROM `$this->table` WHERE 1 ORDER BY id\"\n );\n $query->execute();\n return $query->fetchAll();\n }", "public function fetchAll() : array\n {\n $sql = \"SELECT * FROM content;\";\n $resultset = $this->db->executeFetchAll($sql);\n\n return $resultset;\n }", "public function fetchAll($fetchStyle = PDO::FETCH_BOTH)\n {\n switch($fetchStyle) {\n case PDO::FETCH_BOTH:\n $flags = OCI_FETCHSTATEMENT_BY_ROW + OCI_BOTH;\n break;\n case PDO::FETCH_ASSOC:\n $flags = OCI_FETCHSTATEMENT_BY_ROW + OCI_ASSOC;\n default:\n $flags = 0;\n break;\n\n }\n oci_fetch_all($this->statement, $rows, null, null, $flags);\n return $rows;\n }", "abstract public function get_rows();", "public function fetchAll ($fetch_all_method = PDO::FETCH_ASSOC) {\n return $this->query->fetchAll($fetch_all_method); \n }", "public static function fetchAll($result=null) {\n\treturn self::$instance->fetchAll($result);\n\t\n }", "public function getAll() {\n $prepareStatement = $this->pdo->prepare($this->sql);\n $prepareStatement->execute($this->param);\n\n # close connection\n Connection::disconnect();\n\n return $prepareStatement->fetchAll($this->fetch);\n }", "public function getAllRows() {\n\t\t$rows = array();\n\t\t\n\t\tfor($x = 0; $x < $this->getNumRows(); $x++) {\n\t\t\t$rows[] = mysqli_fetch_assoc($this->_result);\n\t\t}\n\t\treturn $rows;\n\t}", "function fetch_all() {\n $query = \"SELECT * FROM ReadingList\";\n $statement = $this->connect->prepare($query);\n if($statement->execute()) {\n while($row = $statement->fetch(PDO::FETCH_ASSOC))\n {\n $data[] = $row;\n }\n return $data;\n } else {\n return \"error\";\n }\n }", "public function fetchAll($fetchMode = \\PDO::FETCH_BOTH);", "public function fetchRow()\n\t{\n\t\t$this->_query();\n\n\t\treturn $this->stmt->fetch(\\PDO::FETCH_ASSOC);\n\t}", "public function readAll(){\n $rq = \"SELECT * FROM Objets\";\n $stmt = $this->pdo->prepare($rq);\n $data = array();\n if(!$stmt->execute($data)){\n throw new Exception($pdo->errorInfo());\n }\n return $result = $stmt->fetchAll();\n }", "public function all()\r\n {\r\n return new IteratorResult(R::findAll($this->table),'redbean');\r\n }", "public static function fetchAll() {\n // Initialize fetch-all cache, if necessary\n if (!isset(self::$fetchAllRecordsPreparedStatementCache)) {\n self::$fetchAllRecordsPreparedStatementCache = array();\n }\n\n // Cache calling subclass name \n $table_name = static::getTableName();\n \n // Begin implicit transaction if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n \n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()'\n assert(isset(self::$databaseHandle));\n\n try {\n // Create prepared statement if nonextant \n if (!isset(self::$fetchAllRecordsPreparedStatementCache[$table_name])) {\n $fully_qualified_table_name = static::getFullyQualifiedTableName();\n $query_str = \"SELECT * FROM {$fully_qualified_table_name}\";\n self::$fetchAllRecordsPreparedStatementCache[$table_name] =\n self::$databaseHandle->prepare($query_str); \n } \n\n // Fetch all records\n $fetch_all_stmt = self::$fetchAllRecordsPreparedStatementCache[$table_name]; \n $fetch_all_stmt->execute();\n $raw_record_set = $fetch_all_stmt->fetchAllRows();\n \n // Conclude implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n\n // Extrude raw records to objects\n $record_objects = array();\n foreach ($raw_record_set as $raw_record) {\n $record_objects[] = new static($raw_record); \n }\n\n return $record_objects;\n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n }", "public function fetchAll()\n {\n }", "public abstract function fetchAllObjects();", "public function getRows()\n {\n \treturn $this->previouslyExecuted->fetch_array(MYSQLI_ASSOC);\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM `%s`\";\n $this->_sql[] = sprintf($sql, $this->_table);\n $this->_parameters[] = array();\n return $this->run();\n }", "public function fetch_all($assoc=MYSQLI_ASSOC){\n\t\t$output=array();\n\t\twhile($row=$this->fetch($assoc)){\n\t\t\t$output[]=$row;\n\t\t}\n\t\t\n\t\t@$this->qresult->data_seek(0);\n\t\t@$this->qresult->field_seek(0);\n\t\t\n\t\treturn $output;\n\t}", "public function fetch()\n {\n return $this->statement->fetch();\n }", "public static function getAll() {\n $conn = self::connect();\n $row = $conn->getAll(self::baseQuery());\n return $row;\n }", "public function fetchAll($fetch_style = \\PDO::FETCH_ASSOC)\n\t{\n\t\treturn $this->getStatement()\n\t\t\t\t\t->fetchAll($fetch_style);\n\t}", "public function fetchAll($where=\"\"){\n\n\t\t$select=$this->getDbTable()->select();//\n\n\t\tif(!empty($where))$select->where($where);\n\t\t$result= $this->getDbTable()->getAdapter()->fetchAll($select);\n\t\treturn $result;\n\n\t}", "public function fetchAll($type = null) {\n\t\t$data = array();\n\t\twhile($row = $this->fetch($type)) $data[] = $row;\n\t\treturn $data;\n\t}", "public function fetchAll($options = array(), $params = array(), $debug = false) {\r\n \t$options += $this->_fetchOptions;\r\n \t$params += $this->_fetchParams;\r\n \t\r\n \t$this->_validateFetchOptions($options);\r\n \t$this->_validateFetchParams($params);\r\n \t\r\n \t$gateway = $this->_getGateway();\r\n\t\t\r\n \t$select = $gateway->select();\r\n \t$select->from($gateway->info(Zend_Db_Table_Abstract::NAME));\r\n \t$this->_manageFetchOptions($select, $options);\r\n \t$this->_manageFetchParams($select, $params);\r\n \t\r\n \tif($debug) {\r\n\t\t\tZend_Debug::dump($select->assemble()); exit();\r\n \t}\r\n\t\t$rowset = $gateway->fetchAll($select);\r\n\t\t\r\n\t\treturn $this->_rowsetToEntites($rowset);\r\n }", "public function getAll(){\n $adapter = $this->createAdapter();\n $results = $adapter->query($this->getSelectStatement());\n return $results;\n $adapter = null;\n }", "function fetchRow ()\n {\n return pg_fetch_array($this->_result);\n }", "public function loadAllRows($option = array()){\n\t\tif(!$option){\n\t\t\tif(!$result = $this->execute())\n\t\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tif(!$result = $this->execute($option))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn $result->fetchAll(PDO::FETCH_OBJ);\n\t}", "function FetchRow() {}" ]
[ "0.8331557", "0.8224567", "0.80545473", "0.7929729", "0.7804775", "0.77821684", "0.77669024", "0.776528", "0.7713718", "0.76758885", "0.7666382", "0.7639692", "0.7631574", "0.76187915", "0.75597906", "0.75306714", "0.7500867", "0.7500867", "0.7500867", "0.7500867", "0.74879146", "0.74833006", "0.74721575", "0.7467887", "0.7447362", "0.74292314", "0.7426779", "0.7417832", "0.74127525", "0.73998696", "0.73955345", "0.73937833", "0.737477", "0.73713636", "0.7371246", "0.7298924", "0.7284625", "0.72739357", "0.72603947", "0.72603947", "0.7250913", "0.7245592", "0.72379273", "0.7218544", "0.7206533", "0.7199437", "0.71918494", "0.7190149", "0.7181276", "0.71785253", "0.7175766", "0.71387315", "0.71266705", "0.7125379", "0.71183014", "0.7113102", "0.7091709", "0.7090719", "0.70862263", "0.70766664", "0.70613664", "0.7054292", "0.70399183", "0.7024281", "0.70230705", "0.70180184", "0.70168114", "0.700721", "0.7006367", "0.7006367", "0.7005307", "0.69906116", "0.6989046", "0.6986592", "0.69683313", "0.6963232", "0.6959659", "0.6942984", "0.69419926", "0.6932343", "0.69170374", "0.6915663", "0.691098", "0.6910437", "0.6897826", "0.68967724", "0.6891836", "0.6891457", "0.68718135", "0.6860993", "0.68609226", "0.68526334", "0.6835935", "0.6832997", "0.68280697", "0.68269706", "0.6811704", "0.68109083", "0.68060607", "0.6803783", "0.6800797" ]
0.0
-1
Fetch and return a column from the current row pointer position.
public function fetchColumn(int $column = 0): array { $result = $this->_getResult()->fetchCol($column); // Returns an array on success and an \PEAR_Error object on failure return is_array($result) ? $result : array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchColumn(int $column = 0);", "public function fetchColumn($columnIndex = 0);", "public function fetchColumn() {\n if ($this->result === true) {\n return false;\n }\n\n // Are we running PHP >=8.1?\n if (PHP_VERSION_ID >= 80100) {\n $value = $this->result->fetch_column();\n return ($value === null || $value === false) ? $value : (string) $value;\n }\n\n // Fallback to traditional approach\n $row = $this->result->fetch_row();\n return $row ? $row[0] : false;\n }", "function GetRowColumn($row,$column){\n\t\t\treturn @mysql_result($this->result,$row,\"$column\");\n\t\t}", "public function fetchColumn() {\r\n\t\t$result = array();\r\n\r\n\t\twhile ($data = $this->fetch()) {\r\n\t\t\t$result[] = current($data);\r\n\t\t}\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $result;\r\n\t}", "function Get($col)\n {\n return $this->row ? $this->row[$col] : NULL;\n }", "public function getPositionColumn();", "public function getColumn(){\n\n $part = substr($this->input, 0, $this->index);\n $pos = strrpos($part,\"\\n\");\n return $this->index - $pos;\n }", "public function fetchColumn ($index) {\n return $this->query->fetchColumn($index);\n }", "public function fetchColumn(int $column = 0) : ?string\n\t{\n\t\treturn $this->handle->fetchColumn($this->result, $column);\n\t}", "protected function get_column() {\n\n\t\t$column = $this->foreign_column ?: $this->foreign_table->get_primary_key();\n\t\t$columns = $this->foreign_table->get_columns();\n\n\t\treturn $columns[ $column ];\n\t}", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumn() { return $this->column; }", "public function fetchColumn($column_number = 0) {\n\t\t$row = $this->fetch(PDO::FETCH_NUM);\n\t\tif( empty($row) || empty($row[$column_number])) return false;\n\t\treturn $row[$column_number];\n\t}", "function Get($col)\n {\n return isset($this->row) ? $this->row[$col] : null;\n }", "function get_column( $query, $col_offset = 0 )\n\t{\n\t\t$num_rows = $this->query( $query );\n\t\t\n\t\tif( $num_rows === FALSE )\n\t\t\treturn FALSE;\n\t\t\n\t\t//grab handle of the call we just made\n\t\t$handle = $this->get_handle();\n\t\t\n\t\t//init final output array\n\t\t$rows = array();\n\t\t\n\t\twhile( ($row = mysql_fetch_row($handle)) !== FALSE )\n\t\t\tarray_push( $rows, $row[$col_offset] );\n\t\t\n\t\t//clean up the query in memory\n\t\tmysql_free_result( $handle );\n\t\t\n\t\t//return the result\n\t\treturn $rows;\n\t}", "public function fetchColumn(\\PDO $pdo, $sql, array $params = array())\n\t{\n\t\treturn $this->runStatement($pdo, $sql, $params)->fetchColumn();\t\t\n\t}", "public function getCol()\n {\n return $this->col;\n }", "public function readCol($column, $row_start = 0, $row_end = null) {\n\t}", "public function columnOffset();", "public function GetColumn($index = NULL)\r\n {\r\n return($this->preparedStatement->fetchColumn($index));\r\n }", "public function fetchColumn($sql, $params = [])\n {\n $stmt = $this->dbConn->prepare($sql, [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]);\n $stmt->execute($params);\n\n return $stmt->fetchColumn();\n }", "public function getCol($col)\n {\n if (!$this->checkRange(0, $col)) {\n throw new \\OutOfRangeException();\n }\n\n return array_column($this->_data, $col);\n }", "public function fetchColumn($columnNumber = 0)\n {\n $row = $this->fetch();\n if ($row) {\n return $row[$columnNumber];\n }\n\n return false;\n }", "public function column($query, $params = NULL, $key = 0)\n\t{\n\t\tif($statement = $this->query($query, $params))\n\t\t\treturn $statement->fetchColumn($key);\n\t}", "public function column() : int\n {\n return $this->column;\n }", "public function getColumn( $sQuery ){\n $oQuery = $this->query( $sQuery );\n $this->checkQuery( $oQuery );\n return $oQuery->fetchColumn( );\n }", "public function getColumn()\n {\n return $this->get('Column');\n }", "public function column(string $sql, array $params = [])\n {\n $prepared = $this->prepare($sql, $params);\n $this->execute($prepared);\n $result = $prepared['statement']->fetchColumn();\n $prepared['statement']->closeCursor();\n return $result;\n }", "public function getColumn($get)\n\t{\n\t\tif (!array_key_exists($get, $this->row))\n\t\t\tthrow new InternalException(\"row $get doesn't exist\");\n\t\treturn $this->row[$get];\n\t}", "public function column(string $sql, $params = null)\n\t{\n\t\t$columnValue = null;\n\t\t\n\t\ttry {\n\t\t\t$preparedStatement = $this->_instance->prepare($sql);\n\t\t\t$preparedStatement->execute($params);\n\t\t\t$resultSet = $preparedStatement->fetch(PDO::FETCH_ASSOC);\n\t\t\t$columnValue = $resultSet[0];\n\t\t} catch(PDOException $e) {\n\t\t\tthrow new Exception('Could not fetch a record:<br>' . $e->getMessage());\n\t\t}\n\t\t\n\t\treturn $columnValue;\n\t}", "public function getColumn(): string\n {\n return $this->_column;\n }", "public function fetchCol($columnName);", "public function fetchColumn($column_number = 0)\r\n\t{\r\n\t\tif($this->executed == true)\r\n\t\t{\r\n\t\t\tif(!$this->resource && $this->isFetched == false)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new LikePDOStatement(\"There is no active statement\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$result = NULL;\r\n\t\t\r\n\t\tif($this->isFetched == true)\r\n\t\t{\r\n\t\t\tif($this->isFetchAll == true)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(isset($this->columns[$column_number]))\r\n\t\t\t\t{\r\n\t\t\t\t\tswitch($this->fetchResultMode)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase LikePDO::FETCH_ASSOC :\r\n\t\t\t\t\t\t\tif(isset($this->fetch[$this->columns[$column_number]]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn $this->fetch[$this->columns[$column_number]];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_BOTH :\r\n\t\t\t\t\t\t\tif(isset($this->fetch[$this->columns[$column_number]]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn $this->fetch[$this->columns[$column_number]];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_BOUND :\r\n\t\t\t\t\t\t\tif(!$this->fetchColumn)\r\n\t\t\t\t\t\t\t\t$this->fetchColumn = $this->pdo->driver->fetch($this->resource, LikePDO::FETCH_NUM);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(isset($this->fetchColumn[$column_number]))\r\n\t\t\t\t\t\t\t\treturn $this->fetchColumn[$column_number];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_CLASS :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_INTO :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_LAZY :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_NAMED :\r\n\t\t\t\t\t\t\tif(!$this->fetchColumn)\r\n\t\t\t\t\t\t\t\t$this->fetchColumn = $this->pdo->driver->fetch($this->resource, LikePDO::FETCH_NUM);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(isset($this->fetchColumn[$column_number]))\r\n\t\t\t\t\t\t\t\treturn $this->fetchColumn[$column_number];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_NUM :\r\n\t\t\t\t\t\t\tif(isset($this->fetch[$column_number]))\r\n\t\t\t\t\t\t\t\treturn $this->fetch[$column_number];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_OBJ :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!$this->fetchColumn)\r\n\t\t\t\t$this->fetchColumn = $this->pdo->driver->fetch($this->resource, LikePDO::FETCH_NUM);\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(isset($this->fetchColumn[$column_number]))\r\n\t\t\t\treturn $this->fetchColumn[$column_number];\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function getCol($sql){\n\t\t$res_array = $this->query($sql);\n\t\tif (array_key_exists(0, $res_array) AND array_key_exists(0, $res_array[0])){\n\t\t\treturn $res_array[0][0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function fetchColumn($column_number = 0)\n {\n $result = oci_fetch_array($this->sth, OCI_NUM + OCI_RETURN_NULLS);\n\n if ($result === false || !isset($result[$column_number])) {\n return false;\n }\n return $result[$column_number];\n }", "public function getColumn(): string\n {\n return $this->column;\n }", "public function getCurrentSortedColumn()\n {\n return $this->_currentSortedColumn;\n }", "public function fetchColumn($sql, $bind = null)\r\n {\r\n return $this->selectPrepare($sql, $bind)->fetchAll(PDO::FETCH_COLUMN, 0);\r\n }", "public function column($sql, $params = [])\n {\n $result = $this->query($sql, $params);\n return $result->fetchColumn();\n }", "public function getColumn($name)\n {\n return isset($this->columns[$name]) ? $this->columns[$name] : null;\n }", "public function getCol($sql, $data)\n {\n if (!is_array($data)) {\n $data = array($data);\n }\n $result = $this->doQuery($sql, $data)->fetch(PDO::FETCH_ASSOC);\n $this->freeStmt();\n return empty($result) ? NULL : current($result);\n }", "function get_col($query=null,$x=0) {\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query ) {\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; $i < count($this->last_result); $i++ ) {\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public function getColumn($name)\n {\n return $this->columns[$name];\n }", "public function col($columnname)\n\t{\n\t\n\treturn $this->res[$this->pos][$columnname];\n\t/*\n\t\t$type = 0;\n\t\t\n\t\t\n\t\tif($columnname == 'value')$type = 1;\t\n\t\n\t\tif($columnname == 'URI')\n\t\t{\n\t\t$add_SID = '';\n\t\tif(false)$add_SI = 'PHPSESSID=' . htmlspecialchars(session_id()) . '&';\n\t\t\n\t\tif(count($this->jump_address[$type]) > $this->pos)\n\t\treturn '?' . $add_SI . 'i=' . $this->jump_address[0][$this->pos];\n\t\telseif(count($this->jump_address[$type]) == $this->pos)\n\t\treturn '?' . $add_SI . 'i=' . $this->jump_address[$type + 2];\n\t\t}\n\t\t\n\n\t\t\n\t\tif(count($this->jump_address[$type]) > $this->pos)\n\t\t return $this->jump_address[$type][$this->pos];\n\t\telseif(count($this->jump_address[$type]) == $this->pos)\n\t\t return $this->jump_address[$type + 2];\n\t\n\t return null; */\n\t}", "function getRecordCol($index) {\n return $this->records[$index]->getCol();\n }", "public function getColumn(): string;", "public function result_cell($column)\n {\n if (is_bool($this->result))\n {\n return NULL;\n }\n\n $line = $this->result->fetch_assoc();\n\n $this->free_result();\n\n return isset($line[$column]) ? $line[$column] : NULL;\n }", "public static function queryCol($sql)\n\t{\n\t\t$tempResults = self::$link->query($sql);\n\t\t\n\t\tif(!$tempResults)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\t$column = array();\n\t\t\n\t\twhile(!is_null($row = $tempResults->fetch_row()))\n\t\t{\n\t\t\t$column[] = $row[0];\n\t\t}\n\t\t\n\t\t$tempResults->close();\n\t\t\n\t\t//return $tempResults->fetchCol();\n\t\treturn $column;\n\t}", "public function getColumn($query, $col = 0) {\n\t\t$return = array();\n\t\t$result = $this->query($query);\n\t\twhile ($row = $result->fetch_array()) {\n\t\t\t$return[] = $row[$col];\n\t\t}\n\t\t$result->free();\n\t\treturn $return;\n\t}", "public function get_col($query=null, $x=0) {\n\n\t\t// If there is a query then perform it if not then use cached results..\n\t\tif ($query)\n\t\t\t$this->query($query);\n\n\t\t// Extract the column values\n\t\tfor ($i=0; $i < count($this->last_result); $i++)\n\t\t\t$new_array[$i] = $this->get_var(null, $x, $i);\n\n\t\treturn $new_array;\n\t}", "public function getColumn($name)\n {\n foreach ($this->getColumns() as $column) {\n if ($column->getName() === $name) {\n return $column;\n }\n }\n\n }", "public function fetchColumn($column_number = false)\n {\n }", "public function FindCol($col) {\n\t\t$crawler = $this->tail->Next();\n\n\t\tif ($this->tail->Column() === $col) {\n\t\t\treturn $this->tail;\n\t\t}\n\n\t\tif ($this->head->Column() === $col) {\n\t\t\treturn $this->head;\n\t\t}\n\n\t\tfor ($i = 0; $i < $this->count - 1; $i++) {\n\t\t\tif ($crawler->Column() === $col)\n\t\t\t\treturn $crawler;\n\t\t\t$crawler = $crawler->Next();\n\t\t}\n\t\treturn null;\n\t}", "private function fetchColumn($table, $column) {\n\t\t$sql = 'select ' .$column .' from ' .$table;\n\t\t$query = $this->getDB()->prepare($sql);\n\t\tif(!$query->execute()) {\n\t\t\t$info = $query->errorInfo();\n\t\t\tl($info[2]);\n\t\t\treturn false;\n\t\t}\n\t\treturn $query->fetchAll(PDO::FETCH_COLUMN);\n\t}", "public static function queryColWithIndex($sql)\n\t{\n\t\t$tempResults = self::$link->query($sql);\n\t\t\n\t\tif(!$tempResults)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\t$column = array();\n\t\t\n\t\twhile(!is_null($row = $tempResults->fetch_row()))\n\t\t{\n\t\t\t$column[$row[0]] = $row[1];\n\t\t}\n\t\t\n\t\t$tempResults->close();\n\t\t\n\t\t//return $tempResults->fetchCol();\n\t\treturn $column;\n\t}", "public function get_field($row, $col) {\n if ($row >= 0 && $row < $this->data['num_rows'] && $col >= 0 && $col < $this->data['num_fields']) {\n return $this->lines[$row][$col];\n } else {\n return null;\n }\n }", "public function get($column): Column\n {\n if (!$this->exists($column)) {\n throw new Exception\\ColumnNotFoundException(__METHOD__ . \" Column '$column' not present in column model.\");\n }\n\n return $this->columns->offsetGet($column);\n }", "public function offsetGet($columnName)\n {\n $row = current($this->_rows);\n return $row !== false? $row[$columnName] : null;\n }", "public function getCol() : array\n\t{\n\t\treturn $this->fetchAllFromColumn();\n\t}", "public function findColumn(string $column);", "public function getCol($sql, $bind = null)\r\n {\r\n $result = $this->_execute($sql, $bind);\r\n\r\n while ($result->valid())\r\n {\r\n $col[] = $result->fetchSingle();\r\n }\r\n\r\n return $col;\r\n }", "public function getColumn($column)\n {\n return $this->allColumns[$column];\n }", "final public function col():Col\n {\n return $this->table()->col($this->col);\n }", "function get_col($query=null,$x=0)\n\t\t{\n\n\t\t\t$new_array = array();\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; is_array($this->last_result) && $i < count($this->last_result); $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public function testResultGetColumn()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(array('first row', 'next row'), $result->getColumn(2), \"Get column 2\");\n \t$this->assertEquals(array('first row', 'next row'), $result->getColumn('title'), \"Get column 'title'\");\n \t$this->assertEquals(array(1, 2), $result->getColumn(0), \"Get column 0\");\n }", "public function getDataColumn()\n {\n return $this->dataColumn;\n }", "public static function fetchColNum( $rRes, $mField = 0 ) {\n\t\tif ( is_resource( $rRes ) ) {\n\t\t\tmysql_data_seek( $rRes, 0 );\t\t\t// reset pointer\n\t\t\t$aRet = array();\n\t\t\twhile( $aRow = mysql_fetch_array( $rRes ) ) {\n\t\t\t\t$aRet[] = $aRow[ $mField ];\n\t\t\t}\n\t\t\treturn $aRet;\n\t\t}\n\t\treturn NULL;\n\t}", "function GetColVal($col_name) {\n\t\treturn $this->$col_name;\n\t}", "public function queryFetchColAssoc($statement) {\n return $this->connection->query($statement)->fetchColumn(); \n }", "protected function getPositionColumn()\n {\n return $this->positionColumn ?? 'position';\n }", "public function getColumn(int $offset): Vector\n {\n assert($offset < $this->x, new \\OutOfBoundsException());\n\n $column = new Vector();\n $column->allocate($this->y);\n\n foreach ($this->table as $row) {\n $column->push($row->get($offset));\n }\n\n return $column;\n }", "function get_data ($row, $column)\n {\n global $data_array;\n $column_array = array ();\n $column_array = explode (\"\\t\", $data_array[$row]);\n return ($column_array[$column]);\n }", "function get_col( $query = null , $x = 0 ) {\n\t\tif ( $query )\n\t\t\t$this->dbcr_query( $query );\n\n\t\t$new_array = array();\n\t\t// Extract the column values\n\t\tfor ( $i = 0, $j = count( $this->dbcr_wpdb->last_result ); $i < $j; $i++ ) {\n\t\t\t$new_array[$i] = $this->get_var( null, $x, $i );\n\t\t}\n\t\treturn $new_array;\n\t}", "public function get_col($query = \\null, $x = 0)\n {\n }", "private function findColumn($key)\n\t\t{\n\t\t\tif($this->_columns === null || $key == null)\n\t\t\t\treturn null;\n\n\t\t\tforeach($this->_columns as $col)\n\t\t\t\tif($col->getName() == $key)\n\t\t\t\t\treturn $col;\n\n\t\t\treturn null;\n\t\t}", "function yy_r172(){ $this->_retvalue = new Stmt\\Expr('column', $this->yystack[$this->yyidx + 0]->minor); }", "public function get_column($index = 0) {\n\t\t$values = array();\n\t\tforeach ($this->get_rows() as $row) {\n\t\t\t$values[] = $row[$index];\n\t }\n\t return $values;\n\t}", "protected function get_rc()\n\t{\n\t\t$rc = $this->fetchColumn();\n\n\t\t$this->closeCursor();\n\n\t\treturn $rc;\n\t}", "public function value($column)\r\n {\r\n $rs = (array) $this->first();\r\n return $rs[$column];\r\n }", "protected function getOldColumn()\n {\n return $this->oldColumn;\n }", "public function testQueryFetchCol() {\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] > :age', [':age' => 25]);\n $column = $result->fetchCol();\n $this->assertCount(3, $column, 'fetchCol() returns the right number of records.');\n\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] > :age', [':age' => 25]);\n $i = 0;\n foreach ($result as $record) {\n $this->assertSame($column[$i++], $record->name, 'Column matches direct access.');\n }\n }", "public function findColumn(string $column)\n {\n $column = null;\n try {\n $column = $this->model->all()->pluck($column);\n } catch (PDOException $exception) {\n $this->handleException($exception);\n } finally {\n return $column;\n }\n }", "protected function getNewColumn()\n {\n return $this->newColumn;\n }", "public function getColumn($column_id)\n {\n return $this->db->table(self::TABLE)->eq('id', $column_id)->findOne();\n }", "private function getColumn($columnName)\n {\n $columns = array_filter(\n $this->columns,\n function ($column) use ($columnName) {\n return $column->name == $columnName;\n } // end anonymous array filter function\n ); // end arrayfilter\n\n return array_shift(\n $columns\n ); // end array_shift\n }", "public function toColumn() {\r\n\t\treturn $this->PDOStatement->fetchAll(PDO::FETCH_COLUMN,0);\r\n\t}", "public function get() {\n\t\treturn $this->rows[$this->rowIndex];\n\t}", "function get_col($query=null,$x=0, $use_prepare=false)\n\t\t{\n\n\t\t\t$new_array = array();\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query, $use_prepare);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\t$j = count($this->last_result);\n\t\t\tfor ( $i=0; $i < $j; $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public function current()\n {\n return array_combine(\n $this->_colNames,\n count($this->_currentRow) != $this->_colQuantity\n ? array_pad($this->_currentRow, $this->_colQuantity, '')\n : $this->_currentRow\n );\n }", "public function getColumn($name)\n\t{\n\t\t$name = (string)$name;\n\n\t\tif ( !$this->columnExists($name, false) ) {\n\t\t\tthrow new TableException($this,\t$name, TableException::COLUMN_NOT_FOUND);\n\t\t}\n\n\t\treturn $this->columns[$name];\n\t}", "public function value($column)\n {\n $result = (array) $this->first([$column => 1]);\n\n return count($result) > 0 ? $result[$column] : null;\n }", "public static function select_column($query)\n {\n $column = array();\n $rs = self::query($query);\n while (true)\n {\n $values = Db::fetch_row($rs);\n if ($values === false)\n break;\n array_push($column, $values[0]);\n }\n Db::free_result($rs);\n return $column;\n }", "public static function get_column($col)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$devices = DB::table('devices')->get($col);\n\t\t\treturn $devices;\n\t\t}\n\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::write('error', $e->getMessage());\n\t\t\tthrow $e;\t\t\t\n\t\t}\n\t}", "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 }", "private function get($row, $column) {\n return $this->invalid($row, $column) ? self::VALUE_NOT_SET : $this->matrix[$row][$column];\n }", "public function toValue() {\r\n\t\treturn $this->PDOStatement->fetchColumn();\r\n\t}", "public function getColumnById($id) {\n\t\tforeach ($this->columns as $column) {\n\t\t\tif ($column->getId() == $id) {\n\t\t\t\treturn $column;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "protected function _parseColumn() {\n if (empty($this->buffer)) return FALSE;\n\n $tok= $this->_strtok($this->buffer, $this->colDelim);\n\n // Trick: when there is an odd number of escape characters\n // you know that this found delimiter is part of a string inside\n // the payload. Search for the next, until you have an even number \n // of escapers (then all quoted parts are closed).\n while (0 !== substr_count($tok, $this->escape) % 2) {\n $add= $this->colDelim.$this->_strtok($this->buffer, $this->colDelim);\n $tok.= $add;\n }\n\n // Single escape characters become nothing, double escape\n // characters become the escape character itself.\n $tok= trim ($tok);\n $i= 0; $j= 0; $res= '';\n while (FALSE !== ($i= strpos($tok, $this->escape, $j))) {\n if (strlen($tok) > $i+1 && $tok{$i+1} == $this->escape) $i++;\n $res.= substr($tok, $j, $i-$j);\n $j= $i+1;\n }\n \n if (empty($res)) return $tok; else return $res;\n }\n \n /**\n * Read the record and save the result as the header record.\n *\n */ \n public function getHeaderRecord() {\n $this->colName= $this->getNextRecord();\n }\n \n /**\n * Manually set the header information to be able to supply\n * additional information and get nicer output (non-enumerated)\n *\n * @param array headers\n */ \n public function setHeaderRecord($headers) {\n $this->colName= $headers;\n }\n \n /**\n * Retrieves the name of a column if one is available\n *\n * @param int number\n * @return string name or FALSE if none is available\n */\n public function getColumnName($nr) {\n if (!$this->hasHeader()) return FALSE;\n if (!isset($this->colName[$nr])) return FALSE;\n \n return $this->colName[$nr];\n } \n \n /**\n * Read the next record from the stream. This returns a \n * StdClass object with the members named as the header\n * record supposes. When no header was available, the\n * fields are enumerated.\n *\n * @return array data\n * @throws io.IOException if stream operation failed\n */ \n public function getNextRecord() {\n $this->_getNextRecord();\n if (empty($this->buffer)) return FALSE;\n \n $data= array(); $idx= 0;\n while (FALSE !== ($cell= $this->_parseColumn())) {\n if (FALSE !== ($cn= $this->getColumnName($idx))) $data[$cn]= $cell; else $data[$idx]= $cell;\n $idx++;\n }\n\n return $data;\n }\n }" ]
[ "0.7588229", "0.7535507", "0.7368912", "0.7349814", "0.7104362", "0.700907", "0.6980491", "0.6929551", "0.68755525", "0.68660414", "0.68551505", "0.6815733", "0.6815733", "0.68142235", "0.6810806", "0.67779076", "0.67694247", "0.67677987", "0.6733517", "0.67180616", "0.67094296", "0.66862684", "0.6651825", "0.6647998", "0.6643351", "0.6637997", "0.6601773", "0.6575442", "0.6567208", "0.6555906", "0.6526498", "0.6520103", "0.65193415", "0.65133315", "0.64898103", "0.6481736", "0.6477492", "0.64565", "0.64306104", "0.6417133", "0.64042497", "0.6398906", "0.6352753", "0.6350789", "0.6313896", "0.6302392", "0.62893647", "0.62769043", "0.624697", "0.6243596", "0.62408924", "0.62183195", "0.6201732", "0.61816823", "0.6167286", "0.6154113", "0.61510617", "0.6138632", "0.61300987", "0.61274076", "0.6125089", "0.611438", "0.6108705", "0.6100905", "0.6099135", "0.6094149", "0.6091318", "0.60884684", "0.60845596", "0.60831106", "0.60799634", "0.6060173", "0.6027252", "0.60271513", "0.602251", "0.59921", "0.59914184", "0.59908295", "0.5990577", "0.5983891", "0.5978651", "0.59635913", "0.5961927", "0.59486264", "0.5932935", "0.5928114", "0.5917753", "0.59142035", "0.58896065", "0.58753014", "0.5850516", "0.5847828", "0.58292955", "0.58275735", "0.58266133", "0.58225113", "0.5821469", "0.58002865", "0.57999825", "0.57855964" ]
0.5903009
88
Fetch single column from the given row of the result set.
public function fetchOne(int $column = 0, int $rowNumber = 0) { $result = $this->_getResult()->fetchOne($column, $rowNumber); // Returns a string on success and an \PEAR_Error object on failure return is_scalar($result) ? $result : ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetRowColumn($row,$column){\n\t\t\treturn @mysql_result($this->result,$row,\"$column\");\n\t\t}", "public function fetchColumn(int $column = 0);", "public function fetchColumn() {\n if ($this->result === true) {\n return false;\n }\n\n // Are we running PHP >=8.1?\n if (PHP_VERSION_ID >= 80100) {\n $value = $this->result->fetch_column();\n return ($value === null || $value === false) ? $value : (string) $value;\n }\n\n // Fallback to traditional approach\n $row = $this->result->fetch_row();\n return $row ? $row[0] : false;\n }", "public function fetchColumn($columnIndex = 0);", "function Get($col)\n {\n return $this->row ? $this->row[$col] : NULL;\n }", "function Get($col)\n {\n return isset($this->row) ? $this->row[$col] : null;\n }", "public function fetchColumn(int $column = 0) : ?string\n\t{\n\t\treturn $this->handle->fetchColumn($this->result, $column);\n\t}", "public function result_cell($column)\n {\n if (is_bool($this->result))\n {\n return NULL;\n }\n\n $line = $this->result->fetch_assoc();\n\n $this->free_result();\n\n return isset($line[$column]) ? $line[$column] : NULL;\n }", "public function value($column)\r\n {\r\n $rs = (array) $this->first();\r\n return $rs[$column];\r\n }", "public function fetchColumn() {\r\n\t\t$result = array();\r\n\r\n\t\twhile ($data = $this->fetch()) {\r\n\t\t\t$result[] = current($data);\r\n\t\t}\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $result;\r\n\t}", "public function getOne($query, $col = 0) {\n\t\t$result = $this->query($query);\n\t\tif ($result->num_rows < 1) {\n $one = false;\n } else {\n $row = $result->fetch_array();\n $one = $row[$col];\n }\n\t\t$result->free();\n\t\treturn $one;\n\t}", "function FetchRow() {}", "function db_select_one_value( $statement ) {\n\n $this->db_run_query( $statement );\n\n if( $this->db_fetch_next_row( DB_FETCHMODE_ORDERED ) ) $this->db_fetch_next_col();\n\n return $this->curr_col_value;\n }", "public function get_field($row, $col) {\n if ($row >= 0 && $row < $this->data['num_rows'] && $col >= 0 && $col < $this->data['num_fields']) {\n return $this->lines[$row][$col];\n } else {\n return null;\n }\n }", "public function fetchRow();", "public function executeSQLReturnOneValue($stmt) {\n try {\n //execute the query\n $stmt->execute();\n $value = $stmt->fetchColumn();\n } catch(PDOException $e) {\n die(\"Query failed: \" . $e->getMessage());\n }\n return $value;\n }", "public function getOne() {\n $prepareStatement = $this->pdo->prepare($this->sql);\n $prepareStatement->execute($this->param);\n\n Connection::disconnect();\n\n if ($this->fetch !== PDO::FETCH_CLASS) {\n if (1 == $prepareStatement->columnCount())\n return $prepareStatement->fetch(PDO::FETCH_COLUMN);\n return $prepareStatement->fetch($this->fetch);\n }\n\n return $prepareStatement->fetchObject();\n }", "public function fetchColumn($column_number = 0) {\n\t\t$row = $this->fetch(PDO::FETCH_NUM);\n\t\tif( empty($row) || empty($row[$column_number])) return false;\n\t\treturn $row[$column_number];\n\t}", "public function value($column)\n {\n $result = (array) $this->first([$column => 1]);\n\n return count($result) > 0 ? $result[$column] : null;\n }", "function getCol($sql){\n\t\t$res_array = $this->query($sql);\n\t\tif (array_key_exists(0, $res_array) AND array_key_exists(0, $res_array[0])){\n\t\t\treturn $res_array[0][0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function fetchColumn($column_number = 0)\r\n\t{\r\n\t\tif($this->executed == true)\r\n\t\t{\r\n\t\t\tif(!$this->resource && $this->isFetched == false)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new LikePDOStatement(\"There is no active statement\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$result = NULL;\r\n\t\t\r\n\t\tif($this->isFetched == true)\r\n\t\t{\r\n\t\t\tif($this->isFetchAll == true)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(isset($this->columns[$column_number]))\r\n\t\t\t\t{\r\n\t\t\t\t\tswitch($this->fetchResultMode)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase LikePDO::FETCH_ASSOC :\r\n\t\t\t\t\t\t\tif(isset($this->fetch[$this->columns[$column_number]]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn $this->fetch[$this->columns[$column_number]];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_BOTH :\r\n\t\t\t\t\t\t\tif(isset($this->fetch[$this->columns[$column_number]]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn $this->fetch[$this->columns[$column_number]];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_BOUND :\r\n\t\t\t\t\t\t\tif(!$this->fetchColumn)\r\n\t\t\t\t\t\t\t\t$this->fetchColumn = $this->pdo->driver->fetch($this->resource, LikePDO::FETCH_NUM);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(isset($this->fetchColumn[$column_number]))\r\n\t\t\t\t\t\t\t\treturn $this->fetchColumn[$column_number];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_CLASS :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_INTO :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_LAZY :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_NAMED :\r\n\t\t\t\t\t\t\tif(!$this->fetchColumn)\r\n\t\t\t\t\t\t\t\t$this->fetchColumn = $this->pdo->driver->fetch($this->resource, LikePDO::FETCH_NUM);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(isset($this->fetchColumn[$column_number]))\r\n\t\t\t\t\t\t\t\treturn $this->fetchColumn[$column_number];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_NUM :\r\n\t\t\t\t\t\t\tif(isset($this->fetch[$column_number]))\r\n\t\t\t\t\t\t\t\treturn $this->fetch[$column_number];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_OBJ :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!$this->fetchColumn)\r\n\t\t\t\t$this->fetchColumn = $this->pdo->driver->fetch($this->resource, LikePDO::FETCH_NUM);\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(isset($this->fetchColumn[$column_number]))\r\n\t\t\t\treturn $this->fetchColumn[$column_number];\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function FetchRow() {\n\t\t\treturn pg_fetch_row($this->result);\n\t\t}", "function sql_result($res, $row = 0, $col = 0)\n {\n $results = array();\n if (intval($row) < 1) {\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results[$col];\n }\n else {\n for ($i = 0; $i < intval($row); $i++) {\n $results = $res->fetch(PDO::FETCH_BOTH);\n }\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results[$col];\n }\n }", "private function fetchColumn($table, $column) {\n\t\t$sql = 'select ' .$column .' from ' .$table;\n\t\t$query = $this->getDB()->prepare($sql);\n\t\tif(!$query->execute()) {\n\t\t\t$info = $query->errorInfo();\n\t\t\tl($info[2]);\n\t\t\treturn false;\n\t\t}\n\t\treturn $query->fetchAll(PDO::FETCH_COLUMN);\n\t}", "public function fetchColumn ($index) {\n return $this->query->fetchColumn($index);\n }", "public function fetchCol($columnName);", "public function column(string $sql, $params = null)\n\t{\n\t\t$columnValue = null;\n\t\t\n\t\ttry {\n\t\t\t$preparedStatement = $this->_instance->prepare($sql);\n\t\t\t$preparedStatement->execute($params);\n\t\t\t$resultSet = $preparedStatement->fetch(PDO::FETCH_ASSOC);\n\t\t\t$columnValue = $resultSet[0];\n\t\t} catch(PDOException $e) {\n\t\t\tthrow new Exception('Could not fetch a record:<br>' . $e->getMessage());\n\t\t}\n\t\t\n\t\treturn $columnValue;\n\t}", "public function exec_SELECTgetSingleRow() {}", "private function get($row, $column) {\n return $this->invalid($row, $column) ? self::VALUE_NOT_SET : $this->matrix[$row][$column];\n }", "function GetColVal($col_name) {\n\t\treturn $this->$col_name;\n\t}", "abstract public function FetchRow();", "public function getColumnValue(array $row)\n {\n if (!array_key_exists($this->column, $row)) {\n throw new RuleColumnMissingException($this->column);\n }\n\n return $row[$this->column];\n }", "function ms_fetch_single_cell($mysql_result)\n{\n\t$res = $mysql_result->fetch_array(MYSQLI_NUM);\n\tif ( $res && sizeof($res) == 1)\n\t\treturn $res[0];\n\treturn null;\n}", "public function fetchColumn($column_number = 0)\n {\n $result = oci_fetch_array($this->sth, OCI_NUM + OCI_RETURN_NULLS);\n\n if ($result === false || !isset($result[$column_number])) {\n return false;\n }\n return $result[$column_number];\n }", "public function singleRow(){\n $this->execute();\n return $this->statement->fetch(PDO::FETCH_OBJ);\n }", "public function queryFetchColAssoc($statement) {\n return $this->connection->query($statement)->fetchColumn(); \n }", "function pdo_result($stmt, $row, $field=0) {\r\n \r\n // Scroll to and retrieve the given $row (maybe it's buffered even)\r\n if (PDO_SEEKABLE) {\r\n $rows = array(\r\n $row => pdo_stmt($stmt)->fetch(PDO::FETCH_BOTH, PDO::FETCH_ORI_ABS, $row)\r\n );\r\n }\r\n \r\n // workaround: fetch everything, works just once\r\n else {\r\n pdo_trigger_error(\"pdo_result() Can currently only be used once, for fetching a value from the first \\$row. Scrolling only works with PDO_SEEKABLE enabled.\", E_USER_WARNING);\r\n\r\n $rows = pdo_stmt($stmt)->fetchAll(PDO::FETCH_BOTH);\r\n #static $rows[hash(stmt)]; //would otherwise bind the result set here\r\n }\r\n \r\n // check if found\r\n if (isset($rows[$row][$field])) {\r\n return $rows[$row][$field];\r\n }\r\n else {\r\n pdo_trigger_error(\"pdo_result() Couldn't find row [$row] and column `$field`.\", E_USER_NOTICE);\r\n }\r\n \r\n }", "public function fetchColumn(\\PDO $pdo, $sql, array $params = array())\n\t{\n\t\treturn $this->runStatement($pdo, $sql, $params)->fetchColumn();\t\t\n\t}", "function one_col_value($conn,$col_name,$table_name,$user_id,$return_col)\r\n\t{\r\n\t\t$qry=\"select * from $table_name where $col_name='$user_id'\";\r\n\t\t//echo $qry;\r\n\t\t$res=mysql_query($qry);\r\n\t\tif($res){\r\n\t\t\t $result=mysql_fetch_array($res);\r\n\t\t\t return $result[$return_col];\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn \"0\";\r\n\t\r\n\t}", "public function fetch()\n {\n $row = oci_fetch_row($this->statement);\n return $row;\n }", "public function fetch() {\n\t\t$this->checkResultSet();\n\t\treturn $this->fetchRowAssoc();\n\t}", "public function testResultGetColumn()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(array('first row', 'next row'), $result->getColumn(2), \"Get column 2\");\n \t$this->assertEquals(array('first row', 'next row'), $result->getColumn('title'), \"Get column 'title'\");\n \t$this->assertEquals(array(1, 2), $result->getColumn(0), \"Get column 0\");\n }", "protected function fetch_row()\n\t{\n\t\treturn $this->resResult->fetch(PDO::FETCH_NUM);\n\t}", "function mysqli_result($res, $row, $field=0) {\n $res->data_seek($row);\n $datarow = $res->fetch_array();\n return $datarow[$field];\n}", "function get_data ($row, $column)\n {\n global $data_array;\n $column_array = array ();\n $column_array = explode (\"\\t\", $data_array[$row]);\n return ($column_array[$column]);\n }", "public abstract function FetchRow();", "function fetch_single($res)\n {\n $row=mysqli_fetch_row($res);\n if(!$row)\n {\n die(\"database error:\".mysqli_error($res));\n }\n return $row[0];\n }", "public function fetchOne(int $columnNumber = 0);", "public function getColumn( $sQuery ){\n $oQuery = $this->query( $sQuery );\n $this->checkQuery( $oQuery );\n return $oQuery->fetchColumn( );\n }", "public function column(string $sql, array $params = [])\n {\n $prepared = $this->prepare($sql, $params);\n $this->execute($prepared);\n $result = $prepared['statement']->fetchColumn();\n $prepared['statement']->closeCursor();\n return $result;\n }", "public static function queryCol($sql)\n\t{\n\t\t$tempResults = self::$link->query($sql);\n\t\t\n\t\tif(!$tempResults)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\t$column = array();\n\t\t\n\t\twhile(!is_null($row = $tempResults->fetch_row()))\n\t\t{\n\t\t\t$column[] = $row[0];\n\t\t}\n\t\t\n\t\t$tempResults->close();\n\t\t\n\t\t//return $tempResults->fetchCol();\n\t\treturn $column;\n\t}", "public function column($query, $params = NULL, $key = 0)\n\t{\n\t\tif($statement = $this->query($query, $params))\n\t\t\treturn $statement->fetchColumn($key);\n\t}", "public function fetchRow($result_set)\n\t{\n\t\treturn $result_set->fetch_row();\n\t}", "function get_column( $query, $col_offset = 0 )\n\t{\n\t\t$num_rows = $this->query( $query );\n\t\t\n\t\tif( $num_rows === FALSE )\n\t\t\treturn FALSE;\n\t\t\n\t\t//grab handle of the call we just made\n\t\t$handle = $this->get_handle();\n\t\t\n\t\t//init final output array\n\t\t$rows = array();\n\t\t\n\t\twhile( ($row = mysql_fetch_row($handle)) !== FALSE )\n\t\t\tarray_push( $rows, $row[$col_offset] );\n\t\t\n\t\t//clean up the query in memory\n\t\tmysql_free_result( $handle );\n\t\t\n\t\t//return the result\n\t\treturn $rows;\n\t}", "protected function getOne()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetch($statement);\n }", "public function toValue() {\r\n\t\treturn $this->PDOStatement->fetchColumn();\r\n\t}", "public function fetchColumn(int $column = 0): array\n {\n $result = $this->_getResult()->fetchCol($column); // Returns an array on success and an \\PEAR_Error object on failure\n return is_array($result) ? $result : array();\n }", "public function testQueryFetchCol() {\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] > :age', [':age' => 25]);\n $column = $result->fetchCol();\n $this->assertCount(3, $column, 'fetchCol() returns the right number of records.');\n\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] > :age', [':age' => 25]);\n $i = 0;\n foreach ($result as $record) {\n $this->assertSame($column[$i++], $record->name, 'Column matches direct access.');\n }\n }", "public function fetch_one()\n {\n if (!$this->limit) $this->limit(1);\n $rows = $this->fetch_all();\n return count($rows) ? array_shift($rows): null;\n }", "public function fetchOne() {\r\n\t\t$data = $this->fetch();\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $data ? current($data) : null;\r\n\t}", "function mysqli_result($res, $row, $field=0) { \n $res->data_seek($row); \n $datarow = $res->fetch_array(); \n return $datarow[$field]; \n }", "function mysqli_result($result, $row, $field = 0) {\n $result->data_seek($row);\n // Fetch result array\n $data = $result->fetch_array();\n \n return $data[$field];\n }", "public function fetchColumn($columnNumber = 0)\n {\n $row = $this->fetch();\n if ($row) {\n return $row[$columnNumber];\n }\n\n return false;\n }", "public function fetchRow()\n\t{\n\t\t$this->_query();\n\n\t\treturn $this->stmt->fetch(\\PDO::FETCH_ASSOC);\n\t}", "function fetchRow ()\n {\n return pg_fetch_array($this->_result);\n }", "public function fetchColumn($sql, $params = [])\n {\n $stmt = $this->dbConn->prepare($sql, [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]);\n $stmt->execute($params);\n\n return $stmt->fetchColumn();\n }", "protected function db_fetch_row($result)\n {\n return $result->fetch_row();\n }", "public function fetch_row()\n {\n return $this->fetch_assoc();\n }", "public function one($sql, $col = 0) {\n return $this->oneFromArray($this->rowx($sql, true), $col);\n }", "public function fetch_row() {\n\t\tif ($this->opencursor === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$row = $this->opencursor->fetch(PDO::FETCH_ASSOC);\n\t\tif ($row === false) {\n\t\t\t$this->close_open_cursor();\n\t\t\treturn false;\n\t\t}\n\t\treturn $row;\n\t}", "public function fetchSingleRow($result){\r\n\t\t\r\n\t\t$row = mysqli_fetch_assoc($result);\r\n\t\treturn $row;\r\n\t}", "public function getCellValue($row);", "function getValueFromField()\r\n\t{\r\n\t\treturn $this->row[ key( $this->mapping ) ];\r\n\t}", "public function GetColumn($index = NULL)\r\n {\r\n return($this->preparedStatement->fetchColumn($index));\r\n }", "function get_col($query=null,$x=0) {\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query ) {\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; $i < count($this->last_result); $i++ ) {\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public function fetch_row($row=0)\n {\n if(is_resource($this->resource) && is_int($row))\n {\n return pg_fetch_row($this->resource, $row);\n }\n else\n {\n return false;\n }\n }", "public function getColumn($column_id)\n {\n return $this->db->table(self::TABLE)->eq('id', $column_id)->findOne();\n }", "protected function row($row)\n { \n return DB::table($this->table)\n ->where('personal_access_client', 0)\n ->first()\n ->$row;\n }", "public function testResultFetchValueColumn()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test\");\n \t$this->assertEquals('first row', $result->fetchValue(2), \"Fetch column 2: \");\n \t$this->assertEquals('next row', $result->fetchValue('title'), \"Fetch column 'title': \");\n \t$this->assertEquals(3, $result->fetchValue(0), \"Fetch column 0: \");\n \t$this->assertNull($result->fetchValue(2));\n\n \t$result->resetPointer();\n \t$this->assertEquals('first row', $result->fetchValue(2), \"Fetch column 2 after reset pointer: \");\n }", "public function findColumn(string $column)\n {\n $column = null;\n try {\n $column = $this->model->all()->pluck($column);\n } catch (PDOException $exception) {\n $this->handleException($exception);\n } finally {\n return $column;\n }\n }", "function mysqli_result($result, $row, $field = 0) {\n // Adjust the result pointer to that specific row\n $result->data_seek($row);\n // Fetch result array\n $data = $result->fetch_array();\n \n return $data[$field];\n}", "public function getColumn() { return $this->column; }", "function db_get_row($result)\n{\n\treturn $result->fetch_assoc();\n}", "public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}", "public function getValue($row, $attribute = null)\n {\n $attribute = $attribute ?? $this->attribute;\n\n if ($this->resolveCallback) {\n $value = $this->resolveAttribute($row, $attribute);\n return call_user_func($this->resolveCallback, $value, $row, $attribute);\n }\n\n return $this->resolveAttribute($row, $attribute);\n }", "public function sql_fetch_row($result) {\n return @mysql_fetch_row($result);\n }", "public function fetch_row()\r\n{\r\n\t$tmp2 = $this->_result->fetch_row();\r\n\t$this->type = 1; // MYSQLI_ASSOC = 0, MYSQLI_NUM = 1, or MYSQLI_BOTH (To implement). \r\n\t$this->push_in($tmp2);\r\n\t\r\n\treturn $tmp2;\r\n}", "public function fetch(&$statement)\n {\n return $this->db_handler->fetchSingleRow($statement);\n }", "public function get_row() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->get_rows();\n\t\t}\n\t\t$value = current($this->rows);\n\t\tnext($this->rows);\n\t\treturn $value;\n\t}", "public function getResult() : ?string\n\t{\n\t\treturn $this->fetchColumn();\n\t}", "public function get($column)\n {\n $this->initialize();\n if (array_key_exists($column, $this->columns)) {\n $accessor = '__get' . str_replace(' ', '', ucwords(str_replace(array('-', '_'), ' ', $column)));\n return method_exists($this, $accessor) ? $this->{$accessor}() : $this->data[$column];\n }\n throw new Exception\\InvalidArgumentException('Not a valid column in this row: ' . $column);\n }", "public function fetchColumn($column_number = false)\n {\n }", "public function fetchOne($sql)\n\t{\n\t\t$row = fetchAll($sql);\n\t\treturn array_shift($row);\n\t}", "function fetchRow() {\r\n if($this->getNumRows() > 0)\r\n return mysql_fetch_array($this->m_Result);\r\n else\r\n return false;\r\n }", "function mysqli_result($result, $row, $field = 0) {\r\n $result->data_seek($row);\r\n // Fetch result array\r\n $data = $result->fetch_array();\r\n \r\n return $data[$field];\r\n}", "protected function getValue( $column ) {\n\t\tif( $this->isDirty() ) { $this->executeQuery(); }\n\n\t\tif( count( $this->_recordset ) == 0 )\n\t\t\tthrow new Exception( \"Attempting to access property \\\"{$column}\\\" in empty recordset.\" );\n\n\t\tif( ! array_key_exists( $this->_currentRow, $this->_recordset ) )\n\t\t\tthrow new Exception( \"Attempting to access property \\\"{$column}\\\" at unkown recordset offset \\\"{$this->_currentRow}\\\".\" );\n\n\t\t//If it's an actual boolean field, return the cooresponding php boolean value\n\t\tif( $this->getTable()->getColumn( $column )->getDataType() == DATA_TYPE_BOOL ) {\n\t\t\tif( $this->_recordset[ $this->_currentRow ][ $column ] == Kwerry::true() ) {\n\t\t\t\treturn true;\n\t\t\t} else if( $this->_recordset[ $this->_currentRow ][ $column ] == Kwerry::false() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn( $this->_recordset[ $this->_currentRow ][ $column ] );\n\t}", "function GetField($field=0){\n\t\t\treturn @mysql_result($this->result,0,$field);\n\t\t}", "private function queryFetchAsValue(mysqli_result $result)\n\t{\n\t\t$element = $result->fetch_row();\n\t\treturn $element ? $element[$result->field_count - 1] : null;\n\t}", "public function fetchField($result = false, $offset = 0){\n $this->resCalc($result);\n return mysql_fetch_field($result, $offset);\n }", "public function fetch_value($name=null)\n {\n $row = $this->fetch_one();\n\n if (!$row->is_empty())\n {\n if (!is_null($name))\n return $row->$name;\n\n return $row->values()->get(0);\n }\n\n return null;\n }" ]
[ "0.7889324", "0.7539398", "0.7342854", "0.7144077", "0.69778484", "0.68681407", "0.68555975", "0.6829767", "0.671859", "0.6628352", "0.657481", "0.6499783", "0.64283055", "0.64239275", "0.64185816", "0.63999856", "0.6399425", "0.63932717", "0.63919514", "0.6365539", "0.6364846", "0.6342184", "0.6341771", "0.6332891", "0.63160676", "0.6315709", "0.6309745", "0.62959415", "0.62807894", "0.62733585", "0.6261534", "0.62359726", "0.622147", "0.62187433", "0.6215964", "0.6212586", "0.61996144", "0.61822677", "0.6167643", "0.6150047", "0.614628", "0.61407965", "0.61382383", "0.61316025", "0.61255836", "0.61145943", "0.6110525", "0.6103697", "0.610097", "0.6086348", "0.60861224", "0.6085297", "0.60785633", "0.6074319", "0.6073524", "0.60656524", "0.60649836", "0.6060473", "0.6059122", "0.6057089", "0.60570353", "0.605556", "0.60553545", "0.60489255", "0.60485935", "0.6045913", "0.6037523", "0.602753", "0.6023849", "0.60171103", "0.6012914", "0.60060656", "0.5999354", "0.599068", "0.5988737", "0.5986637", "0.5982248", "0.5979896", "0.5952444", "0.5951069", "0.5949254", "0.5939141", "0.5934664", "0.5934159", "0.5930917", "0.5928706", "0.5922816", "0.5921806", "0.5909964", "0.5903302", "0.5901689", "0.5880076", "0.58756584", "0.5873851", "0.5870166", "0.5865448", "0.5863975", "0.58637464", "0.58636516", "0.58598685" ]
0.62019604
36
/ A membership can have many renovations
public function Renovation(){ return $this->hasMany('renovacion','membresia_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cicleinscription_get_vacancies_remaning(){\n\t\n}", "public function invitationsRecus() {\n \n return DB::table('invitation')\n ->where('emetteur_id', $this->id)\n ->where('recepteur_id', Auth::User()->id)\n ->where('status', 0)\n ->exists();\n\n }", "public function rents(){\n return $this->belongsToMany(Rent::class);\n }", "public function testHasMany()\n {\n $plan = $this->factory(Plan::class)->create();\n\n $this->factory(Member::class, 3)\n ->state(PremiumMember::class)\n ->create(['plan_id' => $plan->id]);\n\n $this->factory(Member::class)\n ->state(RegularMember::class)\n ->create(['plan_id' => $plan->id]);\n\n $this->assertCount(3, $plan->members->filter(function ($member) {\n return $member instanceof PremiumMember;\n }));\n\n $this->assertCount(1, $plan->members->filter(function ($member) {\n return $member instanceof RegularMember;\n }));\n }", "function getCompatibleCandidates($searchee = array(), $criteria=array(), $limit=-1){\t\r\n\t\t$action=\"profile_search\";\r\n\t\t$registered_date=null;\r\n\t\tforeach($criteria as $key=>$value){ //plugs variables to place\r\n\t\t\tif ($key==\"action\"){\r\n\t\t\t\t$action = $value;\r\n\t\t\t}else if ($key==\"registered_date\"){\r\n\t\t\t\t$registered_date = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($action==\"searchbydateprofile\"){\r\n\t\t\t\r\n\t\t\t$condition = array(\"DATE(Member.created) = '\".$registered_date.\"'\",\r\n\t\t\t\t\t\t\t\t \"gender_id\"=>$searchee[\"Member\"][\"looking_for_id\"], \"Member.id <> \".$searchee[\"Member\"][\"id\"]);\r\n\t\t\t\r\n\t\t}else if ($action==\"all\"){\r\n\t\t\t$condition = array(\"gender_id\"=>$searchee[\"Member\"][\"looking_for_id\"], \"Member.id <> \".$searchee[\"Member\"][\"id\"]);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t}\r\n\t\t$this->controller->Member->unbindModel(array(\"hasMany\"=>array(\"GiftAvailTransaction\", \"Notification\", \"CreditCard\", \"PrivateMessage\", \"SentGift\", \"SubscriptionTransaction\", \"MemberProfileAnswer\", \"Album\", \"InMyOwnWordsAnswer\", \"MembersInterest\", \"Connection\", \"ReceiveMessage\", \"ShoppedItem\")));\r\n\t\tif ($limit==-1){ \r\n\t\t\t$members = $this->controller->Member->find(\"all\", \r\n\t\t\t\t\t\tarray(\"conditions\"=>$condition));\r\n\t\t}else{\r\n\t\t\t$members = $this->controller->Member->find(\"all\", array(\"conditions\"=>$condition, \"limit\"=>$limit));\t\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$matches = array();\r\n\t\tforeach ($members as $member){\r\n\r\n\t\t\t$passed = true;\r\n\t\t\tif (isset($searchee[\"MemberSetting\"])){\r\n\t\t\t\tif ($this->validAge($searchee,$member)&&$this->validDistance($searchee,$member)){\r\n\t\t\t\t\t$passed = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$passed = true;\r\n\t\t\t}\r\n\t\t\tif ($passed){\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t$data[\"Match\"][\"matched_id\"] = $member[\"Member\"][\"id\"];\r\n\t\t\t\t$data[\"Match\"][\"member_id\"] = $searchee[\"Member\"][\"id\"];\r\n\t\t\t\t$data[\"Match\"][\"compatibility\"] = $this->getCompatibilityByWeight ($searchee, $member);\r\n\t\t\t\tif ($data[\"Match\"][\"compatibility\"]!=0){\r\n\t\t\t\t\t$matches[] = $this->controller->Match->save_match($data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $matches;\t\r\n\t\t\r\n\t}", "public function getCandidats();", "public function recomendaciones(){\n\t\treturn $this->hasMany('App\\Recomendacion', 'Rec_ID_Asp');\n\t}", "public function participantsByRole( $name )\n{\n $results = array();\n foreach ( $this->participants as $participant ) { \n foreach ($participant->roles as $role) { \n if( $participant->hasRole($name) ){\n $results[] = $participant;\n }\n }\n }\n return $results;\n}", "public function restaurents()\n {\n return $this->hasMany(Restaurent::class);\n }", "public function getReviews()\n {\n return $this->hasMany(Review::className(), ['CommissionID' => 'CommissionID']);\n }", "public function canBeReincorporated()\n {\n return count(StudentFreePeer::retrieveCurrentAndIsFree(null, $this->getId())) > 0;\n\n }", "public function hasIsResell(){\n return $this->_has(7);\n }", "function setup_roles_and_memberships(){\n $data_node = load_csv('node', get_csv_data_filepath('mt_memberships', 'node'));\n $data_uc_products = load_csv('uc_products', get_csv_data_filepath('mt_memberships', 'uc_products'));\n $data_uc_product_features = load_csv('uc_product_features', get_csv_data_filepath('mt_memberships', 'uc_product_features'));\n $data_uc_roles_products = load_csv('uc_roles_products', get_csv_data_filepath('mt_memberships', 'uc_roles_products'));\n \n for($row=1;$row<=count($data_uc_products['uc_products']);$row++){\n create_membership_and_role(\n $data_node['node'][$row],\n $data_uc_products['uc_products'][$row],\n $data_uc_product_features['uc_product_features'][$row],\n $data_uc_roles_products['uc_roles_products'][$row]);\n }\n }", "public function contract_belongs_to_many_participants()\n {\n $this->assertEquals(self::$contract->participants, self::$contract->participant()->count());\n }", "public function membershipAction()\n {\n $common = $this->getServiceLocator()->get('Application\\Model\\Common');\n $api_url = $this->getServiceLocator()->get('config')['api_url']['value'];\n $data = array('status_id' => 1, 'subscription_end_date' => date('Y-m-d', strtotime('+2 days'))); // 2days before subscription end\n $results = $common->subscriptionData($api_url, $data);\n if (count($results) > 0) {\n foreach ($results as $detail) {\n // Start :- Auto renew subscription\n if ($detail['auto_renewal'] == '1') {\n $this->autorenewcodeAction($api_url,$common,$detail);\n // End :- Auto renew subscription\n } \n }\n }\n die;\n }", "public function skiApprovals()\n {\n return $this->hasMany('App\\Models\\SkiApproval', 'regno', 'personnel_no');\n }", "public function hasProfession(){\n return $this->_has(6);\n }", "public function testAssociationClienteVehiculoRuta()\n {\n\n $this->assertTrue($vehiculo->rutas->contains(['origen'=>'calle 1','destino'=>'calle 2']));\n $this->assertTrue($cliente->rutas->contains(['origen'=>'calle 1','destino'=>'calle 2']));\n\n }", "public function getMembership(bool $renew = false): MemberRepositoryInterface;", "public function rebeccareviews()\n {\n return $this->hasMany(RebeccaReview::class);\n }", "public function hasRecruitments() {\n return $this->_has(4);\n }", "public function ratereviewpromotion() {\n\n $sessionstaff = $this->Session->read('staff');\n $options6['conditions'] = array('Promotion.clinic_id' => $sessionstaff['clinic_id'], 'Promotion.is_global' => 0,'Promotion.default'=>2,'Promotion.is_lite'=>0);\n $Promotionlist = $this->Promotion->find('all', $options6);\n $this->set('promotionlist', $Promotionlist);\n //function to check access control for practice staff\n if($sessionstaff['staff_role']=='Doctor' && $sessionstaff['staffaccess']['AccessStaff']['rate_review']==1){\n \n }else{\n $this->render('/Elements/access');\n }\n }", "public function add_membership()\n {\n $this->modify_object('Booking_membership');\n }", "public function Membership()\n {\n return $this->hasMany('App\\Models\\Membership');\n }", "public function reviewed() {\n return $this->morphMany(Review::class, 'reviewer');\n }", "public function evaluations()\n {\n return $this->belongsToMany('App\\Evaluation');\n }", "public static function processList($list){\n\t\t\n\t\tglobal $db; \n\t\t\t\t\n\t\tfor ($i=0; $i<count($list); $i++){\n\t\t\t//check if ranking person is a recruiter\n\t\t\t$member_id = $list[$i]['id'];\n\t\t\t$isRecruiter = getDataFromDB::isRecruiter($member_id);\n\t\t\t//check for errors\n\t\t\tif ($isRecruiter != 0 and $isRecruiter != 1){\n\t\t\t\treturn $isRecruiter;\n\t\t\t}\n\t\t\t//recruiter\n\t\t\telse if ($isRecruiter == 1){\n\t\t\t\t//set query\n\t\t\t\t$query_text = \"SELECT recruiter_reliability FROM recruiters WHERE \n\t\t\t\trecruiter_id = :member_id\"; \n\t\t\t}\n\t\t\t//regular user\n\t\t\telse{\n\t\t\t\t$query_text = \"SELECT user_reliability FROM users WHERE user_id = :member_id\"; \n\t\t\t}\n\t\t\ttry {\n\t\t\t\t//prepare query\t\t\n\t\t\t\t$query_statement = $db->prepare($query_text);\n\t\t\t\t//bind\n\t\t\t\t$query_statement->bindValue(':member_id', $member_id); \n\t\t\t\t//execute query\n\t\t\t\t$query_statement->execute();\n\t\t\t\t//fetch results\n\t\t\t\t$result = $query_statement->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t//check reliability \n\t\t\t\tif ($isRecruiter == 1){\n\t\t\t\t\t$reliability = $result['recruiter_reliability'];\n\t\t\t\t}\n\t\t\t\telse if ($isRecruiter == 0){\n\t\t\t\t\t$reliability = $result['user_reliability'];\n\t\t\t\t}\n\t\t\t\t//remove unreliable users\n\t\t\t\tif ($reliability <= getDataFromDB::reliabilityLimit){\n\t\t\t\t\tunset($list[$i]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch (PDOException $ex) {\n\t\t\t$error_message = $ex->getMessage();\n\t\t\t$result = array('error_message' => $error_message);\n\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$index = 0; \n\t\tforeach ($list as $k => $v){\n\t\t\tif ($index != $k){\n\t\t\t\t$list[$index] = $list[$k];\n\t\t\t\tunset($list[$k]);\n\t\t\t}\n\t\t\t$index++;\n\t\t}\n\t\t\n\t\treturn array('list' => $list); \n\t}", "public function show_memberships()\n {\n $this->show_objects('Booking_membership');\n }", "public function ansprechpartner()\n {\n return $this->hasMany(Ansprechpartner::class, 'KUNU', 'KUNU');\n }", "public function getVacations()\n {\n return $this->hasMany(Vacation::className(), ['id' => 'id']);\n }", "public function rois()\n\t{\n\t\t\n\t\treturn $this->hasMany(ROI::class, \"investment_id\", \"id\");\n\t\t\n\t}", "function etc_memberships() {\n return ETC_Memberships::instance();\n}", "public function reservaciones()\n {\n return $this->hasMany('App\\Models\\Reservaciones');\n }", "public function hasProfession(){\n return $this->_has(20);\n }", "private function getSubscription()\n {\n $members = [];\n $page = 1;\n while(count($members) > 0 || $page === 1) {\n $members = $this->mangopay->listUsers($page);\n foreach ($members as $member) {\n if ($member->Email === '[email protected]') {\n // check wallet\n $wallets = $this->mangopay->listWallets($member->Id);\n foreach ($wallets as $wallet) {\n if ($wallet->Balance->Amount > 10) {\n $this->createUserSubscription($member->Id, $wallet);\n return true;\n }\n }\n }\n }\n $page++;\n }\n\n return false;\n }", "public function remision(){\n\n return $this->hasMany('App\\Models\\Remision', 'id_usuario_paciente', 'id_usuario');\n }", "public function getEstatusRequerimientoRequerimientos()\n {\n return $this->hasMany(EstatusRequerimientoRequerimiento::className(), ['id_estatus_requerimiento' => 'id_estatus_requerimiento']);\n }", "public function members()\n {\n \treturn $this->hasMany('App\\Member');\n }", "public function review()\n {\n return $this->belongsToMany(\n 'PMW\\Models\\Proposal',\n 'review',\n 'id_pengguna',\n 'id_proposal')\n ->withPivot('tahap', 'komentar', 'id');\n }", "function view() {\r\n global $tmpl;\r\n $tmpl->setAttribute('list','visibility','visible');\r\n\r\n $sql=\"SELECT *\r\n FROM student_researchers\r\n ORDER BY last\";\r\n global $db;\r\n $researchers = $db->getAll($sql);\r\n\r\n // determine how many projects are associated with this resarcher\r\n foreach($researchers as $key=>$researcher) {\r\n $sql = \"SELECT COUNT(*) AS numprojects FROM student_research WHERE studentResearcherID = \" . $researcher['id'];\r\n $numProjects = $db->getRow($sql);\r\n $researchers[$key]['numprojects'] = $numProjects['numprojects'];\r\n }\r\n\r\n if(count($researchers)>0){\r\n $tmpl->addRows('mainlist',$researchers);\r\n }\r\n}", "function getReviewers() {\n $strQuery = \"SELECT * FROM `users` WHERE `user_status` like '%Reviewer%'\";\n\n return $this->query($strQuery);\n }", "public function actionReviewer()\n {\n $searchModel = new ModuleSearch();\n \n /* show only modules owned by loggedin user list view */\n $qParams = Yii::$app->request->queryParams;\n $qParams['ModuleSearch']['reviewer_id'] = Yii::$app->user->getId();\n $dataProvider = $searchModel->search($qParams);\n\n return $this->render('reviewer', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function religion()\n {\n return $this->hasOne(Religion::class , 'id' , 'religions_id');\n }", "public function invigilators()\n {\n return $this->belongsToMany(Professor::class, 'timetable_schedule_invigilators', 'timetable_schedule_id', 'invigilator_id');\n }", "public function getRecommendations();", "public function findAllParticipantsAsSalespersonsByProviderAndPf($idProvider, $idPurchasingFair) {\r\r\n\r\r\n $result = array();\r\r\n $query = '\r\r\n SELECT DISTINCT(p.id_participant), p.civility_participant, p.surname_participant, p.name_participant, p.email_participant, p.date_deletion_participant\r\r\n FROM participant p \r\r\n INNER JOIN assignment_participant_enterprise ape ON ape.PARTICIPANT_id_participant = p.id_participant \r\r\n INNER JOIN enterprise e ON e.id_enterprise = ape.ENTERPRISE_id_enterprise \r\r\n INNER JOIN profile pr ON pr.id_profile = e.PROFILE_id_profile\r\r\n INNER JOIN assignment_sp_store ass ON ass.PARTICIPANT_id_participant = p.id_participant\r\r\n INNER JOIN purchasing_fair pf ON pf.id_purchasing_fair = ass.PURCHASING_FAIR_id_purchasing_fair\r\r\n WHERE pr.id_profile = 1 AND e.id_enterprise = ? AND p.date_deletion_participant IS NULL AND pf.id_purchasing_fair = ?\r\r\n ';\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->prepare($query); \r\r\n $qresult->execute(array($idProvider, $idPurchasingFair));\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idParticipant, $civility, $surname, $name, $email, $dateDeletion ) = $row; // Like that $idParticipant = $row['id_participant'] etc.\r\r\n $newParticipant = new Participant($civility, $surname, $name, $email, $dateDeletion, $idParticipant);\r\r\n $result[] = $newParticipant; // Adds new Participant to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }", "public function reservations() {\n return $this->hasMany('App\\Reservation')->getResults();\n }", "public function prisoners()\n {\n return $this->hasMany('App\\Prisoner','prisoner_id');\n }", "public function susPrestaciones()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Prestacion' , 'clave_beneficiario' , 'clave_beneficiario');\t\n\t}", "public function testRemoveReviewer()\n {\n $user = new User;\n $user->setId('joe')->setEmail('joe')->setFullName('joe')->save();\n $user->setId('jane')->setEmail('jane')->setFullName('jane')->save();\n\n $review = new Review($this->p4);\n $review->setParticipants(array('joe', 'nonadmin', 'jane'))\n ->set('author', 'jane')\n ->save();\n\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setQuery(new Parameters(array('_method' => 'delete')));\n\n $this->dispatch('/reviews/1/reviewers/nonadmin');\n\n $this->assertResponseStatusCode(200);\n\n $review = Review::fetch(1, $this->p4);\n $this->assertSame(array('joe'), $review->getReviewers());\n }", "public function hasInvestigators() {\n return $this->_has(6);\n }", "public function revenues()\n {\n return $this->hasMany('App\\revenue','store_id');\n }", "public function recomendacion() {\n return $this->belongsTo( Recomendacion::class );\n }", "public function requisitos(){\n return $this->hasMany('App\\Requisito');\n }", "public function get_vendor_memberships() {\n $this->db->select('*');\n $this->db->from('vendor_membership');\n $query = $this->db->get();\n $query_result = $query->result();\n\n return $query_result;\n }", "static private function link_naked_arxiv() {\n // if(self::quick()) return null;\n\n // Pick arXiv IDs within the last year which do not have INSPIRE record.\n $stats = self::inspire_regenerate(\"SELECT arxiv FROM records WHERE (inspire = '' OR inspire IS NULL) AND (arxiv != '' AND arxiv IS NOT NULL) AND (published + interval 1 year > now())\");\n\n if (sizeof($stats->found) > 0)\n self::log(sizeof($stats->found) . \" arXiv ids were associated with INSPIRE: \" . implode(\", \", $stats->found) . \".\");\n if (sizeof($stats->lost) > 0)\n self::log(sizeof($stats->lost) . \" arXiv ids were not found on INSPIRE: \" . implode(\", \", $stats->lost) . \".\");\n }", "public function getReservas()\n {\n return $this->hasMany(Reserva::className(), ['id_cliente' => 'id_cliente']);\n }", "static public function ctrRemitosVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlRemitosVentas($tabla);\n\n\t\treturn $respuesta;\n\t\t\n\t}", "public function getProfessionList(){\n return $this->_get(20);\n }", "public function unclaimedPrizeWinners()\n {\n return $this->belongsToMany('User', 'community_challenge_prize_winners', 'community_challenge_id', 'user_id');\n }", "public function members()\n\t{\n\t\treturn $this -> hasMany(__CLASS__.'\\Member', 'participant_team_id');\n\t}", "private function members_can_be_invited( $subscription ){\n return pms_gm_get_used_seats( $subscription->id ) >= pms_gm_get_total_seats( $subscription ) ? false : true;\n }", "public function murotal_reciter_surah()\n {\n return $this->hasMany(MRS::class, 'id', 'surah_id');\n }", "public function ADStaff_Get_Group_Memners(){\n\t \n\t $result_key = parent::Initial_Result('members');\n\t $result = &$this->ModelResult[$result_key];\n\t \n\t try{\n\t \n\t\t// 查詢資料庫\n\t\t$DB_OBJ = $this->DBLink->prepare(parent::SQL_Permission_Filter(SQL_AdStaff::SELECT_GROUP_MEMBER()));\n\t\tif(!$DB_OBJ->execute()){\n\t\t throw new Exception('_SYSTEM_ERROR_DB_ACCESS_FAIL'); \n\t\t}\n\t\t\n\t\t$members = array();\n\t\twhile($tmp = $DB_OBJ->fetch(PDO::FETCH_ASSOC)){\n\t\t if(!isset($members[$tmp['gid']])) $members[$tmp['gid']] = array();\n\t\t $role_set = json_decode($tmp['role_json'],true) ? json_decode($tmp['role_json'],true) : array();\n $tmp['roles'] = array_keys(array_filter($role_set)); \n\t\t $members[$tmp['gid']][] = $tmp;\n\t\t}\n\t\t$result['action'] = true;\t\t\n\t\t$result['data'] = $members;\t\t\n\t \n\t } catch (Exception $e) {\n $result['message'][] = $e->getMessage();\n }\n\t return $result;\n\t}", "public function Aremplacer()\n {\n return $this->belongsToMany('App\\Professeur','remplacants_prof','remplacant_id','prof_id');\n }", "public static function getMemberReliability($member_name){\n\t\t\n\t\tglobal $db; \n\t\t\n\t\t$result = getDataFromDB::getMemberIdByName($member_name);\n\t\t//check if an error accured\n\t\tif (key($result) == 'error_message'){\n\t\t\treturn $result; \n\t\t}\n\t\t\n\t\t$member_id = $result['member_id'];\n\t\t\n\t\t$isRecruiter = getDataFromDB::isRecruiter($member_id);\n\t\t\n\t\t//check if an error accured\n\t\tif ($isRecruiter != 0 and $isRecruiter != 1){\n\t\t\treturn $isRecruiter; \n\t\t}\n\t\t//regular user\n\t\telse if ($isRecruiter == 0){ \n\t\t\t//set query\n\t\t\t$query_text = \"SELECT user_reliability FROM users WHERE user_id = :member_id\";\n\t\t}\n\t\t//recruiter\n\t\telse{\n\t\t\t//set query\n\t\t\t$query_text = \"SELECT recruiter_reliability FROM recruiters WHERE recruiter_id = :member_id\";\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t//prepare query\t\t\n\t\t\t$query_statement = $db->prepare($query_text);\n\t\t\t//bind\n\t\t\t$query_statement->bindValue(':member_id', $member_id); \n\t\t\t//execute query\n\t\t\t$query_statement->execute();\n\t\t\t//fetch results\n\t\t\t$result = $query_statement->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t\t\n\t\tcatch (PDOException $ex) {\n\t\t\t$error_message = $ex->getMessage();\n\t\t\t$result = array('error_message' => $error_message);\n\t\t\treturn $result;\n\t\t}\n\t\t\n\t\tif ($isRecruiter == 0){\n\t\t\t$toReturn = array('reliability' => $result['user_reliability']);\n\t\t}\n\t\telse{\n\t\t\t$toReturn = array('reliability' => $result['recruiter_reliability']);\n\t\t}\n\t\t\n\t\treturn $toReturn; \n\t\t\n\t}", "public function memberships_get()\n {\n\n $em = $this->doctrine->em;\n\n $maembershipRepo = $em->getRepository('Entities\\Membership');\n $memberships = $maembershipRepo->findAll();\n $result[\"desc\"] = \"Listado de membresias\";\n $result[\"data\"] = $memberships;\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "public function rates()\n {\n return $this->belongsToMany(RatePlan::class, 'room_rate_unit_pivot', 'accommodation_unit_id', 'rate_plan_id');\n }", "public function eventRepetitions()\n {\n return $this->hasMany('DavideCasiraghi\\LaravelEventsCalendar\\Models\\EventRepetition', 'event_id');\n }", "public function testProfilePrototypeCountCommunityRoles()\n {\n\n }", "public function refits()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_refit', 'refit_id', 'se_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'refit_id', 'org_id', 'project_id', 'created_by', 'updated_by')\n ->withTimestamps();\n }", "public function testListSiteMembershipsForPerson()\n {\n }", "function test_getTrendingPromptrs()\n {\n $name = \"mikes 5 top interview questions\";\n $topic_id = 5;\n $trending_index = 3;\n $test_promptr = new Promptr($name, $topic_id, $trending_index);\n $test_promptr->save();\n\n $name2 = \"mikes 50 top interview questions\";\n $trending_index2 = 4;\n $test_promptr2 = new Promptr($name2, $topic_id, $trending_index2);\n $test_promptr2->save();\n\n $name3 = \"mikes 500 top interview questions\";\n $trending_index3 = 5;\n $test_promptr3 = new Promptr($name3, $topic_id, $trending_index3);\n $test_promptr3->save();\n\n $name4 = \"mikes 5000 top interview questions\";\n $trending_index4 = 6;\n $test_promptr4 = new Promptr($name4, $topic_id, $trending_index4);\n $test_promptr4->save();\n\n $name5 = \"mikes 50000 top interview questions\";\n $trending_index5 = 7;\n $test_promptr5 = new Promptr($name5, $topic_id, $trending_index5);\n $test_promptr5->save();\n\n $name6 = \"mikes 500000 top interview questions\";\n $trending_index6 = 8;\n $test_promptr6 = new Promptr($name6, $topic_id, $trending_index6);\n $test_promptr6->save();\n\n //Act\n $result = Promptr::getTrendingPromptrs();\n\n //Assert\n $this->assertEquals([$test_promptr6, $test_promptr5, $test_promptr4, $test_promptr3, $test_promptr2], $result);\n }", "public function reviews()\n {\n return $this->morphedByMany('App\\Review', 'likeable');\n }", "public function professors() {\n return $this->hasMany('App\\Professor');\n }", "public function testProfilePrototypeCountReviews()\n {\n\n }", "public function hasRecruitment() {\n return $this->_has(4);\n }", "public function recommendations()\n {\n return $this->morphMany(Recommendation::class, 'recommendable');\n }", "public function testReusableRelation()\n {\n $this->specify(\n 'Reusing relations does not work correctly',\n function () {\n $customers = Customers::find([\n 'document_id = :did: AND status = :status: AND customer_id <> :did:',\n 'bind' => ['did' => 1, 'status' => 'A']\n ]);\n\n expect($customers)->isInstanceOf(Simple::class);\n expect(count($customers))->equals(2);\n\n expect($customers[0]->user)->isInstanceOf(Users::class);\n expect($customers[0]->user)->isInstanceOf(Users::class);\n expect($customers[0]->user)->isInstanceOf(Users::class);\n\n expect($customers[1]->user)->isInstanceOf(Users::class);\n expect($customers[1]->user)->isInstanceOf(Users::class);\n expect($customers[1]->user)->isInstanceOf(Users::class);\n\n expect($customers->getFirst())->isInstanceOf(Customers::class);\n\n expect($customers[1]->user->name)->equals('Nikolaos Dimopoulos');\n expect($customers[1]->user->name)->equals('Nikolaos Dimopoulos');\n expect($customers[1]->user->name)->equals('Nikolaos Dimopoulos');\n\n expect($customers->getFirst()->user->name)->equals('Nikolaos Dimopoulos');\n expect($customers->getFirst()->user->name)->equals('Nikolaos Dimopoulos');\n expect($customers->getFirst()->user->name)->equals('Nikolaos Dimopoulos');\n\n expect($customers[0]->user->name)->equals('Nikolaos Dimopoulos');\n expect($customers[0]->user->name)->equals('Nikolaos Dimopoulos');\n expect($customers[0]->user->name)->equals('Nikolaos Dimopoulos');\n }\n );\n }", "function groups_calculate_role_people($rs,$context) {\n global $CFG;\n if(!$rs) {\n return false;\n }\n \n $roles = get_records_menu('role', null, 'name', 'id, name');\n $aliasnames = role_fix_names($roles, $context);\n\n // Array of all involved roles\n $roles=array();\n // Array of all retrieved users\n $users=array();\n // Fill arrays\n while($rec=rs_fetch_next_record($rs)) {\n // Create information about user if this is a new one\n if(!array_key_exists($rec->userid,$users)) {\n // User data includes all the optional fields, but not any of the\n // stuff we added to get the role details\n $userdata=clone($rec);\n unset($userdata->roleid);\n unset($userdata->roleshortname);\n unset($userdata->rolename);\n unset($userdata->userid);\n $userdata->id=$rec->userid;\n\n // Make an array to hold the list of roles for this user\n $userdata->roles=array();\n $users[$rec->userid]=$userdata;\n }\n // If user has a role...\n if(!is_null($rec->roleid)) {\n // Create information about role if this is a new one\n if(!array_key_exists($rec->roleid,$roles)) {\n $roledata=new StdClass;\n $roledata->id=$rec->roleid;\n $roledata->shortname=$rec->roleshortname;\n if(array_key_exists($rec->roleid,$aliasnames)) {\n $roledata->name=$aliasnames[$rec->roleid];\n } else {\n $roledata->name=$rec->rolename;\n }\n $roledata->users=array();\n $roles[$roledata->id]=$roledata;\n }\n // Record that user has role\n $users[$rec->userid]->roles[] = $roles[$rec->roleid];\n }\n }\n rs_close($rs);\n\n // Return false if there weren't any users\n if(count($users)==0) {\n return false;\n }\n\n // Add pseudo-role for multiple roles\n $roledata=new StdClass;\n $roledata->name=get_string('multipleroles','role');\n $roledata->users=array();\n $roles['*']=$roledata;\n\n // Now we rearrange the data to store users by role\n foreach($users as $userid=>$userdata) {\n $rolecount=count($userdata->roles);\n if($rolecount==0) {\n debugging(\"Unexpected: user $userid is missing roles\");\n } else if($rolecount>1) {\n $roleid='*';\n } else {\n $roleid=$userdata->roles[0]->id;\n }\n $roles[$roleid]->users[$userid]=$userdata;\n }\n\n // Delete roles not used\n foreach($roles as $key=>$roledata) {\n if(count($roledata->users)===0) {\n unset($roles[$key]);\n }\n }\n\n // Return list of roles containing their users\n return $roles;\n}", "function check_vendor_mambership(){\n $vendors = $this->db->get('vendor')->result_array();\n foreach ($vendors as $row) {\n if($row['membership'] !== '0'){\n if($row['member_expire_timestamp'] < time()){\n $data['membership'] = '0';\n $this->db->where('vendor_id', $row['vendor_id']);\n $this->db->update('vendor', $data);\n $this->set_product_publishability($row['vendor_id']);\n $this->email_model->membership_upgrade_email($row['vendor_id']);\n }\n }\n }\n }", "public function subscriberPremium()\n\t{\n\t\treturn $this->hasOne('App\\SubscriberPremium');\n\t}", "public function testProfilePrototypeUpdateByIdReviews()\n {\n\n }", "public function getRegistros(){\n $collection = new Collection();\n\n $stock = \\DB::table(\"stock\")\n ->join(\"stock_status\",\"stock_status.id\",\"=\",\"stock.status\")\n ->select(\"stock_status.name as status\")->get();\n\n $collection->put('alta',0);\n $collection->put('baja',0);\n $collection->put('pendiente_alta',0);\n $collection->put('pendiente_baja',0);\n $collection->put('pendiente_alta_puede_editar',0);\n\n foreach($stock as $key =>$value) {\n if ($value->status == 'alta')\n $collection->put('alta', $collection->get('alta') + 1);\n else if ($value->status == 'baja')\n $collection->put('baja', $collection->get('baja') + 1);\n else if ($value->status == 'pendiente_alta')\n $collection->put('pendiente_alta', $collection->get('pendiente_alta') + 1);\n else if ($value->status == 'pendiente_baja')\n $collection->put('pendiente_baja', $collection->get('pendiente_baja') + 1);\n else if ($value->status == 'pendiente_alta_puede_editar')\n $collection->put('pendiente_alta_puede_editar', $collection->get('pendiente_alta_puede_editar') + 1);\n }\n return $collection;\n }", "public function getReviews()\n {\n return $this->hasMany(Review::className(), ['author_id' => 'id']);\n }", "public function testVatRecycling()\n {\n $vat = new Vat(\n [\n 'name' => $this->faker->name,\n 'code' => $this->faker->randomLetter(),\n 'rate' => 10,\n ]\n );\n $vat->delete();\n\n $recycled = RecycledObject::all()->first();\n $this->assertEquals($vat->recycled->first(), $recycled);\n }", "public function reciter_riwayats()\n {\n return $this->hasMany(ReciterRiwayat::class, 'id', 'surah_id');\n }", "function test_a_user_can_filter_threads_by_popularity(){\n // with 2,3 and 0 replies respectively\n\n $ThreadWithTwoReplies = create('App\\Thread');\n create('App\\Reply',['thread_id'=>$ThreadWithTwoReplies->id],2);\n\n\n $ThreadWithThreeReplies = create('App\\Thread');\n create('App\\Reply',['thread_id'=>$ThreadWithThreeReplies->id],3);\n\n $ThreadWithNoReplies = $this->thread;\n\n\n\n //When I filter all threads by popularity\n $response = $this->getJson('threads?popular=1')->json();\n // then they should be returned from most replies to least\n\n $this->assertEquals([3,2,0], array_column($response,'replies_count'));\n\n }", "public static function all(){\n \t\ttry{\n $index = 0;\n $con = new Database;\n $query = $con->prepare('SELECT unnest(enum_range(null::membership_type))');\n $query->execute();\n $con->close();\n \n $results = $query->fetchAll(PDO::FETCH_OBJ);\n \n $memberships = array();\n\n if(!empty($results)){\n foreach($results as $result){\n $temp = new Membership;\n $temp->setAttributes($index, $result->unnest);\n $index = $index+1;\n array_push($memberships, $temp);\n }\n }\n\n return $memberships;\n \t\t}\n catch(PDOException $e){\n \t echo $e->getMessage();\n \t }\n }", "public function refits2()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_refit', 'refit_id', 'se_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'refit_id', 'org_id', 'project_id', 'created_by', 'updated_by')\n ->withTimestamps();\n }", "public function matches(){\n\t\tif($this->credentials->check_credentials()){\n\t\t\t// Hier een qeury voor de matches!\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('Gebruikersprofiel');\n\t\t\t$query=$this->db->get(); // SELECT * FROM $tabel;\n\t\t\t\n\t\t\t//Testresultaten opmaken met behulp van de match functie binnen matching_model.\n\t\t\t$resulaten=array();\n\t\t\tforeach($query->result() as $row){\n\t\t\t\tif($row->Bijnaam!==$this->session->userdata('username')){\n\t\t\t\t\t$resultaten[$row->Bijnaam]=$this->matching->match($row->Bijnaam);\n\t\t\t\t}\n\t\t\t\n\t\t\t//Nu de 6 resultaten weer op zoeken.\n\t\t\t$best_six=array();\n\t\t\tfor($i=0;$i<5;$i++){\n\t\t\t\tif(count($resultaten)>0){\n\t\t\t\t\t\t$temp=max(array_keys($resultaten)); // de hoogste waarde\n\t\t\t\t\t\tarray_push($best_six,$temp); // best six ophogen\n\t\t\t\t\t\tunset($resultaten[$temp]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Nu de beste 6 weergeven in xml formaat.\n\t\t\tif(count($best_six)>0){\n\t\t\t\t$this->db->limit(6);\n\t\t\t\t$this->show($this->db->get_where('Gebruikersprofiel', $best_six));\n\t\t\t}\n\t\t}\n\t}", "public function recruter($recrue = null )\n {\n if(Post::getInstance()->submit()){\n\n if(Post::getInstance()->has(\"invitation\")){\n\n if(!is_null($recrue)){\n\n $recrus = $this->User->find($recrue);\n $guild = $this->Member->findOneBy(array(\"user_id\" => $this->auth->getUser('id')));\n\n $this->GuildService->inviter($guild->id,$recrus->id);\n\n }\n }\n\n if(Post::getInstance()->has(\"search\")){\n\n if(is_null($recrue)){\n\n $this->recrus = $this->User->search(Post::getInstance()->val(\"recrue\"));\n }\n }\n }\n }", "public function interests()\n {\n $this->markTestSkipped();\n $interests = [\"ac16479d5f\" => true, \"d9e354e0b4\" => true, \"6f029937b7\" => false ];\n $member = (new Member($this->email()))->interests($interests);\n $this->api->addUpdateMember($this->listId, $member);\n $data = $this->api->getMember($this->listId, $member->hash());\n $this->assertEquals(true, $data['interests']['ac16479d5f']);\n $this->assertEquals(true, $data['interests']['d9e354e0b4']);\n $this->assertEquals(false, $data['interests']['6f029937b7']);\n $this->unsub($member);\n }", "public function members() {\n return $this->belongsToMany('Rockit\\Models\\Member', 'staffs');\n }", "public function run()\n {\n //\n Schema::disableForeignKeyConstraints();\n Recourse::truncate();\n Survivor::truncate();\n Schema::enableForeignKeyConstraints();\n\n $s = Survivor::create(['name' => 'Gilvan Leal', 'birth' => '1990-10-19',\n 'gender' => 'male', 'latitude'=> 10.123456, 'longitude'=> 20.654321\n ]);\n $s->recourses()->createMany([\n ['amount' => 2, 'item_id' => Item::where('name', 'Water')->value('id')],\n ['amount' => 1, 'item_id' => Item::where('name', 'Medication')->value('id')],\n ['amount' => 4, 'item_id' => Item::where('name', 'Ammunition')->value('id')]\n ]\n );\n $s->save();\n Survivor::create(['name' => 'Dywlly Porto', 'birth' => '1985-11-08',\n 'gender' => 'female', 'latitude'=> 50.123456, 'longitude'=> 90.654321\n ])->recourses()->createMany([\n ['amount' => 1, 'item_id' => Item::where('name', 'Water')->value('id')],\n ['amount' => 2, 'item_id' => Item::where('name', 'Medication')->value('id')]\n ]\n );\n Survivor::create(['name' => 'João Paulo', 'birth' => '1999-12-5',\n 'gender' => 'male', 'latitude'=> 50.123456, 'longitude'=> 90.654321\n ])->recourses()->createMany([\n ['amount' => 1, 'item_id' => Item::where('name', 'Water')->value('id')],\n ['amount' => 2, 'item_id' => Item::where('name', 'Medication')->value('id')]\n ]\n );\n\n Survivor::create(['name' => 'Paulo Silva', 'birth' => '2012-12-5',\n 'gender' => 'male', 'latitude'=> 50.123456, 'longitude'=> 90.654321\n ])->recourses()->createMany([\n ['amount' => 10, 'item_id' => Item::where('name', 'Food')->value('id')],\n ['amount' => 2, 'item_id' => Item::where('name', 'Ammunition')->value('id')]\n ]\n );\n\n\n }", "public function reviews()\n\t{\n\t\treturn $this->hasMany(Review::class); \n\t}", "function getRecruitmentParticipations($recruitment_id,$where='')\n\t\t{\n\t\t\tif($where)\n\t\t\t{\n\t\t\t\t$where = substr($where,3);\n\t\t\t\t$whereq = \"r.recruitment_id='\".$recruitment_id.\"' AND (\". $where.\")\";\n\t\t\t}\n\t\t\telse\n\t\t\t$whereq = \"r.recruitment_id='\".$recruitment_id.\"'\";\n\t\t\t\n\t\t\t$query = \"SELECT rp.identifier as rpid,rp.articles_per_week,rp.proposed_cost,rp.is_hired,rp.article_path,rp.article_submit_expires,rp.article_name,up.initial,up.first_name,up.last_name,u.identifier as user_id,CASE u.profile_type WHEN 'senior' THEN 'S' WHEN 'sub-junior' THEN 'J' WHEN 'junior' THEN 'D' ELSE '' END as profiletype,r.no_contrib,r.is_quiz,r.is_test_article,qp.num_correct,qp.num_total,qp.qualified,qp.percent FROM RecruitmentParticipation as rp \n\t\t\tJOIN Recruitment r ON r.recruitment_id=rp.recruitment_id \n\t\t\tLEFT JOIN QuizParticipation as qp ON qp.id=rp.quiz_partcipation_id \n\t\t\tJOIN User as u ON u.identifier=rp.user_id LEFT JOIN UserPlus as up ON up.user_id=u.identifier WHERE \". $whereq;\n\t\t\tif(($result = $this->getQuery($query,true))!=NULL)\n\t\t\t{\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn NULL;\n\t\t}", "function vitero_get_participants($viteroid) {\n return false;\n}", "public function invites();", "public function getReplies()\n {\n return $this->hasMany(Replies::class, ['task_id' => 'id']);\n }" ]
[ "0.5455347", "0.53481835", "0.5281724", "0.521807", "0.51331896", "0.50953597", "0.50559235", "0.50358844", "0.49756807", "0.49724904", "0.49699783", "0.49644145", "0.49586934", "0.49461773", "0.4919814", "0.48991203", "0.4887426", "0.48854008", "0.4881569", "0.48723692", "0.48672673", "0.48407084", "0.48295593", "0.48175982", "0.48114264", "0.48053455", "0.47952038", "0.47940373", "0.4789528", "0.47756478", "0.47622523", "0.47343895", "0.47211877", "0.47200796", "0.47180134", "0.47103983", "0.47069228", "0.4659401", "0.4652492", "0.4646286", "0.46462634", "0.4637624", "0.46358317", "0.46358016", "0.4632313", "0.46284524", "0.46240553", "0.4616794", "0.46125537", "0.46087733", "0.46085668", "0.45993406", "0.4595428", "0.45776418", "0.45767578", "0.4575723", "0.4573378", "0.45716503", "0.45688877", "0.45643097", "0.45609692", "0.45577547", "0.4553906", "0.45500484", "0.45490748", "0.45465216", "0.4545554", "0.4542491", "0.4534101", "0.4533876", "0.4530281", "0.45260453", "0.4522908", "0.45198518", "0.45196474", "0.45175216", "0.45160973", "0.45133466", "0.45097497", "0.45089257", "0.45076197", "0.45041505", "0.44990253", "0.44986394", "0.4494978", "0.4493706", "0.4493459", "0.44928175", "0.44907188", "0.4486195", "0.44858125", "0.44818103", "0.44815552", "0.44803223", "0.44780463", "0.4477668", "0.44772938", "0.44763118", "0.44738227", "0.4473447" ]
0.5682586
0
/ A parent has a membership
public function Parents(){ return $this->hasOne('padre','membresia_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasParent() {}", "public function hasParent();", "public function hasParent();", "public function hasParent();", "public function hasParent()\n {\n }", "public function hasParentId(){\n return $this->_has(3);\n }", "public function isParent();", "public function isParent(): bool // need to move method to services\n {\n $match = User::join('account_user_permission', 'account_user_permission.user_id','=','users.id')\n ->join('accounts', 'accounts.id','=','account_user_permission.account_id')\n ->join('permissions','permissions.id','=','account_user_permission.permission_id')\n ->where('permissions.name','=','permissions.parents')\n ->where('users.id','=',$this->id)\n ->count();\n if($match>0) {\n return true;\n }\n return false;\n }", "public function isChild(): bool;", "function hasParent() {\n\t\treturn (bool) ($this->parentID);\n\t}", "public function isChildOnly();", "public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}", "abstract public function is_for_parent_node(Jquarry_Node $parent);", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function canHaveChildren() {}", "public function get_parent();", "public function hasParent() {\n return isset($this->_parent);\n }", "protected function hasParentMenuItem() {}", "function getParent();", "public function isSelf(){\n\t\t$db = new DB_WE();\n\n\t\tif($this->ID){\n\t\t\t$count = 0;\n\t\t\t$parentid = $this->ParentID;\n\t\t\twhile($parentid != 0){\n\t\t\t\tif($parentid == $this->ID){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t$parentid = f('SELECT ParentID FROM ' . escape_sql_query($this->_table) . ' WHERE ID=' . intval($parentid), '', $db);\n\t\t\t\t$count++;\n\t\t\t\tif($count == 9999){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function test_that_a_parent_enrollment_only_appears_once_in_students_lists()\n {\n }", "public function hasChildren($parent) {\n\t\t// If the left and right are x and x+1, then there is no kids\n\t\tif ($parent['Aco']['rght'] == $parent['Aco']['lft'] +1 ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function salmon_parent_is($atom, $parent, $breadcrumbs) {\n\treturn ($breadcrumbs[$atom['level'] - 1] == $parent); \n}", "public function hasHasRemoteParent(){\n return $this->_has(11);\n }", "public function hasChildren()\n {\n }", "public function hasChildren()\n {\n }", "abstract public function parent();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }", "function nameExistInParent(){\n\n\t\t$cat = $this->add('xepan\\commerce\\Model_Category');\n\t\t$cat->addCondition('parent_category_id',$this['parent_category_id']?:null);\n\t\t$cat->addCondition('name',$this['name']);\n\t\t$cat->addCondition('id','<>',$this->id);\n\t\t$cat->tryLoadAny();\n\n\t\treturn $cat->loaded();\n\n\t\treturn $this->ref('parent_category_id')->loaded()? \n\t\t$this->ref('parent_category_id')->ref('SubCategories')\n\t\t\t\t->addCondition('name',$this['name'])\n\t\t\t\t->addCondition('id','<>',$this->id)\n\t\t\t\t->tryLoadAny()->loaded(): false;\n\t}", "public function hasChildren(): bool;", "function has_post_parent($post = \\null)\n {\n }", "public function hasParentChildFilter() {\n return $this->_has(4);\n }", "public function hasParent(BaseObject $node)\n {\n return (bool)$node->getParentIdValue();\n }", "public function getIsChildAttribute(){\n return $this->parent_id != NULL;\n }", "public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}", "public function isOwnerOf( $attr )\n {\n // SOL TICKET #2\n // Dependiendo del tipo de relacion se si un objeto es duenio de otro:\n // - 1) Si la relacion es A (1)->(1) B entonces se necesita belongsTo explicito para no salvar en cascada relaciones que en realidad son blandas (p.e. modelado de *->1 donde el lado * en realidad es blando). (desde el modelo, esto es igual a (*)->(1))\n // - 2) Si la relacion es A (1)<->(1) B entonces se necesita belongsTo para saber cual es el lado fuerte.\n // - 3) Si la relacion es A (1)->(*) B entonces B belongsTo A.\n // - 4) Si la relacion es A (1)<->(*) B entonces B belongsTo A.\n // - 5) Si la relacion es A (*)->(*) B entonces B belongsTo A. (desde el modelo, es lo mismo que (1)->(*))\n // - 6) Si la relacion es A (*)<->(*) B entonces se necesita belongsTo en algun lado.\n //\n // La clase actual es A, el obj es de clase B.\n\n $_thisClass = get_class($this); //self::$thisClass; // get_class da PO, deberia usar otro valor y no la clase...\n\n // Verifico si tengo el atributo y esta en una relacion (hasMany o hasOne).\n //\n if (array_key_exists( $attr, $this->hasOne ))\n {\n $obj = new $this->hasOne[$attr]();\n\n // Si la relacion es unidireccional, se es duenio del otro solo si el otro declara belongsTo mi clase.\n if ($obj->hasOneOfThis( $_thisClass )) // 2) bidireccional 1..1\n {\n return $obj->belonsToClass( $_thisClass ); // Si el objeto que quiero saber si soy duenio pertenece a mi => si soy duenio de el.\n }\n else // 1) unidireccional 1..1\n {\n //return true;\n return $obj->belonsToClass( $_thisClass ); // Ahora se pide belongsTo obligatorio para 1..1 unidireccional (esto evita que se salven en cascada links que realmente son blandos)\n }\n }\n else if (array_key_exists( $attr, $this->hasMany ))\n {\n // Si tengo una relacion hasMany con migo mismo, tengo 1->* o *->*, para ambos casos debería devolver true.\n if ($this->hasMany[$attr] == $_thisClass) return true;\n \n $obj = new $this->hasMany[$attr]();\n\n if ($obj->hasOneOfThis( $_thisClass )) // 4) bidireccional 1..*\n {\n return true;\n }\n else\n {\n // 6) bidireccional *..*\n if ($obj->hasManyOfThis( $_thisClass ))\n {\n return $obj->belonsToClass( $_thisClass ); // problema: get_class(this) tira PO...\n }\n else // casos 3 o 5, como es unidireccional, toma el control la clase del lado que no es visto de la otra.\n {\n return true;\n }\n }\n }\n\n // Si llega aca deberia tirar un warning xq el atributo que me pasaron no es de una relacion...\n return false;\n \n }", "public function getGrandParent();", "protected function loadParentId(){return 0;}", "public function isCurrentChild(): bool;", "public function isChild(): bool\n {\n return false;\n }", "public function getHasChild()\n {\n $sql = \"SELECT * FROM \" . TB_USAGE . \" WHERE parent_id = \" . $this->db->sqltext($this->mix_id);\n $this->db->query($sql);\n if ($this->db->num_rows() > 0) {\n $this->hasChild = true;\n } else {\n $this->hasChild = false;\n }\n\n return $this->hasChild;\n }", "public function parent()\n {\n return $this->hasOne($this,'id', 'parent_id');\n }", "public function parentPerms()\n {\n if ($this->parent_id == null) {\n return null;\n }\n\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }", "public function isDescendantOf(Doctrine_Record $subj);", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "private function is_parent()\n\t{\n\t\treturn is_null($this->category_id);\n\t}", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function hasParent()\n {\n return $this->currentParent !== null;\n }", "function has_child($id){\n\t\t$rs = $this->db->query('select count(*) from c_dokumen_informasi where parent_id='.$id.'')->result_array();\n\t\t$row = $rs;\n\t\treturn $row[0] > 0 ? true : false;\n\t}", "final public function allowsParent() {\n\t\treturn true;\n\t}", "function test_get_parent()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Create a new tree\r\n\t\t$relation_tree = $this->_create_sub_node($rnc, $depth, $npl);\r\n\t\t$allnodes = $this->_tree->get_all_nodes(); \r\n\t\t// Walk trough all nodes and compare it's relations whith the one provided\r\n\t\t// by the relation tree\r\n\t\tforeach($allnodes AS $nid => $node)\r\n\t\t{\r\n\t\t\t$parent = $this->_tree->get_parent($nid, true);\r\n\t\t\tif (!isset($relation_tree[$nid]['parent_id']))\r\n\t\t\t{\r\n\t\t\t\t$this->assertFalse($parent, 'A rootnode returned a parent');\r\n\t\t\t\tcontinue;\r\n\t\t\t} \r\n\t\t\t$this->assertEqual($relation_tree[$nid]['parent_id'], $parent['id'], 'Relation tree parent doesn\\'t match method return');\r\n\t\t} \r\n\t\treturn true;\r\n\t}", "public function parent()\n {\n return $this->belongsTo(config('rbac.models.role'),'parent_id');\n }", "public function parentrole()\n {\n return $this->belongsTo(self::class, 'parent_id');\n }", "function _childexists($SuperID, $menuData){\n if (isset($menuData['parents'][$SuperID])) {\n return true;\n }\n return false;\n }", "function isChild($input) {\n\t if (exist(\"pages\", \"id\", $input)) {\t\t\t\t\t\t\n\t\t $childCheck = query(\"SELECT * FROM `pages` WHERE `id` = '{$input}'\");\n\t\t \n\t\t if ($childCheck['id'] == $_GET['id']) {\n\t\t\t return true;\n\t\t } else {\n\t\t\t return isChild($childCheck['parentPage']);\n\t\t }\n\t }\n }", "protected function retrieveParent()\n {\n }", "public function is_parent_available() {\n\t\t$parent = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'name' => $this->theme->get_template(),\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'repopackage',\n\t\t\t'orderby' => 'ID',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$this->theme->post_parent = current( $parent );\n\n\t\treturn ! empty( $parent );\n\t}", "function _check_parent_id($value)\n {\n if (!$value) {\n return TRUE;\n }\n\n $where = array();\n $where['id'] = $value;\n $id = model('comment')->get_id($where);\n if (!$id) {\n $this->form_validation->set_message(__FUNCTION__, lang('notice_value_invalid'));\n return FALSE;\n }\n\n return TRUE;\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "protected function touchingParent()\n {\n return $this->getRelated ()->touches ( $this->guessInverseRelation () );\n }", "public function hasAncestors();", "function is_child($parent) {\n\tglobal $wp_query;\n\tif ($wp_query->post->post_parent == $parent) { $return = true; } else { $return = false; }\n\treturn $return;\n}", "public function hasParentMessage(): bool {\n return isset($this->parentMessageId);\n }", "protected function hasParentMenuArr() {}", "public function parent() {\n\t\treturn $this->hasOne(Forum::getSectionClass(), \"parent_id\");\n\t}", "private function hasChilds(): bool\n {\n return (bool)$this->treePathModelClass::find()\n ->byParentId($this->owner->id)\n ->byChildId($this->owner->getAttribute($this->ownerParentIdAttribute))\n ->count();\n }", "public function testHasChildren()\n {\n $this->assertTrue($this->p1->hasChildren());\n $this->assertTrue($this->p2->hasChildren());\n\n $this->assertTrue($this->c11->hasChildren());\n $this->assertFalse($this->c12->hasChildren());\n\n $this->assertFalse($this->c21->hasChildren());\n $this->assertFalse($this->c22->hasChildren());\n $this->assertFalse($this->c23->hasChildren());\n\n $this->assertFalse($this->c111->hasChildren());\n }", "protected function hasParentMenuItemKey() {}", "private function isPranetOfMenuitem($parent,$children){\n if($parent == $children) return true;\n if($parent == 0) return true;\n \n $temp = dibi::query('SELECT id,parentid FROM ' . DB_TABLEPREFIX . 'MENU');\n $categories = $temp->fetchAssoc('id');\n \n while($children != 0){\n if($parent == $children) return true;\n $children = $categories[$children]['parentid'];\n }\n return false;\n }", "public function hasSiblings() {}", "function is_primary_parent($p_id){\n\t\t//$this->firephp->log(\"Par id= \".$p_id);\n\t\t$this->db->where('parentPrimary_uacc_id',$p_id);\n\t\t$this->db->or_where('parentAlt_uacc_id',$p_id);\n\t\t$this->db->select('parentPrimary_uacc_id');\n\t\t$res=$this->db->get(TWELL_FAM_PROF_TBL);\n\t\tif ($res->num_rows()==1) {\n\t\t\t$fam_profile=$res->row();\n\t\t\tIf (intval($fam_profile->parentPrimary_uacc_id)==intval($p_id)) {\n\t\t\t\t//$this->firephp->log(\"Primary parent!\");\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\t//$this->firephp->log(\"Alt parent!\");\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->firephp->log(\"Not able to determine primary/alt parent status for uid\".$p_id);\n\t\t\treturn 0;\n\t\t}\n\t}", "abstract public function isPermittedForUser($parentRow = array(), $removeItems = array());", "public function hasChildren()\n {\n return $this->myChildren()->exists();\n }", "private function link_user_with_parent_subscription( $data ){\n $owner_subscription = pms_get_member_subscription( $data['subscription_id'] );\n\n $subscription_data = array(\n 'user_id' => $data['user_id'],\n 'subscription_plan_id' => $owner_subscription->subscription_plan_id,\n 'start_date' => $owner_subscription->start_date,\n 'expiration_date' => $owner_subscription->expiration_date,\n 'status' => 'active',\n );\n\n $subscription = new PMS_Member_Subscription();\n $subscription->insert( $subscription_data );\n\n pms_add_member_subscription_meta( $subscription->id, 'pms_group_subscription_owner', $owner_subscription->id );\n pms_add_member_subscription_meta( $owner_subscription->id, 'pms_group_subscription_member', $subscription->id );\n\n $meta_id = pms_gm_get_meta_id_by_value( $owner_subscription->id, $data['email'] );\n\n pms_delete_member_subscription_meta( $owner_subscription->id, 'pms_gm_invited_emails_' . $meta_id, $data['pms_key'] );\n pms_delete_member_subscription_meta( $owner_subscription->id, 'pms_gm_invited_emails', $data['email'] );\n\n if( function_exists( 'pms_add_member_subscription_log' ) )\n pms_add_member_subscription_log( $subscription->id, 'group_user_accepted_invite' );\n }", "public function isDescendantOfOrEqualTo(Doctrine_Record $subj);", "public function parent() { }" ]
[ "0.7230965", "0.716311", "0.716311", "0.716311", "0.70236635", "0.69151527", "0.68573695", "0.6606775", "0.63333863", "0.6286975", "0.6242075", "0.6211456", "0.6193828", "0.61032355", "0.6101755", "0.6101755", "0.6101755", "0.6101755", "0.6095612", "0.60929596", "0.6088635", "0.6086299", "0.60435796", "0.603798", "0.6025983", "0.59998524", "0.5980448", "0.59542775", "0.59526485", "0.59526485", "0.59484684", "0.5939158", "0.5939158", "0.5939158", "0.5939158", "0.5924714", "0.5900819", "0.59002423", "0.5890874", "0.5888377", "0.58819985", "0.5870076", "0.58575875", "0.58559686", "0.58411676", "0.5826882", "0.57939714", "0.5773448", "0.5738031", "0.5723415", "0.57222295", "0.5693566", "0.5691292", "0.5691292", "0.5691292", "0.5691292", "0.5691292", "0.5691292", "0.5691292", "0.5688207", "0.56854963", "0.56854963", "0.56854963", "0.56854963", "0.56854963", "0.56854963", "0.56854963", "0.56854963", "0.56854963", "0.56854963", "0.568518", "0.56833214", "0.56673455", "0.5666587", "0.56576717", "0.56563526", "0.56529725", "0.56401545", "0.5640053", "0.5633792", "0.5632605", "0.56226444", "0.56226444", "0.56224906", "0.5601213", "0.55951124", "0.5581694", "0.5581606", "0.55782217", "0.5574429", "0.5551691", "0.554658", "0.5546489", "0.5543727", "0.5534795", "0.5532837", "0.55233616", "0.5518654", "0.55147773", "0.5505343" ]
0.5937338
35
Run the database seeds.
public function run() { DB::table('participant_types')->delete(); $records = [ ['name' => "Employee"], ['name' => "Spouse"], ['name' => "Partner"], ['name' => "Child"], ['name' => "Parent"], ['name' => "Extended Family Member"] ]; DB::table('participant_types')->insert($records); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Display a listing of the resource.
public function index() { $event = Event::all(); return $event; }
{ "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) { $request->validate([ 'title' =>'required|string|max:255', 'date' =>'required|date', 'time' =>'required', 'image' =>'required|file', 'description' =>'required' ]); $event = Event::create($request->all()); return (new EventResource($event)) ->response() ->setStatusCode(201); }
{ "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(Event $event) { return new EventResource($event); }
{ "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(Event $event) { return new EventResource($event); }
{ "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, $id) { $event = Event::findOrFail($id); $event->title = $request->title; $event->date = $request->date; $event->time = $request->time; $event->image = is_null($request->imagePath) ? $event->imagePath : 'text'; $event->description = $request->description; $event->update(); return responsed()->json(['status'=>'success', 'message'=>'event update']); }
{ "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(Event $event) { $event->delete(); return response()->json(null, 204); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n //\n }", "function eventRegister($eventName, EventListener $listener);", "public function listen($event, $listener);", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "protected function registerListeners()\n {\n }", "public function listen($listener);", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function createEvent()\n {\n return new Event();\n }", "public function attachEvents();", "public function attachEvents();", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function testEventCallBackCreate()\n {\n }", "public function listeners($event);", "public function addListener($event, $listener, $priority = 0);", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function createWatcher();", "public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}", "public function init_listeners( $callable ) {\n\t}", "public static function events();", "public static function __events () {\n \n }", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function addListener($eventName, $listener, $priority = 0);", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }", "public function listen();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function addEventListener($event, $callback, $weight = null);", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function addListener($name, $listener, $priority = 0);", "public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }", "public function on($event, $callback){ }", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function getCron_EventListenerService()\n {\n return $this->services['cron.event_listener'] = new \\phpbb\\cron\\event\\cron_runner_listener(${($_ = isset($this->services['cron.lock_db']) ? $this->services['cron.lock_db'] : $this->getCron_LockDbService()) && false ?: '_'}, ${($_ = isset($this->services['cron.manager']) ? $this->services['cron.manager'] : $this->getCron_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }", "public function getListener(/* ... */)\n {\n return $this->_listener;\n }", "protected function _listener($name) {\n\t\treturn $this->_crud()->listener($name);\n\t}", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function listeners($eventName);", "public static function create()\n {\n list(\n $message,\n $callbackService,\n $callbackMethod,\n $callbackParams\n ) = array_pad( func_get_args(), 4, null);\n\n static::addToEventQueue( array(\n 'type' => \"alert\",\n 'properties' => array(\n 'message' => $message\n ),\n 'service' => $callbackService,\n 'method' => $callbackMethod,\n 'params' => $callbackParams ?? []\n ));\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function __construct()\n {\n $this->events = new EventDispatcher();\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function listen($events, $listener = null): void;", "public function onCreate($callback)\n {\n $this->listeners[] = $callback;\n return $this;\n }", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "public function addBeforeCreateListener(IBeforeCreateListener $listener)\n {\n $this->_lifecyclers[BeanLifecycle::BeforeCreate][] = $listener;\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "public static function creating($callback)\n {\n self::listenEvent('creating', $callback);\n }", "public function attach(string $event, callable $listener, int $priority = 0): void;", "public function __construct()\n {\n $this->listnerCode = config('settings.listener_code.DeletingVoucherEventListener');\n }", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "protected function getPhpbb_Viglink_ListenerService()\n {\n return $this->services['phpbb.viglink.listener'] = new \\phpbb\\viglink\\event\\listener(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }", "public static function create($className, array &$extraTabs, $selectedTabId)\r\n {\r\n $createClass = XenForo_Application::resolveDynamicClass($className, 'listener_th');\r\n if (!$createClass) {\r\n throw new XenForo_Exception(\"Invalid listener '$className' specified\");\r\n }\r\n \r\n return new $createClass($extraTabs, $selectedTabId);\r\n }", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\n }", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public static function createInstance()\n {\n return new GridPrintEventManager('ISerializable');\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }", "public function addListener()\n {\n $dispatcher = $this->wrapper->getDispatcher();\n $listener = new TestListener();\n\n $dispatcher->addListener(PsKillEvents::PSKILL_PREPARE, [$listener, 'onPrepare']);\n $dispatcher->addListener(PsKillEvents::PSKILL_SUCCESS, [$listener, 'onSuccess']);\n $dispatcher->addListener(PsKillEvents::PSKILL_ERROR, [$listener, 'onError']);\n $dispatcher->addListener(PsKillEvents::PSKILL_BYPASS, [$listener, 'onBypass']);\n\n return $listener;\n }", "public static function addEventListener($event, $listenerClassName) {\n\t\tif (!is_a($listenerClassName, EventListenerInterface::class, TRUE)) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Invalid CMIS Service EventListener: %s must implement %s',\n\t\t\t\t\t$listenerClassName,\n\t\t\t\t\tEventListenerInterface::class\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tstatic::$eventListeners[get_called_class()][$event][] = $listenerClassName;\n\t}", "public function makeListener($listener, $wildcard = false): Closure;", "public function createSubscriber();", "public function listener() {\n\t\treturn $this->_runtime['listener'];\n\t}", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}", "function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function startListening();", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "function on_creation() {\n $this->init();\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }" ]
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", "0.5820997", "0.5791637", "0.57913053", "0.57893854", "0.57716024", "0.5764599", "0.5744472", "0.57417566", "0.57387024", "0.5721539", "0.57068586", "0.5699624", "0.56838834", "0.5675836", "0.56686187", "0.5661412", "0.56601405", "0.56584114", "0.5649107", "0.5638085", "0.56257224", "0.56172097", "0.56064796", "0.55919635", "0.5579062", "0.55775297", "0.5559927", "0.5546297", "0.5546121", "0.5545537", "0.5539715", "0.55295366", "0.55276597", "0.5527287", "0.551302", "0.5497285", "0.5495119", "0.54845315", "0.54834753", "0.54812366", "0.5478984", "0.5474917", "0.5471286", "0.54693574", "0.54684293", "0.5466594", "0.5465012", "0.5450231", "0.5450062", "0.5450001", "0.544321", "0.54308116", "0.54218924", "0.5389615", "0.53857446", "0.5378957", "0.5378836", "0.53771406", "0.5368413", "0.5360908", "0.5356685", "0.5349897", "0.53419805", "0.5340825", "0.53330225", "0.53323317", "0.5330117", "0.53270465", "0.5326564", "0.5307367", "0.52996707", "0.52980274", "0.52973336", "0.52886003", "0.528163", "0.5276869", "0.5269541", "0.5268173", "0.5265876", "0.52629435" ]
0.0
-1
Create a new aurhentication with the endpoint.
public function __construct(MoipAuthentication $moipAuthentication, $endpoint = 'sandbox') { $this->moipAuthentication = $moipAuthentication; $this->endpoint = \Config::get('moip.url.' . $endpoint); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n // handled by client\n }", "public function create()\n {\n //Not Used because using API Route\n }", "public function create()\n {\n $this->cpAuthorize();\n }", "public function __construct()\n {\n $this->authentication = new Authentication(\n getenv('AUTH_DOMAIN'),\n getenv('AUTH_CLIENT_ID'),\n getenv('AUTH_CLIENT_SECRET'),\n getenv('AUTH_AUDIENCE')\n );\n }", "public function create() {}", "public function testAuthenticationServiceAuthenticationCreate()\n {\n }", "function drush_pm_signup_signup_endpoint_create($label, $name = NULL) {\n\n $endpoint = new DefaultSignupEndpoint();\n $endpoint->labelForExport($label, $name);\n $name = $endpoint->getName();\n\n $check = SignupEndpoint::loadByName($name);\n if ($check === FALSE) {\n $endpoint->save();\n drush_log(dt(\"Signup endpoint @name created\", array('@name' => $name)), 'ok');\n }\n else {\n drush_set_error(dt(\"Signup endpoint @name already exists\", array('@name' => $name)));\n }\n}", "private function authenticate()\n {\n self::assertValidAuthType();\n\n $this->client\n ->getEmitter()\n ->attach(new $this->authenticators[$this->authType]($this));\n }", "public function create(){}", "public function create()\n {\n $this->resetFields();\n //DAN MEMBUKA AREA\n $this->openUser();\n }", "public function OAuthAuthenticate()\n {\n throw new Exception( \"OAuthAuthenticate Not yet implemented\" );\n \n// $response = Auth1::legs(2)\n// ->set( 'key', $this->OAuthConsumerKey )\n// ->set( 'secret', $this->OAuthConsumerSecret )\n// ->request( $this->OAuthRequestURI );\n }", "public function create()\n {\n $this->sesClient->verifyEmailIdentity(\n [\n 'EmailAddress' => $this->identity->getIdentity(),\n ]\n );\n }", "public function __construct()\n {\n // auth here\n }", "public function create() {\n\n\t\t\n\t}", "public function create()\n {\n if($result = check_auth_to('QXXX_ADD')) return $result;\n $site = Config::get('site');\n $data['auth_type'] = $site['auth_type'];\n return view('admin.auth.create', $data);\n }", "public function create()\n {}", "public function authenticate() {}", "public function authentication()\n {\n }", "public function create()\n {\n $ostObj = $this->instantiateOSTSDKForV2Api();\n $usersService = $ostObj->services->users;\n $params = array();\n $response = $usersService->create($params)->wait();\n $this->isSuccessResponse($response);\n }", "public function createAuthToken() {\n $url = URIResource::Make($this->path, array($this->id, 'tokens'));\n $token = $this->client->post($url, null);\n return new EndpointsToken($token);\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "public function endpointCreate($id) {\n\n $user = Auth::user();\n $timeline = $user->timeline;\n $userWallet = $timeline->wallet()->first();\n $userWalletPayId = $userWallet->pay_id;\n\n $application = Application::where('id', $id)\n ->where('user_id', $user->id)\n ->first();\n\n if ( ! $application ) {\n return response()->json([\n 'status' => '500',\n 'message' => 'WRONG_PARAMS',\n ]);\n }\n\n $value_site = $this->request->get('site');\n $value_redirect = $this->request->get('redirect');\n\n if ( ! $value_site ) {\n return response()->json([\n 'status' => '500',\n 'message' => 'SITE_IS_REQUIRED',\n ]);\n }\n\n $value_domain = $value_site;\n\n if ( ! $value_domain ) {\n return response()->json([\n 'status' => '500',\n 'message' => 'ERROR_IN_DOMAIN',\n ]);\n }\n\n\n if ($value_redirect) {\n\n }\n\n $endpoints = ApplicationEndpoint::where('app_id', $application->id)->get();\n if (count($endpoints) >= 5) {\n return response()->json([\n 'status' => '500',\n 'message' => 'ENDPOINT_LIMIT_REACHED',\n ]);\n }\n\n $endpoint = new ApplicationEndpoint();\n $endpoint->app_id = $application->id;\n $endpoint->name = bin2hex(random_bytes(10));\n $endpoint->domain = $value_domain;\n $endpoint->url = $value_site;\n $endpoint->redirect = $value_redirect;\n\n $endpoint->save();\n\n return response()->json([\n 'status' => '200',\n 'message' => 'created',\n 'data' => array(\n 'name' => $endpoint->name,\n 'site' => $endpoint->url,\n 'redirect' => $endpoint->redirect\n )\n ]);\n }", "public function create() {\n }", "public function create() {\n }", "public function create() {\n\n\t}", "public function testCreateNetworkMerakiAuthUser()\n {\n }", "public function create() {\r\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public function create()\n {\n \n //\n }", "public function authenticate() {\n }", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\treturn parent::post(false, ['api_key'=>self::$apiKey]);\n\t}", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create($password);", "public function create() {\n //\n }", "public /* boolean */ function createResource($uri) {\n $client = new Client();\n $request = $client->post($this->getServiceUrl($uri),array(\n \"User-Agent\" => \"Marmotta Client Library (PHP)\",\n \"Content-Length\" => \"0\",\n \"Content-Type\" => \"application/json\"\n ));\n // set authentication if given in configuration\n if(!_isset($this->config->getUsername())) {\n $request->setAuth($this->config->getUsername(),$this->config->getPassword());\n }\n //$request->getCurlOptions()->set(CURLOPT_PROXY, \"localhost:8888\");\n $request->send();\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }" ]
[ "0.5449579", "0.5421882", "0.5399548", "0.5378872", "0.5350708", "0.5335045", "0.53112507", "0.53087753", "0.5241542", "0.52339345", "0.52223057", "0.5218823", "0.52166164", "0.5208037", "0.51771176", "0.5176046", "0.5173368", "0.51728266", "0.5162047", "0.5157261", "0.5156578", "0.51523817", "0.51523817", "0.5151033", "0.51357216", "0.51357216", "0.5128246", "0.51263183", "0.51253116", "0.5125287", "0.5125287", "0.5121521", "0.5119128", "0.5113159", "0.5113159", "0.5113159", "0.5113159", "0.5113159", "0.5113159", "0.5113159", "0.5113159", "0.5113159", "0.5113159", "0.5113159", "0.5113159", "0.5112375", "0.51053315", "0.5101598", "0.51014143", "0.5099344", "0.5090448", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121", "0.5088121" ]
0.0
-1
Create a new api connection instance.
public function createConnection(HTTPConnection $http_connection) { $http_connection->initialize($this->endpoint, true); $http_connection->addHeader('Accept', 'application/json'); $http_connection->setAuthenticator($this->moipAuthentication); return $http_connection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function api ()\n {\n return new Api($this->url, $this->port);\n }", "public function __construct() {\n if (!$this->api) {\n $this->api = new Wrapper();\n }\n }", "static public function api(): Api\n {\n return new Api;\n }", "public function __construct()\n {\n $param = func_get_args();\n switch (count($param)) {\n case 0:\n $this->setupApiConfigFromEnv();\n $this->setupApiConfigFromFile();\n break;\n case 1:\n $this->setupApiConfigFromFile($param[0]);\n break;\n case 2:\n $this->api_key = $param[0];\n $this->api_secret = $param[1];\n break;\n default:\n throw new ApiConstructorException('Invalid constructor parameters.');\n }\n $this->client = new Client(['base_uri' => self::BASE_URI, 'timeout' => self::TIMEOUT]);\n }", "public function initialization($config)\n {\n try {\n $api = new \\CyberpanelApi($config['hostname'], $config['username'], $config['password']);\n } catch (\\Exception $e) {\n $this->failTest();\n }\n\n return $api;\n }", "public static function getApi() : APIInterface\n {\n $className = ucfirst(self::$appName) . 'API';\n $fullName = self::API_NAMESPACE . \"\\\\\" . $className;\n\n try {\n $api = new $fullName;\n } catch (\\Exception $e) {\n exit(\"Failed to instantiate Api: $className \\n\");\n }\n\n $api->setClient(self::$client)\n ->setUris(self::$uris)\n ->setSearch(self::$search)\n ;\n\n return $api;\n }", "protected function _apiInstance()\n {\n return Thrive_Api_iContact::getInstance()->setConfig($this->getCredentials());\n }", "public function __construct(){\n $this->api = new Concierge();\n }", "public function make()\n {\n $connection = ConnectionFactory::getConnection($this->type);\n $connection->setAddress($this->address);\n return $connection;\n }", "public function __construct(Api $api)\n {\n $this->api = $api;\n }", "public function __construct(Api $api)\n {\n $this->api = $api;\n }", "public function __construct(Api $api)\n {\n $this->api = $api;\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 }", "protected function get_api_instance() {\n\t\treturn new Thrive_Dash_Api_Mailchimp( $this->param( 'key' ) );\n\t}", "public function getApiInstance()\n {\n $params = func_num_args();\n if ($params > 2 || $params < 1) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN'));\n }\n if ($params == 1) {\n $api = new \\MercadoPago\\Core\\Lib\\Api(func_get_arg(0));\n $api->set_platform(self::PLATFORM_OPENPLATFORM);\n } else {\n $api = new \\MercadoPago\\Core\\Lib\\Api(func_get_arg(0), func_get_arg(1));\n $api->set_platform(self::PLATFORM_STD);\n }\n if ($this->_switcher->getWebsiteId() != 0) {\n if ($this->scopeConfig->getValue('payment/mercadopago_standard/sandbox_mode', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE, $this->_switcher->getWebsiteId())) {\n $api->sandbox_mode(true);\n }\n } else {\n if ($this->scopeConfig->getValue('payment/mercadopago_standard/sandbox_mode')) {\n $api->sandbox_mode(true);\n }\n }\n\n\n $api->set_type(self::TYPE);\n\n //$api->set_so((string)$this->_moduleContext->getVersion()); //TODO tracking\n\n return $api;\n\n }", "public function __construct()\n {\n $this->client = new Client();\n $this->apiKey = Api::platform('TikApi')->first()->api_key;\n }", "public function __construct()\r\n\t\t{\r\n\t\t\t$this->api_id = self::API_ID;\r\n\t\t\t$this->api_secret = self::API_SECRET;\r\n\t\t}", "public function getApi()\n {\n if (!$this->api) {\n // @todo Mudar de acordo com a corretora\n $this->api = new \\Bancario\\Util\\Integrations\\Exchanges\\Binance(\n $this->auth_key,\n $this->auth_secret\n );\n }\n return $this->api;\n }", "protected function _apiInstance() {\n\t\treturn new Thrive_Dash_Api_WebinarJamStudio( $this->param( 'key' ) );\n\t}", "public static function init() {\n if (self::$apiClient === null)\n self::$apiClient = new ApiClient();\n }", "function __construct() {\n $this->createConnection();\n }", "protected function get_api_instance() {\n\t\treturn new Thrive_Dash_Api_KlickTipp( $this->param( 'user' ), $this->param( 'password' ) );\n\t}", "protected function createConnection()\n {\n return new ModernConnection();\n }", "public function sp_api()\n {\n $awsCredentials = new Credentials(\n env('AWS_ACCESS_KEY_ID'),\n env('AWS_SECRET_ACCESS_KEY')\n );\n\n // All of the below should be safe to bind as singletons to an IoC container.\n $spApiConfig = $this->buildSpApiConfig();\n $awsCredentialProvider = CredentialProvider::fromCredentials($awsCredentials);\n $lwaClient = new LwaClient($spApiConfig);\n $lwaService = new LwaService($lwaClient, static::$arrayCache, $spApiConfig);\n $clientAuthenticator = new ClientAuthenticator($lwaService, $awsCredentialProvider, $spApiConfig);\n $clientFactory = new ClientFactory($clientAuthenticator, $spApiConfig);\n $rdtService = new RdtService($clientFactory);\n // ^^^^^^^^^^^^^^^^ END of singleton-safe dependencies ^^^^^^^^^^^^^^^^\n\n // This should always be new'ed up on every use -- i.e. should never be used as a singleton.\n // This is because this wrapper class has state (e.g. rdtRequest) that is intended to be\n // short-lived for the purpose of a single SP-API call.\n return new SpApi(\n $clientFactory,\n $rdtService,\n $lwaService,\n $spApiConfig\n );\n }", "public function createConnection()\n {\n $client = DatabaseDriver::create($this->getConfig());\n\n return $client;\n }", "protected function init_api() {\n\t\tinclude_once dirname( __FILE__ ) . '/includes/class-coinbase-api-handler.php';\n\n\t\tCoinbase_API_Handler::$log = get_class( $this ) . '::log';\n\t\tCoinbase_API_Handler::$api_key = $this->get_option( 'api_key' );\n\t}", "public function __construct()\r\n {\r\n $this->constructApiUrl();\r\n }", "public function __construct() {\n $dotenv = new Dotenv();\n $dotenv->load(dirname(__DIR__).'/.env');\n\n $this->api = new Api($_ENV['CLODUI_API']);\n\n $client_id = $_ENV['CLODUI_CLIENT_ID'];\n $user_pool_id = $_ENV['CLODUI_USER_POOL_ID'];\n $identity_pool_id = $_ENV['CLODUI_IDENTITY_POOL_ID'];\n\n Logger::debug('Config Client ID '. $client_id. ', User pool id '. $user_pool_id. ', Identity pool id '. $identity_pool_id);\n $this->auth = new Auth($client_id, $user_pool_id, $identity_pool_id);\n }", "public function __construct()\n {\n parent::__construct();\n $this->client = new APIClient();\n }", "public function api()\n {\n $this->api = true;\n return $this;\n }", "public static function create($apiKey)\n {\n return (new Builder($apiKey))->build();\n }", "private function _init_api_library($base_name)\n\t{\n\t\t// Generate the name of the class\n\t\t$class_name = $base_name.API_LIBRARY_SUFFIX;\n\n\t\t// Check if the implementing library exists\n\t\tif ( ! Kohana::find_file('libraries/api',\n\t\t\tKohana::config('config.extension_prefix').$class_name))\n\t\t{\n\t\t\tthrow new Kohana_Exception('libraries.api_library_not_found',\n\t\t\t\tKohana::config('config.extension_prefix').$class_name.'.php', $class_name);\n\t\t}\n\n\t\t// Include the implementing API library file\n\t\trequire_once Kohana::find_file('libraries/api', Kohana::config('config.extension_prefix').$class_name);\n\n\t\t// Temporary instance for type checking\n\t\t$temp_api_object = new $class_name($this);\n\n\t\t// Check if the implementing library is an instance of Api_Object_Core\n\t\t// NOTE: All API libraries *MUST* be subclasses of Api_Object_Core\n\t\tif ( ! $temp_api_object instanceof Api_Object_Core)\n\t\t\tthrow new Kohana_Exception('libraries.invalid_api_library', $class_name, 'Api_Object_Core');\n\n\t\t// Discard the old copy\n\t\tunset($this->temp_api_object);\n\n\t\t// Instaniate a fresh copy of the API library\n\t\t$this->api_object = new $class_name($this);\n\t}", "public function __construct()\r\n\t{\r\n\t\t$conn= new connection();\r\n return $this->conn;\r\n }", "final private function constructApiUrl()\r\n {\r\n\t\trequire_once 'bset.php';\r\n $this->apiUrl = 'https://api.telegram.org/bot' . BOT_TOKEN;\r\n }", "public function __construct()\n\t{\t\t\n\t\terror_reporting(E_ALL);\n\t\t$this->api = new ApiDirect('data');\n\t}", "final private function constructApiUrl(): TgLog\n {\n $this->apiUrl = self::TELEGRAM_BASE_URL . 'bot' . $this->botToken . '/';\n $this->logger->debug('Built up the API URL');\n return $this;\n }", "protected function createConnection($resource)\n {\n return new Connection($this, $resource);\n }", "public function __construct()\n {\n $this->client = GuzzleFactory::make([\n 'base_uri' => 'https://min-api.cryptocompare.com/',\n ]);\n }", "private function setup_api() {\n\t\trequire_once 'includes/class-themeisle-ob-rest-server.php';\n\t\tif ( ! class_exists( 'Themeisle_OB_Rest_Server' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$api = new Themeisle_OB_Rest_Server();\n\t\t$api->init();\n\t\trequire_once 'includes/importers/helpers/trait-themeisle-ob.php';\n\t}", "public function __construct() {\n global $apiConfig;\n if (! empty($apiConfig['developer_key'])) {\n $this->developerKey = $apiConfig['developer_key'];\n }\n if (! empty($apiConfig['oauth2_client_id'])) {\n $this->clientId = $apiConfig['oauth2_client_id'];\n }\n if (! empty($apiConfig['oauth2_client_secret'])) {\n $this->clientSecret = $apiConfig['oauth2_client_secret'];\n }\n if (! empty($apiConfig['oauth2_redirect_uri'])) {\n $this->redirectUri = $apiConfig['oauth2_redirect_uri'];\n }\n if (! empty($apiConfig['oauth2_access_type'])) {\n $this->accessType = $apiConfig['oauth2_access_type'];\n }\n if (! empty($apiConfig['oauth2_approval_prompt'])) {\n $this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];\n }\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->httpClient = new Client([\n 'base_uri' => config('app.url'),\n 'headers' => [\n 'Authorization' => $this->apiKey,\n ],\n ]);\n }", "protected function connect_api() {\n\t\t$key = edd_get_option('eddmc_api', false);\n\n\t\tif ( $key ) {\n\t\t\t$this->api = new MailChimp( trim( $key ) );\n\n\t\t\tif ( defined('EDD_MC_VERIFY_SSL') && EDD_MC_VERIFY_SSL === false ) {\n\t\t\t\t$this->api->verify_ssl = false;\n\t\t\t}\n\t\t}\n\t}", "public static function makeConnection()\n {\n self::$connectionManager = new ConnectionManager();\n self::$connectionManager->addConnection([\n 'host' => self::$config['host'],\n 'user' => self::$config['user'],\n 'password' => self::$config['password'],\n 'dbname' => self::$config['dbname']\n ]);\n self::$connectionManager->bootModel();\n }", "public function __construct()\n {\n $this->apiKey = Config::i()->getSXApiKey();\n }", "public function __construct($id, array $config = []) {\r\n if(!isset($config['api'])) {\r\n throw new Exception(\"'api' parameter must be defined\");\r\n }\r\n $this->guzzle = new GuzzleHttp\\Client(['verify' => false]);\r\n parent::__construct($id, $config);\r\n }", "public function __construct()\n {\n $this->apiKey = '66122f8ad1adb1c075c75aba3bd503a4a559fc7f';\n }", "public function __construct()\n\t{\n\t\t$this->request = ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t\t? $_POST\n\t\t\t: $_GET;\n\n\t\t// Load the API configuration file\n\t\tKohana::config_load('api');\n\n\t\t// Get the IP Address of the client submitting the API request\n\n\t\t// Check if the IP is from a shared internet connection\n\t\tif ( ! empty($_SERVER['HTTP_CLIENT_IP']))\n\t\t{\n\t\t\t$this->request_ip_address = $_SERVER['HTTP_CLIENT_IP'];\n\t\t}\n\t\t// Check if the IP address is passed from a proxy server such as Nginx\n\t\telseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t{\n\t\t\t$this->request_ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->request_ip_address = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\n\t\t// Unpack the URL parameters\n\t\t$this->api_parameters = serialize(array_keys($this->request));\n\n\t\t// Instantiate the database\n\t\t$this->db = new Database();\n\t}", "public function __construct()\n {\n global $API_AUTHORIZATIONS;\n\n //Construct generic API handler\n parent::__construct();\n\n //Define authorizations for current API module\n $this->AUTH = $API_AUTHORIZATIONS[self::MODULE];\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 }", "public function __construct($api_key, $api_url='https://newsapi.org/v2/'){\n $this->api_key = 'apiKey=' . $api_key;\n $this->api_url = $api_url;\n }", "function __construct()\n {\n $this->createConnection();\n\n }", "public function __construct($apiKey, Client $guzzle = null)\n {\n $this->http = new Http($this, $guzzle);\n }", "public function api_connect($url) {\n return curl_init($url);\n }", "public static function factory($config = array())\n {\n $default = array('apiurl' => 'http://localhost:8800');\n $required = array('appkey');\n $config = Collection::fromConfig($config, $default, $required);\n\n $client = new self($config->get('apiurl'), $config);\n\n return $client;\n }", "public function getApiClient()\n {\n return new alldadataApi();\n }", "function __construct() {\n $connection= new Connection;\n $this->link = $connection->conect();\n }", "public function __construct($apiKey, \n $apiHost = 'https://data.aino.io:443', \n $apiVersion = 'v2.0') {\n $this->apiKey = $apiKey;\n $this->apiHost = str_replace('https:','ssl:',rtrim($apiHost,'/'));\n $this->apiVersion = $apiVersion;\n }", "public function __construct($apiUrl, $apiKey)\n {\n $this->apiUrl = $apiUrl;\n $this->apiKey = $apiKey;\n }", "public static function getInstance() {\r\n\t if(is_null(self::$_instance)) {\r\n\t\t\tself::$_instance = new self();\r\n\t\t\tself::$_instance->base_url = (isDev() || isPreprod() || isUat()) ? 'base url here' : 'base url here';\r\n\t\t\tself::$_instance->apikey = ($GLOBALS['cmd_server'] == 'Dev') ? 'no pass' : 'no pass';\r\n\t\t\tself::$_instance->addHeader(\"User-Agent: CMD3\");\r\n\t\t\tself::$_instance->addHeader(\"Authorization: Basic \" . self::$_instance->apikey);\r\n\t\t\tself::$_instance->addHeader(\"Content-type: application/json\");\r\n\t\t\tself::$_instance->addHeader(\"Accept: application/json\");\r\n\t\t\tself::$_instance->addHeader(\"Host: demo3.precisebillonline.com\");\r\n\t\t}\r\n\t\treturn self::$_instance;\r\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 }", "public function __construct(APIService $api)\n {\n $this->api = $api;\n }", "public function __construct(APIService $api)\n {\n $this->api = $api;\n }", "public function __construct(APIService $api)\n {\n $this->api = $api;\n }", "public function __construct(APIService $api)\n {\n $this->api = $api;\n }", "public function __construct(APIService $api)\n {\n $this->api = $api;\n }", "public function getApiClient()\n {\n $apiClient = new \\Bliskapaczka\\ApiClient\\Bliskapaczka(\n \\Configuration::get(self::API_KEY),\n $this->getApiMode(\\Configuration::get(self::TEST_MODE))\n );\n\n return $apiClient;\n }", "public function __construct($apiLogin, $apiPassword, $apiEndpoint = self::PRODUCTION_API_ENDPOINT, $additionalClientConfig = [])\n {\n $additionalClientConfig['base_uri'] = $apiEndpoint;\n\n $this->apiLogin = $apiLogin;\n $this->apiPassword = $apiPassword;\n $this->apiClient = new \\GuzzleHttp\\Client($additionalClientConfig);\n $this->machineFactory = new MachineFactory();\n $this->serializer = new Serializer();\n }", "public static function factory($api) {\n\t\tif(!self::$initialized) {\n\t\t\tthrow new \\Exception('Phoo not initialized (call Phoo::Initialize() in your auth file)');\n\t\t}\n\t\t$class = \"\\\\Phoo\\\\\".ucfirst($api);\n\t\treturn new $class(self::$partner_code, self::$secret_code);\n\t}", "public function __construct() {\n $this->connection = $this->create_connection();\n }", "public function client()\n {\n return new Client(['headers' => ['X-API-Key' => 'd4e47a6b49cdacb0524c12cfd5a3cadb9c102522', ]]);\n }", "private function _init_api_library($base_name)\n\t{\n\t\t// Generate the name of the class\n\t\t$class_name = $base_name.API_LIBRARY_SUFFIX;\n\n\t\t// Check if the implementing library exists\n\t\tif ( ! file($class_name.'.php'))\n\t\t{\n\t\t\tthrow new Exception('File not found',$class_name.'.php');\n\t\t}\n\n\t\t// Include the implementing API library file\n\t\trequire_once $class_name.'.php';\n\n\t\t// Temporary instance for type checking\n\t\t$temp_api_object = new $class_name($this);\n\n\t\t// Check if the implementing library is an instance of Api_Object\n\t\t// NOTE: All API libraries *MUST* be subclasses of Api_Object\n\t\tif ( ! $temp_api_object instanceof Api_Object)\n\t\t\tthrow new Exception('Invalid Api library', $class_name, 'Api_Object');\n\n\t\t// Discard the old copy\n\t\tunset($this->temp_api_object);\n\n\t\t// Instaniate a fresh copy of the API library\n\t\t$this->api_object = new $class_name($this);\n\n\t\t//print_r(get_class_methods($this->api_object));exit;\n\n\t}", "public function __construct()\n {\n $this->guzzle = new Guzzle();\n }", "private function __construct(){\n\t\t$this->connection = new Connection();\n\t\t$this->connection\n\t\t\t->setHost(Stack::getInstance()->get('db_host'))\n\t\t\t->setUser(Stack::getInstance()->get('db_user'))\n\t\t\t->setPassword(Stack::getInstance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getInstance()->get('db_table'))\n\t\t\t->connect();\n\t}", "public function __construct($config){\n $this->api = new LeadBIAPI($config);\n }", "public function __construct($config){\n $this->api = new LeadBIAPI($config);\n }", "public function api_connect($url);", "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 __construct($api_url = null, $username = null, $password = null) {\n $options = array(\n 'api_url' => $api_url,\n 'username' => $username,\n 'password' => $password\n );\n\n //configure api options\n $this->configure( $options );\n\n //validate api credentials\n $this->validateApiCredentials();\n }", "public function init()\n {\n $this->curl = (new Curl())->setOption(\n CURLOPT_HTTPHEADER, [\n 'Authorization: Basic ' . $this->apiKey,\n 'Content-Type: application/json'\n ]\n );\n }", "public function __construct(VultrApi $api)\n {\n $this->api = $api;\n }", "private function createCurlConnection($api_call)\n {\n $ch = curl_init($this->_url.$api_call);\n\n //for debugging\n //$fp = fopen(\"example_homepage.txt\", \"w\");\n //curl_setopt($ch, CURLOPT_FILE, $fp);\n\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n return $ch;\n }", "public function __construct()\n {\n include(ANAX_INSTALL_PATH . '/config/vars.php');\n $this->apikey = $apiKeyIp;\n $this->baseUrl = \"http://api.ipstack.com/\";\n $this->baseUrlMap = \"https://www.openstreetmap.org/\";\n $this->curl = new Curl();\n }", "public function __construct()\n {\n parent::setup();\n\n $this->client = new Client([\n \"base_uri\" => self::URL\n ]);\n }", "public static function get_api ()\n\t{\n\t\tif (self::$api === NULL)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tself::$api = new Mollie_API_Client;\n\t\t\t\tself::$api->setApiKey(MODULE_PAYMENT_MOLLIE_API_KEY);\n\n\t\t\t\tif (defined(\"PROJECT_VERSION\"))\n\t\t\t\t{\n\t\t\t\t\tself::$api->addVersionString(PROJECT_VERSION);\n\t\t\t\t}\n\n\t\t\t\tself::$api->addVersionString(\"MollieosCommerce/\" . self::VERSION);\n\t\t\t}\n\t\t\tcatch (Mollie_API_Exception $e)\n\t\t\t{\n\t\t\t\t// Without a connection to Mollie we cannot proceed with anything.\n\t\t\t\tdie($e->getMessage());\n\t\t\t}\n\t\t}\n\n\t\treturn self::$api;\n\t}", "public function createPayment() {\n $api = new ApiPayment($this->_clientId, $this->_clientSecret, $this->_isTest);\n return $api;\n }", "function H_API() {\n\treturn H_API\\Endpoints::get_instance();\n}", "public function __construct(\n string $api_private_key = SANDBOX_PRIVATE_KEY,\n string $api_public_key = SANDBOX_PUBLIC_KEY,\n ?array $guzzle_client_options = [],\n string $api_url = API_BASE_URL\n ) {\n\n $this->api_private_key = $api_private_key;\n $this->api_public_key = $api_public_key;\n $this->api_url = $api_url;\n\n // Keeps backward compatibility\n if (null === $guzzle_client_options) {\n $guzzle_client_options = [];\n }\n\n // Add user defined client options\n $guzzle_client_options = array_merge($guzzle_client_options, [\n 'base_uri' => $api_url,\n ]);\n\n $this->client = new Client($guzzle_client_options);\n }", "public function __construct()\n {\n // Initialize Guzzle for API calls\n $this->client = new Client([\n 'base_uri' => 'https://min-api.cryptocompare.com'\n ]);\n\n $this->conversion_currency = config('currency')['api_id']; // Real currency used for conversion\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 }", "public function __construct(ApiClient $apiClient)\n\t{\n\t\t$this->apiClient = $apiClient;\n\t}", "private function setConnection(){\n\n\n\t\t\t$this->apiKey = Settings::get( 'apiKey' );\n\n\t\t\tif( $this->apiKey ){\n\n\t\t\t\t$this->gateway = new MailChimp( $this->apiKey );\n\n\t\t\t}else{\n\n\t\t\t\t//log an error\n\n\t\t\t}\n\n\t\t}", "public function __construct()\n {\n $this->setApiKey();\n $this->setRequestOptions();\n }", "public function init() {\n parent::init();\n if (!is_object($this->api)) {\n $class = $this->api;\n $this->api = new $class;\n }\n $this->loadPlugins();\n }", "public static function Create(){\n return new ConnectionData();\n }", "public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => config('sportmonks.api_url'),\n 'verify' => app('env') !== 'production' ? false : true,\n ]);\n\n $this->apiToken = config('sportmonks.api_token');\n\n if (empty($this->apiToken)) {\n throw new \\InvalidArgumentException('No API token set');\n }\n\n $this->timezone = !empty(config('sportmonks.timezone'))\n ? config('sportmonks.timezone')\n : config('app.timezone');\n\n $this->withoutData = !empty(config('sportmonks.skip_data'))\n ? config('sportmonks.skip_data')\n : false;\n }", "public function __construct()\n {\n $this->_client = new Client([\n 'host' => 'api.instagram.com',\n 'scheme' => 'https'\n ]);\n }", "public function api()\n\t{\n\t\tif ( isset( $this->api->cached ) === TRUE ) return TRUE;\n\n\t\t// --------------------------------------------\n\t\t// API Object\n\t\t// --------------------------------------------\n\n\t\trequire_once $this->addon_path . 'api.fbc.php';\n\n\t\t$this->api = new Fbc_api();\n\t}", "public function __construct()\n {\n \n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n \n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct($apiKey, $guzzleOptions = [])\n {\n // Add passed in Guzzle options\n $options = array_merge(\n [\n // Do not throw exceptions for 4xx HTTP responses\n 'http_errors' => false,\n // Default headers\n 'headers' => [\n 'User-Agent' => 'SmartwaiverSDK:' . self::VERSION . '-php:' . phpversion(),\n 'sw-api-key' => $apiKey\n ]\n ],\n $guzzleOptions\n );\n\n // Set up a new Guzzle Client\n $this->client = new Client($options);\n }", "public static function create() {}" ]
[ "0.6843653", "0.6809767", "0.653734", "0.63781655", "0.6218249", "0.62134784", "0.619328", "0.617405", "0.615744", "0.6134391", "0.6134391", "0.6134391", "0.6129505", "0.612909", "0.6110133", "0.608595", "0.608026", "0.6064431", "0.60418785", "0.60283834", "0.59972966", "0.598408", "0.596567", "0.59564614", "0.59512496", "0.59214145", "0.5906318", "0.58946276", "0.5884699", "0.5831351", "0.58270895", "0.58154416", "0.5798122", "0.5794067", "0.57873535", "0.5784608", "0.57798094", "0.57782906", "0.5775567", "0.57718855", "0.5766596", "0.5763368", "0.5761637", "0.57506454", "0.57463855", "0.5742763", "0.5741648", "0.5739554", "0.57390326", "0.5738601", "0.5734339", "0.5734177", "0.57263035", "0.5707889", "0.5698929", "0.5697583", "0.56893337", "0.5682215", "0.5680117", "0.56746936", "0.5673102", "0.5673102", "0.5673102", "0.5673102", "0.5673102", "0.5663939", "0.56582606", "0.5657463", "0.56480825", "0.5647048", "0.5633856", "0.56280017", "0.5627648", "0.5627042", "0.5627042", "0.5626693", "0.56249785", "0.5619709", "0.56120837", "0.56066424", "0.5603702", "0.5595732", "0.5585212", "0.5577144", "0.5569718", "0.5566687", "0.5565834", "0.55592114", "0.5558177", "0.5552873", "0.5550019", "0.5538091", "0.55298084", "0.552846", "0.5528428", "0.5524839", "0.5523692", "0.5522157", "0.5522157", "0.55167437", "0.55150396" ]
0.0
-1
Create new Plans instance.
public function plans() { return new Plan($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(PlanningStoreRequest $request)\n {\n\n\n\n if($Planning = Planning::create($request->except('roles', 'permissions')) ) {\n return new PlanningResource($Planning);\n }\n \n }", "public function create()\n {\n $this->authorize('create', Plan::class);\n\n return view('admin.plans.create');\n \n }", "public function create()\n {\n \n return view('admin.plans.create');\n\n }", "public function create()\n {\n $courses = Auth::user()->courses;\n\n $knowledge_areas = KnowledgeArea::all();\n\n $data = array('knowledge_areas' => $knowledge_areas, 'courses' => $courses);\n\n return view('plans.create', $data);\n }", "public function create()\n\t{\n\t \n\t \n\t return view('admin.plans.create');\n\t}", "public function create()\n {\n $user = Auth::user();\n if (!$user || !$user->is_back_user()) {\n return redirect()->intended(route('admin/login'));\n }\n elseif (!$user->can('create-membership-plans')){\n return redirect()->intended(route('admin/error/permission_denied'));\n }\n\n $cash_terminals = CashTerminal::with('shopLocation')->get();\n $shops = ShopLocations::all();\n\n $breadcrumbs = [\n 'Home' => route('admin'),\n 'Administration' => route('admin'),\n 'Back End User' => route('admin'),\n 'Permissions' => '',\n ];\n $text_parts = [\n 'title' => 'Add new membership plan',\n 'subtitle' => '',\n 'table_head_text1' => 'Membership Plans - Create New'\n ];\n $sidebar_link = 'admin-backend-memberships-new_plans';\n\n return view('admin/membership_plans/add_plan', [\n 'breadcrumbs' => $breadcrumbs,\n 'text_parts' => $text_parts,\n 'in_sidebar' => $sidebar_link,\n 'cash_terminals' => $cash_terminals,\n 'shops' => $shops,\n ]);\n }", "public function create()\r\n\t{\r\n\t\t$details = $this->getDetailsArray(['UserGroups' => null]);\r\n\r\n\t\treturn view('admin.listing-plans.create', [\r\n\t\t\t'details' => $details\r\n\t\t]);\r\n\t}", "private function createPlan(){\n if(!$this->request->plan_name || !$this->request->plan_description) {\n return false;\n }\n $this->plan = Planes::create([\n 'name' => $this->request->plan_name,\n 'description' => $this->request->plan_description,\n 'price' => $this->request->price,\n 'product_id' => $this->request->product_id,\n 'balance' => $this->request->balance,\n ]);\n $this->plan = new PlanesFormatter($this->plan);\n }", "public function create()\n {\n return view('admin.plan.create');\n }", "public function create()\n\t{\n $plans = $this->plan->all();\n\t\treturn View::make('admin.userplans.create',compact('plans'));\n\t}", "public function create()\n {\n $mainmodules = MainModule::orderBy('position','ASC')->get();\n return view('admin.plans.create',compact('mainmodules'));\n }", "public function create()\n {\n return view('plan.create');\n }", "public function create()\n {\n\n return view('stripe.plan.create');\n\n }", "public function create()\n {\n $page_title = \"Create New STO\";\n $time = TimeSetting::all();\n return view('admin.plan.create', compact('page_title', 'plan','time'));\n }", "public function create($plan, array $properties = array());", "public function create()\n {\n return view('admin.member_ship_plans.create');\n }", "public function create()\n {\n return view('payplans.create');\n }", "public function __construct()\n {\n $this->plan = new Plan();\n }", "public function create()\n {\n $page_title = \"Create New Plan\";\n $time = TimeSetting::all();\n\n return view('admin.plan.create', compact('page_title','time'));\n }", "public function create()\n {\n \t\n \t$data= $this->data; \n \treturn view('admin.facility_plans.create', compact('data'));\n }", "public function create()\n {\n $postals = Cache::remember(\"postals\", 10080, function() {\n return Postal::all();\n });\n\n return view('map.grids.create')\n ->withPostals($postals);\n }", "public function create()\n {\n $preguntasl = new Preguntasl();\n return view('preguntasl.create', compact('preguntasl'));\n }", "public function create()\n {\n return view('backend.vendor-subscription-plan.create');\n }", "public function show($id)\n {\n $Planning = Planning::findOrFail($id);\n\n return new PlanningResource($Planning);\n }", "public function run()\n {\n Plan::factory()->createMany([\n ['id' => Plan::FREE_PLAN, 'name' => 'Free', 'monthly_payment' => 0],\n ['id' => Plan::BASIC_PLAN, 'name' => 'Basic', 'monthly_payment' => 100],\n ['id' => Plan::PLUS_PLAN, 'name' => 'Plus', 'monthly_payment' => 187],\n ]);\n }", "public function create()\n {\n $action_plans = ActionPlan::currentReport()->get();\n $observers = Observer::currentReport()->currentUser()->enabled()->get();\n $observer_types = ObserverTypes::optionsWithLabels();\n $data = json_encode(compact('action_plans', 'observers','observer_types'));\n\n return view('pulse-surveys.create', compact('data'));\n }", "public function create()\n {\n //\n return view(\"private.create-plataforma\");\n }", "public function create()\n {\n $polis = Poli::all();\n\n return view('pasien/create', compact('polis'));\n }", "public function create()\n {\n Gate::authorize('app.pay.create');\n $customers = Customers::get();\n $plan = Plan::get();\n\n return view('backend.pay.form', compact('plan', 'customers'));\n }", "public function monthly()\n {\n return new Plans(array_values(array_filter($this->plans, function ($plan) {\n return $plan->isMonthly();\n })));\n }", "public function create()\n {\n return view('newPlata');\n }", "public function getCreate()\n {\n $user = Auth::user();\n\n $_plans = Plan::all();\n $plans = [];\n\n foreach ($_plans as $plan) {\n $plans[$plan->id] = $plan->plan; \n }\n\n return view('website.create')->with([\n 'user' => $user,\n '_plans' => $_plans,\n 'plans' => $plans\n ]);\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($name, $id)\n {\n return $this->add(new Plan($name, $id));\n }", "public function create()\n {\n return view('plan_movil_pospago.create');\n }", "public function run()\n {\n $plans = [\n [\n 'name' => 'Monthly',\n 'slug' => 'monthly',\n 'gateway_id' => 'month_6',\n 'price' => 6.00,\n 'active' => true,\n 'teams_enabled' => false,\n 'teams_limit' => null,\n ],\n [\n 'name' => 'Yearly',\n 'slug' => 'yearly',\n 'gateway_id' => 'year_60',\n 'price' => 60.00,\n 'active' => true,\n 'teams_enabled' => false,\n 'teams_limit' => null,\n ],\n [\n 'name' => 'Monthly for 10 users',\n 'slug' => 'monthly-for-10-users',\n 'gateway_id' => 'team_month_55',\n 'price' => 55.00,\n 'active' => true,\n 'teams_enabled' => true,\n 'teams_limit' => 10,\n ],\n ];\n\n Plan::insert($plans);\n }", "public function create()\n {\n return view('pharmacies.create');\n }", "public function getCreate()\n {\n return view('plan.create');\n }", "public function create(Request $request)\n {\n if($request->isMethod('get')) {\n $instructor = Instructor::all()->pluck('staff_no', 'id');\n return view('portals.create', [\n 'instructor' => $instructor,\n ]);\n }\n\n $portals = new Portal;\n $portals->user_id = Auth::user()->id;\n $portals->name = $request->input('name');\n $portals->code = $request->input('code');\n $portals->semester = $request->input('semester');\n $portals->instructor_id = $request->input('instructor');\n $portals->save();\n\n return redirect('portals')->with('success', 'The portal has been created successfully.');\n }", "public function create()\n\t{\n $plan_id = Input::get('plan_id');\n $plan = $this->plan->find($plan_id);\n\t\treturn View::make('admin.plan_tasks.create',compact('plan'));\n\t}", "public function create()\n {\n return view('iquiz::admin.polls.create');\n }", "public function create($id)\n {\n return view('plans.create' , ['shop' => Shop::find($id)]);\n }", "public function create()\n {\n $simpan = new membership;\n }", "public function create()\n {\n //\n return view('application.plano.create');\n }", "public function create()\n {\n return view('daftar_pasiens.create');\n }", "public function create()\n\t{\n\t\treturn View::make(\"admin.new_tplan\");\n\t}", "public function creating(Plan $plan)//troquei o created por creating\n {\n $plan->url = Str::kebab($plan->name);\n }", "public function create()\n {\n return view('planos.create');\n }", "public function create()\n {\n $plants = Plant::all();\n $criterias = Criteria::all();\n $values = Value::all();\n return view('create_data', compact('plants', 'criterias', 'values'));\n }", "public function create()\n {\n return View::make('polys.create');\n }", "public function create()\n {\n $categories = Category::wherePanelId(null)->get();\n $judges = Judge::all();\n $auditors = Auditor::all();\n\n return view('admin.panels.create', compact('categories', 'judges', 'auditors'));\n }", "public function run()\n {\n Plan::create([\n 'name' =>'November Subscription Plan',\n 'description'=>\"It's time to increase your customers! Buy our subscription plan and save a spot of your choice amongst the top 20 restaurants that will be listed for a date night Hurry!\"\n ]);\n }", "public function plan_create( $plan_id, $amount, $name, $interval, $trial_days = FALSE ) {\r\n\t\t$params = array(\r\n\t\t\t'id' => $plan_id,\r\n\t\t\t'amount' => $amount,\r\n\t\t\t'name' => $name,\r\n\t\t\t'currency' => 'usd',\r\n\t\t\t'interval' => $interval\r\n\t\t);\r\n\t\tif( $trial_days )\r\n\t\t\t$params['trial_period_days'] = $trial_days;\r\n\t\t\t\r\n\t\treturn $this->_send_request( 'plans', $params, STRIPE_METHOD_POST );\r\n\t}", "public function create()\n {\n return view('pages.protfolios.create');\n }", "public function create()\n {\n $data['programs'] = DB::table('programs')->get();\n return view('admin.schedule.create', $data);\n\n }", "public function create()\n {\n $presencial = new Presencial;\n $presencial->protocolo = date('YmdHis').rand ( 0 , 10000 );\n return view('presencials.create', ['presencial'=>$presencial]);\n }", "public function newPanel() {\n $panel = new Panel();\n return $panel;\n }", "public function create()\n {\n //\n return view('productions.create');\n }", "public function listsFamilyplanningPost()\r\n {\r\n $input = Request::all();\r\n $new_familyPlan = FamilyPlanning::create($input);\r\n if($new_familyPlan){\r\n return response()->json(['msg' => 'Created a new Family plan']);\r\n }else{\r\n return response('Oops, seems like something went wrong while trying to create a new family plan');\r\n }\r\n }", "public function create()\n {\n $panens = Tanaman::all();\n\n return view('hasilpanens.create', compact('panens'));\n }", "public function create()\n {\n $project = new Project;\n\n return view('projects.create', compact('project'))\n ->with([\n 'pap_types' => RefPapType::all(),\n ]);\n }", "protected function form()\n {\n $categories = Category::get()->pluck('name', 'id')->toArray();\n\n $form = new Form(new Plan);\n\n $form->select(Plan::CATEGORY_ID, 'Категория')\n ->options($categories)\n ->default(request()->input(Plan::CATEGORY_ID))\n ->required();\n\n $form->text(Plan::COUNT, __('Количество'))->required();\n $form->month('month', __('Месяц'))->default(now()->month)->required();\n $form->year('year', __('Год'))->default(now()->year)->required();\n\n $form->footer(function ($footer) {\n\n // disable `View` checkbox\n $footer->disableViewCheck();\n\n // disable `Continue editing` checkbox\n $footer->disableEditingCheck();\n\n // disable `Continue Creating` checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "public function create()\n { \n // if we have any projects we render them\n return view('admin.production_company.create', [\n //'production_companies' => ProductionCompany::all()\n ]);\n }", "public function create()\n {\n return view('dashboard.portfolios.create');\n }", "function show_plan_add() {\n //must check that the user has the required capability \n if (!current_user_can('manage_options')) {\n csm_error('You do not have sufficient permissions to access this page', true);\n }\n \n $CsmWorkplace = new CsmWorkplace();\n $workplaces = $CsmWorkplace->all();\n \n //Add the member\n if (isset($_POST['action']) && $_POST['action'] === 'addplan') {\n $data = $_POST;\n $Csmplan = new CsmPlan();\n try {\n $Csmplan->create($_POST);\n csm_set_update('New membership plan was added');\n hacky_redirect('csm-plans');\n } catch (\\Exception $e) {\n csm_error($e->getMessage());\n }\n }\n \n include(CSM_PLUGIN_PATH . 'app/views/plan-add.view.php');\n}", "public function paid()\n {\n return new Plans(array_values(array_filter($this->plans, function ($plan) {\n return $plan->price > 0;\n })));\n }", "public function newAction()\n {\n $entity = new Panel();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view('memberships.create')->with('departments', Department::all())\n ->with('associations', Association::all())\n ->with('churchSetting', ChurchSetting::first());\n }", "public function run()\n {\n Plan::create([\n 'name' => 'Free Plan',\n 'trial_days' => 7,\n 'max_workspaces' => 1,\n 'max_users' => 5,\n 'max_clients' => 5,\n 'max_projects' => 5,\n 'image' => 'free_plan.png',\n 'status' => 1,\n ]);\n }", "public function create()\n {\n return view('spps.create');\n }", "public function create()\n {\n return view('pages.portfolios.create');\n }", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\tPlan::create([\n\t\t\t'name' => 'Gratuito', \n\t\t\t'quantity_oportunities' => 1, \n\t\t\t'price' => 0.0]);\n\t\tPlan::create([\n\t\t\t'name' => 'Básico', \n\t\t\t'quantity_oportunities' => 10, \n\t\t\t'price' => 99.0]);\n\t\tPlan::create([\n\t\t\t'name' => 'Premium', \n\t\t\t'quantity_oportunities' => 50, \n\t\t\t'price' => 149.0]);\n\t}", "public function create()\n {\n $karyawans = Karyawan::all();\n $details = Detail::all();\n\n return view('penilaians.create', compact('karyawans', 'details'));\n }", "public function create()\n {\n $pdp = Pdp::all();\n\n return view('/pdp', compact('pdp'));\n }", "public function create()\n {\n return view('layouts.goals.create');\n }", "public function created(PlanSubscription $planSubscription)\n {\n //\n }", "public function create()\n { \n\n $prog = new program();\n $areasM = \\App\\Area::all();\n $areas = [];\n foreach($areasM AS $a){ $areas[$a->id] = $a->nombre; }\n \n return view('programs.create')\n ->with('prog', $prog)\n ->with('areas', $areas);\n }", "public function create()\n {\n return view('pages.paket.create');\n //\n }", "public function create()\n {\n return view('admin.pkl.create');\n }", "public function create()\n {\n return view('mata_pelajarans.create');\n }", "public function create()\n {\n\t\t$programs = Program::active()->select('id', 'title')->latest()->get();\n return view('projects.create', compact('programs'));\n }", "public function create()\n {\n return View('pnrs.create');\n }", "public static function createNew()\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$type = self::TYPE_PUBLIC;\n\t\t\t$module = self::MODULE_TICKETS;\n\t\t\tlist($title) = func_get_args();\n\t\t} elseif (func_num_args() == 2) {\n\t\t\t$module = self::MODULE_TICKETS;\n\t\t\tlist($title, $type) = func_get_args();\n\t\t} else {\n\t\t\tlist($title, $type, $module) = func_get_args();\n\t\t}\n\t\t\n\t\t$new_department = new kyDepartment();\n\t\t$new_department->setTitle($title);\n\t\t$new_department->setType($type);\n\t\t$new_department->setModule($module);\n\t\treturn $new_department;\n\t}", "public function create()\n {\n return view('ptpn.create');\n }", "public function create(){\n \t//solo los administradores pueden listar preguntas\n // if(!Login::isAdmin())\n // throw new Exception(\"Debes ser administrador\");\n \t//recupera la lista de modulos\n $modulos=Modulo::get();\n\n //cagar los usuarios\n $usuario=Login::getUsuario();\n\n require_once 'view/pregunta/form_new.php';\n }", "public function __construct(array $plans = [])\n {\n $this->plans = $plans;\n }", "public function create()\n {\n $preguntasm = new Preguntasm();\n\n return view('preguntasm.create', compact('preguntasm'));\n }", "public function create()\n {\n return view('admin.programs.create');\n }", "public function create()\n {\n $id = DB::table('policies')->max('id');\n\n $id += 1;\n\n return view('admin.policies.create', compact('id'));\n }", "public function create()\n {\n return view('admin.pages.loaisanpham.create');\n }", "public function newProject()\n {\n\n GeneralUtility::checkReqFields(array(\"name\"), $_POST);\n\n $project = new Project();\n $project->create($_POST[\"name\"], $_SESSION[\"uuid\"]);\n\n }", "public function create()\n {\n //\n return view('plant.create');\n }", "public function create()\n {\n return view (\"runner.personas.create\");\n }", "public function create()\n {\n $jurusans = Jurusan::all();\n $pengujis = Penguji::all();\n return view('adminpanel.hasil.create', compact('jurusans', 'pengujis'));\n }", "public function create()\n {\n $stores = $this->project->getStores();\n $statistics = $this->project->getStatistics();\n $licensors = $this->project->getLicensors();\n $categories = $this->project->getAllCategories();\n $skills = $this->project->getAllSkills();\n $services = $this->project->getAllServices();\n $canDo = auth()->user()->role->canDoAll();\n $sub_categories = $this->project->getAllSubCategories();\n\n return view('pages.projects.create', compact('canDo', \n 'sub_categories', 'services', 'stores', \n 'categories', 'statistics', \n 'licensors', 'skills'));\n }", "public function create()\n {\n $department = Department::all();\n return view('dashboard.projects.create',compact('department'));\n }", "public function create()\n {\n $pac = $this->objPacientes->all();\n return view('create_sintomas', compact('pac'));\n }", "public function createPlan(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CreatePlanRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CreatePlanRequest', $parameters);\n }", "public function create()\n\t{\n\n\t\treturn view('admin.palestras.create');\n\t}", "public function create()\n {\n $mujeres = Mujer::all();\n return view('admin.preguntas.create', compact('mujeres'));\n }" ]
[ "0.6477332", "0.6415851", "0.64115614", "0.63549334", "0.63347363", "0.6299453", "0.62700987", "0.6258132", "0.61654556", "0.6082073", "0.6033417", "0.6019013", "0.60089403", "0.59414583", "0.59314644", "0.59280103", "0.5916841", "0.5868435", "0.5825511", "0.5824516", "0.57849264", "0.57783324", "0.5744213", "0.57011026", "0.5683887", "0.565908", "0.5648514", "0.5640992", "0.5639562", "0.5625836", "0.5623329", "0.56216574", "0.56053454", "0.56045055", "0.56034917", "0.55747163", "0.5562395", "0.55488414", "0.55364823", "0.5532996", "0.5517931", "0.55071616", "0.55052567", "0.55000633", "0.5498792", "0.5493072", "0.54819304", "0.54732096", "0.54729813", "0.54679203", "0.54576445", "0.5455259", "0.5455061", "0.54339397", "0.5423144", "0.5419539", "0.5419124", "0.54148215", "0.5398993", "0.537629", "0.5372518", "0.5363722", "0.5355944", "0.5355764", "0.53513014", "0.5348247", "0.5346013", "0.5332154", "0.5325509", "0.532283", "0.531941", "0.53178835", "0.5315916", "0.5313797", "0.5308407", "0.53064317", "0.5300282", "0.53001404", "0.5299159", "0.52938014", "0.52923065", "0.529148", "0.5290605", "0.52861047", "0.5283104", "0.5281858", "0.52766186", "0.5276416", "0.5271433", "0.52655894", "0.5263501", "0.52602726", "0.5253687", "0.5252253", "0.5248899", "0.5238235", "0.52358395", "0.52348006", "0.5234132", "0.5233924" ]
0.57570785
22
Create new Billing Info instance.
public function billingInfos() { return new BillingInfo($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateDefaultBillingWithReservation() {\n return new Billing();\n }", "public function create()\n {\n return view('billing::create');\n }", "public function create()\n {\n return view('billing::create');\n }", "private function generateDefaultBilling() {\n return new Billing('Postpaid');\n }", "public function createPayment()\n\t{\n\n\t}", "function add_billing_data($billObj) {\n\n $item = new stdClass();\n $item->trans_id = $billObj->transId;\n $item->cardholder = $billObj->billTo->firstName . ' ' . $billObj->billTo->lastName;\n $item->type = 'a';\n $item->address = $billObj->billTo->address;\n $item->state = $billObj->billTo->state;\n $item->city = $billObj->billTo->city;\n $item->zip = $billObj->billTo->zip;\n $item->pdate = time();\n\n $exists = $this->is_billing_data_exists($item->trans_id);\n if ($exists == 0) {\n $query = \"insert into mdl_billing_data \"\n . \"(transaction_id,\"\n . \"cardholder,\"\n . \"type,\"\n . \"address,\"\n . \"state,\"\n . \"city,\"\n . \"zip,\"\n . \"pdate) \"\n . \"values ('$item->trans_id',\"\n . \"'\" . addslashes($item->cardholder) . \"',\"\n . \"'$item->type',\"\n . \"'\" . addslashes($item->address) . \"',\"\n . \"'$item->state',\"\n . \"'\" . addslashes($item->city) . \"',\"\n . \"'$item->zip',\"\n . \"'$item->pdate')\";\n $this->db->query($query);\n } // end if $exists == 0\n }", "public function create()\n {\n\n $this->validate($this->request, Payment::createRules());\n\n $payment = new Payment;\n\n $payment->bill_id= $this->request->bill_id;\n \n $payment->save();\n \n return $this->response(201,\"Payment\", $payment );\n\n\n }", "protected function populate(stdClass $response)\n {\n $billingInfo = clone $this;\n $billingInfo->data = new stdClass();\n\n $billingInfo->data->holder_name = $this->getIfSet('holder_name', $response);\n $billingInfo->data->number = $this->getIfSet('number', $response);\n $billingInfo->data->expiration_month = $this->getIfSet('expiration_month', $response);\n $billingInfo->data->expiration_year = $this->getIfSet('expiration_year', $response);\n\n // FIXME: implementar boleto.\n\n return $billingInfo;\n }", "public function billing()\n\t{\n\t\t\n\t\t$this->templateFileName = 'billing.tpl';\n\t\t\n\t\t// Tracks if there was an error in the process\n\t\t$errors = [];\n\t\t\n\t\t\n\t\t// Get list of payment methods to output\n\t\t$paymentMethodSQL = <<<EOT\n\t\t\t\t SELECT\n\t\t\t\t\tpayment_id,\n\t\t\t\t\tpayment_type,\n\t\t\t\t\tcredit_card_type,\n\t\t\t\t\tpayment_name,\n\t\t\t\t\tRIGHT(account_number, 4) AS account_number_last_4,\n\t\t\t\t\tLPAD(RIGHT(account_number, 4), LENGTH(account_number), 'X') AS account_number,\n\t\t\t\t\tcard_expiration_month,\n\t\t\t\t\tcard_expiration_year,\n\t\t\t\t\trp.description AS payment_type_description,\n\t\t\t\t\trc.description AS credit_card_type_description\n\t\t\t\t FROM\n\t\t\t\t\tb_payment\n\t\t\t\t\tINNER JOIN b_reference rp ON rp.data_member = 'PAYMENT_TYPE' AND rp.data_value = payment_type\n\t\t\t\t\tLEFT OUTER JOIN b_reference rc ON rc.data_member = 'CREDIT_CARD_TYPE' AND rc.data_value = credit_card_type\n\t\t\t\t WHERE \n\t\t\t\t\trecord_status = 'A'\n\t\t\t\t\tAND user_id = ?\nEOT;\n\t\t$paymentMethods = $this->dbConnection->prepareRecordSet( $paymentMethodSQL, $this->session->userID );\n\t\t\n\t\t// Get list of addresses to output\n\t\t$addresses = $this->getAddresses();\n\t\t\n\t\t\n\t\t// Get list of payment types from reference table\n\t\t$paymentTypes = $this->dbConnection->recordSet(\"SELECT * FROM b_reference WHERE data_member = 'PAYMENT_TYPE' ORDER BY description\");\n\t\t\n\t\t// Get list of credit card types\n\t\t$creditCardTypes = $this->dbConnection->recordSet(\"SELECT * FROM b_reference WHERE data_member = 'CREDIT_CARD_TYPE' ORDER BY description\");\n\t\t\n\t\t// Set output\n\t\t$this->set('payment_methods', $paymentMethods);\n\t\t$this->set('addresses', $addresses);\n\t\t$this->set('payment_types', $paymentTypes);\n\t\t$this->set('credit_card_types', $creditCardTypes);\n\t\t\n\t\t\n\t\t\n\t\t// Handle form input, if submitted\n\t\tif (count($_POST) > 0 && isset($_POST['billingSubmit']))\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t// Did the user select a billing address?\n\t\t\tif (!isset($_POST['addressSelect']) || empty($_POST['addressSelect']))\n\t\t\t\t$errors[] = 'Please select a billing address.';\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The user selected a billing address, determine what to do based on selection.\n\t\t\t\tif($_POST['addressSelect'] == 'new')\n\t\t\t\t{\n\t\t\t\t\t// The user selected to enter a new billing address\n\t\t\t\t\t// Do form validation\n\n\t\t\t\t\t\n\t\t\t\t\t$formComplete = true;\n\t\t\t\t\t$addressFieldErrors = [];\n\t\t\t\t\t\n\t\t\t\t\tif ( ! isset($_POST['address_name']) || empty($_POST['address_name']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$addressFieldErrors['address_name'] = 'Address Name is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['address_1']) || empty($_POST['address_1']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$addressFieldErrors['address_1'] = 'Address Line 1 is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['city']) || empty($_POST['city']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$addressFieldErrors['city'] = 'City is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['state']) || empty($_POST['state']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$addressFieldErrors['state'] = 'State is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['zip']) || empty($_POST['zip']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$addressFieldErrors['zip'] = 'Zip is required';\n\t\t\t\t\t\t$formComplete = false;\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$sanitized_zip = preg_replace('/\\D/', '', (string)$_POST['zip']);\n\t\t\t\t\t\t$zip_length = strlen($sanitized_zip);\n\t\t\t\t\t\tif ( $zip_length != 5 && $zip_length != 9 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t$fieldErrors['zip'] = 'Zip must be 5 or 9 digits.';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($zip_length == 9)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_POST['zip'] = substr($sanitized_zip, 0, 5) . '-' . substr($sanitized_zip, 5, 4);\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$_POST['zip'] = $sanitized_zip;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($formComplete)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t// The form is complete, so create the record\n\t\t\t\t\t\t$insertSQL = \"INSERT INTO b_user_address (user_id, address_name, address_1, address_2, city, state, zip, record_status) \"\n\t\t\t\t\t\t . \"VALUES(?, ?, ?, ?, ?, ?, ?, 'A')\";\n\t\t\t\t\t\tif ( ! $this->dbConnection->prepareCommand($insertSQL, $this->session->userID, $_POST['address_name'], $_POST['address_1'], $_POST['address_2'], $_POST['city'], $_POST['state'], $_POST['zip']) )\n\t\t\t\t\t\t\t$errors[] = 'Error creating record. Please try again.';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// The record was successfully created, so set the shipping address ID and move on to the next step\n\t\t\t\t\t\t\t$this->session->billingAddressID = $this->dbConnection->insert_id;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$errors[] = 'Billing Address is incomplete.';\n\t\t\t\t\t\t$this->set('addressFieldErrors', $addressFieldErrors);\n\t\t\t\t\t}\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// The user selected an existing billing address\n\t\t\t\t\t// Do validation on the selected address\n\t\t\t\t\t$address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $_POST['addressSelect']);\n\t\t\t\t\tif (!$address)\n\t\t\t\t\t\t$errors[] = 'Error selecting address. This address does not exist.';\n\t\t\t\t\telseif ( $address['user_id'] != $this->session->userID )\n\t\t\t\t\t\t$errors[] = 'Error: The selected address is for a different user.';\n\t\t\t\t\telseif ( $address['record_status'] != 'A')\n\t\t\t\t\t\t$errors[] = 'Error: The selected address is not active.';\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// The address is valid, so use it.\n\t\t\t\t\t\t// set the shipping address and move on to the next step\n\t\t\t\t\t\t$this->session->billingAddressID = $_POST['addressSelect'];\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\t\n\t\t\t// Did the user select a payment method?\n\t\t\tif (!isset($_POST['paymentSelect']) || empty($_POST['paymentSelect']))\n\t\t\t\t$errors[] = 'Please select a payment method';\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The usre selected a payment method, determine what to do based on selection\n\t\t\t\tif ($_POST['paymentSelect'] == 'new')\n\t\t\t\t{\n\t\t\t\t\t// The user selected to enter a new payment method\n\t\t\t\t\t// Do form validation\n\t\t\t\t\t$formComplete = true;\n\t\t\t\t\t$validValues = true;\n\t\t\t\t\t$paymentFieldErrors = [];\n\n\t\t\t\t\tif ( ! isset($_POST['payment_type']) || empty($_POST['payment_type']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$paymentFieldErrors['payment_type'] = 'Payment Type is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Depending on the payment type, different fields are required\n\t\t\t\t\tswitch($_POST['payment_type'])\n\t\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\t// Credit card\n\t\t\t\t\t\tcase 'C':\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( ! isset($_POST['payment_card_type']) || empty($_POST['payment_card_type']) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_card_type'] = 'Credit Card Type is required';\n\t\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\tif ( ! isset($_POST['payment_name']) || empty($_POST['payment_name']) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_name'] = 'Card Name is required';\n\t\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( ! isset($_POST['payment_account_number']) || empty($_POST['payment_account_number']) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_account_number'] = 'Account Number is required';\n\t\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ( !ctype_digit($_POST['payment_account_number']) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_account_number'] = 'Payment Account Number must be a whole number';\n\t\t\t\t\t\t\t\t$validValues = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( ! isset($_POST['payment_expiration_month']) || empty($_POST['payment_expiration_month']) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_expiration_month'] = 'Expiration Month is required';\n\t\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( ! isset($_POST['payment_expiration_year']) || empty($_POST['payment_expiration_year']) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_expiration_year'] = 'Expiration Year is required';\n\t\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (!ctype_digit($_POST['payment_expiration_year']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_expiration_year'] = 'Expiration Year must be a whole number';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( ! (empty($_POST['payment_expiration_month']) || empty($_POST['payment_expiration_year']) ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Check if the card is expired\n\t\t\t\t\t\t\t\t$current_month = date(\"n\");\n\t\t\t\t\t\t\t\t$current_year4 = date(\"Y\");\n\t\t\t\t\t\t\t\t$cardDate = new \\DateTime();\n\n\t\t\t\t\t\t\t\tif ( strlen($_POST['payment_expiration_year']) != 4 )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_expiration_year'] = 'Credit Card Expiration Year must be a 4 digit year.';\n\t\t\t\t\t\t\t\t\t$validValues = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif ( !ctype_digit($_POST['payment_expiration_year']) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_expiration_year'] = 'Credit Card Expiration Year must be a whole number';\n\t\t\t\t\t\t\t\t\t$validValues = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif ( $current_year4 > $_POST['payment_expiration_year']\n\t\t\t\t\t\t\t\t\t\t\t|| $current_year4 == $_POST['payment_expiration_year'] && $current_month > $_POST['payment_expiration_month'] )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_expiration_year'] = 'Credit card has expired.';\n\t\t\t\t\t\t\t\t\t$validValues = false;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Validate the card expiration date\n\t\t\t\t\t\t\t\tif (!checkdate( (int)$_POST['payment_expiration_month'], 1, (int)$_POST['payment_expiration_year']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_expiration_year'] = 'Credit Card Expiration Date is not valid.';\n\t\t\t\t\t\t\t\t\t$validValues = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif ( $cardDate->setDate($_POST['payment_expiration_year'], $_['payment_expiration_month'], 1) === false )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_expiration_year'] = 'Credit Card Expiration Date is not valid.';\n\t\t\t\t\t\t\t\t\t$validValues = false;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( ! isset($_POST['payment_security_code']) || empty($_POST['payment_security_code']) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_security_code'] = 'Security Code is required';\n\t\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif (!ctype_digit($_POST['payment_security_code']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_security_code'] = 'Credit Card Security Code must be a whole number.';\n\t\t\t\t\t\t\t\t$validValues = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'P':\n\t\t\t\t\t\n\t\t\t\t\t\t\tif ( ! isset($_POST['payment_name']) || empty($_POST['payment_name']) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_name'] = 'Paypal Account Email Address is required';\n\t\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ( !filter_var($_POST['payment_name'], FILTER_VALIDATE_EMAIL) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// The email address is not a valid format\n\t\t\t\t\t\t\t\t$paymentFieldErrors['payment_name'] = \"The email address {$_POST['payment_name']} is an incorrect format.\";\n\t\t\t\t\t\t\t\t$validValues = false;\n\t\t\t\t\t\t\t}\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\n\t\t\t\t\t\n\t\t\t\t\tif ($formComplete && $validValues)\n\t\t\t\t\t{\n\t\t\t\t\t\t// The form is complete, so create the record\n\t\t\t\t\t\t$insertSQL = \"INSERT INTO b_payment (user_id, payment_type, credit_card_type, payment_name, account_number, card_expiration_month, card_expiration_year, card_security_code, record_status) \"\n\t\t\t\t\t\t . \"VALUES(?, ?, ?, ?, ?, ?, ?, ?, 'A')\";\n\t\t\t\t\t\tif ( ! $this->dbConnection->prepareCommand($insertSQL, $this->session->userID, $_POST['payment_type'], $_POST['payment_card_type'], $_POST['payment_name'], $_POST['payment_account_number'], $_POST['payment_expiration_month'], $_POST['payment_expiration_year'], $_POST['payment_security_code']) )\n\t\t\t\t\t\t\t$errors[] = 'Error creating record. Please try again.';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// The record was successfully created, so set the shipping address ID and move on to the next step\n\t\t\t\t\t\t\t$this->session->paymentMethodID = $this->dbConnection->insert_id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// The form is incomplete, so issue an error\n\t\t\t\t\t\tif (!$formComplete)\n\t\t\t\t\t\t\t$errors[] = 'Payment Type is incomplete';\n\t\t\t\t\t\tif (!$validValues)\n\t\t\t\t\t\t\t$errors[] = 'Some fields have invalid values';\n\t\t\t\t\t\t$this->set('paymentFieldErrors', $paymentFieldErrors);\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\telse\n\t\t\t\t{\n\t\t\t\t\t// The user selected an existing payment method\n\t\t\t\t\t// Do validation on the selected payment method\n\t\t\t\t\t$payment = $this->dbConnection->prepareRecord(\"SELECT * FROM b_payment WHERE payment_id = ?\", $_POST['paymentSelect']);\n\t\t\t\t\tif (!$payment)\n\t\t\t\t\t\t$errors[] = 'Error selecting payment method. This payment method does not exist.';\n\t\t\t\t\telseif ( $payment['user_id'] != $this->session->userID )\n\t\t\t\t\t\t$errors[] = 'Error: The selected payment method is for a different user.';\n\t\t\t\t\telseif ( $address['record_status'] != 'A')\n\t\t\t\t\t\t$errors[] = 'Error: The selected payment method is not active.';\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// The address is valid, so use it.\n\t\t\t\t\t\t// set the shipping address and move on to the next step\n\t\t\t\t\t\t$this->session->paymentMethodID = $_POST['paymentSelect'];\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\t\n\t\t\t// If no errors, then move on to next screen\n\t\t\tif (count($errors) == 0)\n\t\t\t{\n\t\t\t\t// There were no errors, process the form and move on to the next screen\n\t\t\t\t$this->__default();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\n\t\t$this->set('errors', $errors);\n\t\t\n\t\t\t\n\t\t// Set the selection fields if there are already values selected\n\t\tif ($this->session->billingAddressID)\n\t\t\t$this->set('addressSelect', $this->session->billingAddressID);\n\t\tif ($this->session->paymentMethodID)\n\t\t\t$this->set('paymentSelect', $this->session->paymentMethodID);\n\n\t\t// Set all of the view data for post data so the form will be reloaded\n\t\tforeach ($_POST as $id => $val)\n\t\t{\n\t\t\t$this->set($id, $val);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Get the list of state codes to output\n\t\t$states = $this->dbConnection->recordSet(\"SELECT short_description AS code, long_description AS name FROM b_value WHERE data_member = 'STATE' ORDER BY short_description\");\n\t\t$this->set('states', $states);\n\t\t\n\t\t\n\t\t\t\n\t}", "public function create()\n {\n $clients = [];\n foreach ( Client::all() as $client) {\n $clients[$client->id] = $client->area_name->code\n . '-' . sprintf(\n \t\"%'.03d\\n\",\n\t $client->id\n\t ) . ' ' . $client->name;\n }\n $billings = [];\n foreach ( Billing::all() as $billing) {\n $billings[$billing->id] = sprintf(\"%'.05d\\n\", $billing->id);\n }\n return view(\n \t'payments.create',\n\t compact('clients', 'billings')\n );\n }", "public function createBillingRecord( Request $request )\n {\n try {\n $user = auth()->user();\n $card = $user->createStripeRecord( $request->token );\n\n // Subscribe\n $user->refresh();\n auth()->user()->billing->createBusinessSubscription( (int) $request->amount );\n } catch( \\Exception $e ) {\n flash($e->getMessage(), 'danger');\n return redirect( route( 'Subscribe' ) );\n }\n\n flash('Thank you for your subscription!', 'success');\n return redirect( route( 'Add Business', ['onboard' => true] ) );\n }", "public function create()\n {\n //Create Payment\n return view('billing.payment.create');\n }", "public function newPaymentAddress() {\n $result = $this->newAPIRequest('POST', '/addresses', []);\n return $result;\n }", "public function create()\n {}", "private function _populateDealerAccount()\n {\n return $this->dealer_account->create(\n $this->dealerAccountData['name'], \n $this->dealerAccountData['branch_ID'],\n $this->dealerAccountData['promotor_ID']\n ); \n }", "public function create() {\n // Prepares query\n $query = \"INSERT INTO \" . Bill::$table_name . \" SET date=:date, user=:user,\n payment=:payment, paid=:paid\";\n $stmt = $this->db->prepare($query);\n\n // Sets the variables in the query to the corresponding attribute values of the bill object\n $stmt->bindParam(\":date\", $this->date);\n $stmt->bindParam(\":user\", $this->user);\n $stmt->bindParam(\":payment\", $this->payment);\n $stmt->bindParam(\":paid\", $this->paid);\n\n // If the execution of the query is successful return true and set the ID of the bill object\n // To the one of the newly created record in the database.\n if($stmt->execute()) {\n $this->id = $this->db->lastInsertId();\n return true;\n } else {\n return false;\n }\n }", "protected function createDonorEntry()\n {\n $this->donor = new Donor;\n \n $this->donor->set('email', $this->data['email']);\n $this->donor->set('first_name', $this->data['first_name']);\n $this->donor->set('last_name', $this->data['last_name']);\n $this->donor->set('anonymity', $this->data['anonymity'] );\n $this->donor->set('hide_amount', $this->data['hide_amount'] );\n $this->donor->set('receipt_key', $this->receipt_key);\n \n $this->donor->create();\n }", "private function __construct() {\n\t\t$this->_applicationName = 'Billing';\n\t\t$this->_receiptController = Billing_Controller_Receipt::getInstance();\n\t\t$this->_supplyReceiptController = Billing_Controller_SupplyReceipt::getInstance();\n\t\t$this->_currentAccount = Tinebase_Core::getUser();\n\t\t$this->_doContainerACLChecks = FALSE;\n\t\t$this->setOutputType();\n\t}", "public function create()\n {\n $this->authorize('admin.billing-account.create');\n\n return view('admin.billing-account.create');\n }", "public function newAction()\n {\n $billingclass = new Billingclass();\n $form = $this->createForm(BillingclassType::class, $billingclass);\n\n return array(\n 'billingclass' => $billingclass,\n 'form' => $form->createView(),\n );\n }", "protected function createDonorAddressEntry()\n {\n $this->donor_address = new DonorAddress;\n \n $this->donor_address->set('donor_id', $this->donor->get('id'));\n $this->donor_address->set('address', $this->data['address']);\n $this->donor_address->set('city', $this->data['city']);\n $this->donor_address->set('region', $this->data['region']);\n $this->donor_address->set('country', $this->data['country']);\n $this->donor_address->set('postal_code', $this->data['postal_code']);\n $this->donor_address->set('telephone', $this->data['telephone']);\n \n $this->donor_address->create();\n }", "public function create(){}", "public function create()\n\t{\n\t\treturn view('billings.create');\n\t}", "public function __construct(BeaconBilling $beacon_billing) {\n $this->beaconBilling = $beacon_billing;\n }", "public function createAction()\n {\n $addressData = $this->getRequest()->getPost('speedy_address', array());\n $pickingData = $this->getRequest()->getPost('picking', array());\n\n try {\n /** @var Extendix_SpeedySimpleShipping_Helper_Bol $bolHelper */\n $bolHelper = Mage::helper('speedy_simple_shipping/bol');\n\n $bolHelper->prepare(0, $addressData, $pickingData);\n\n $resultBol = $bolHelper->createBol();\n\n $this->_ajaxResponse['has_error'] = false;\n $this->_ajaxResponse['message'] = $this->__('The BOL was created.');\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($this->_ajaxResponse));\n\n } catch(Exception $e) {\n $this->_ajaxResponse['has_error'] = true;\n $this->_ajaxResponse['message'] = $this->__($e->getMessage());\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($this->_ajaxResponse));\n }\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public function newPurchase($options = array())\n {\n return $this->newItem(\"purchase\", \"purchases\", $options);\n }", "public function __construct($bank_ica = null, $loyalty_code = null, $product_name = null, $delink_reason = null, $account_alias_name = null, $card_holder_name = null, $cobrand_card = null, $pseudo_pan = null, $card_program_code = null, $registration_channel_id = null, $custom_field_7 = null, $custom_field_8 = null, $custom_field_9 = null, $custom_field_10 = null, $custom_field_11 = null, $custom_field_12 = null, $custom_field_13 = null, $custom_field_14 = null, $custom_field_15 = null)\n {\n $this\n ->setBank_ica($bank_ica)\n ->setLoyalty_code($loyalty_code)\n ->setProduct_name($product_name)\n ->setDelink_reason($delink_reason)\n ->setAccount_alias_name($account_alias_name)\n ->setCard_holder_name($card_holder_name)\n ->setCobrand_card($cobrand_card)\n ->setPseudo_pan($pseudo_pan)\n ->setCard_program_code($card_program_code)\n ->setRegistration_channel_id($registration_channel_id)\n ->setCustom_field_7($custom_field_7)\n ->setCustom_field_8($custom_field_8)\n ->setCustom_field_9($custom_field_9)\n ->setCustom_field_10($custom_field_10)\n ->setCustom_field_11($custom_field_11)\n ->setCustom_field_12($custom_field_12)\n ->setCustom_field_13($custom_field_13)\n ->setCustom_field_14($custom_field_14)\n ->setCustom_field_15($custom_field_15);\n }", "public function create() {}", "public function create_billing_agreement_with_creditcard($requestData){\n \n $agreement = new Agreement();\n if($this->checkEmptyObject($requestData['agreement'])){\n $this->setArrayToMethods(array_filter($requestData['agreement']), $agreement);\n }\n \n // Add Plan ID\n // Please note that the plan Id should be only set in this case.\n $plan = new Plan();\n $plan->setId($requestData['planId']);\n \n $agreement->setPlan($plan); \n \n // Add Payer\n $payer = new Payer();\n if($this->checkEmptyObject($requestData['payer'])){\n $this->setArrayToMethods(array_filter($requestData['payer']), $payer);\n }\n if($this->checkEmptyObject($requestData['payerInfo'])){\n $payer->setPayerInfo(new PayerInfo(array_filter($requestData['payerInfo'])));\n }\n \n // Add Credit Card to Funding Instruments\n $card = new CreditCard();\n if($this->checkEmptyObject($requestData['creditCard'])){\n $this->setArrayToMethods(array_filter($requestData['creditCard']), $card);\n }\n $fundingInstrument = new FundingInstrument();\n if($this->checkEmptyObject((array)$card)){\n $fundingInstrument->setCreditCard($card);\n }\n if($this->checkEmptyObject((array)$fundingInstrument)){\n $payer->setFundingInstruments(array($fundingInstrument)); \n }\n //Add Payer to Agreement\n if($this->checkEmptyObject((array)$payer)){\n $agreement->setPayer($payer);\n } \n // Add Shipping Address\n if($this->checkEmptyObject($requestData['shippingAddress'])){\n $shippingAddress = new ShippingAddress();\n $this->setArrayToMethods(array_filter($requestData['shippingAddress']), $shippingAddress);\n $agreement->setShippingAddress($shippingAddress); \n } \n // ### Create Agreement\n try {\n // Please note that as the agreement has not yet activated, we wont be receiving the ID just yet.\n $requestArray= clone $agreement;\n $agreement = $agreement->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['AGREEMENT'] = $agreement->toArray();\n $returnArray['RAWREQUEST']=$requestArray;\n $returnArray['RAWRESPONSE']=$agreement->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "private function __construct() {\n\t\t$this->_applicationName = 'Billing';\n\t\t$this->_backend = new Billing_Backend_SupplyReceipt();\n\t\t$this->_modelName = 'Billing_Model_SupplyReceipt';\n\t\t$this->_currentAccount = Tinebase_Core::getUser();\n\t\t$this->_purgeRecords = FALSE;\n\t\t$this->_doContainerACLChecks = FALSE;\n\t\t$this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n\t}", "public function create()\n {\n if(!$this->isXmlHttpRequest()){\n throw new \\Exception(__(\"Wrong request mode\"));\n }\n\n $resource = $this->getResource($this->getRequestParameter('id'));\n if ($resource->isClass()) {\n $clazz = $this->getClass($resource->getUri());\n } else {\n $clazz = reset($resource->getTypes());\n }\n\n $label = $this->getClassService()->createUniqueLabel($clazz);\n $item = $this->getClassService()->createInstance($clazz, $label);\n $this->getEventManager()->trigger(new BatteryCreatedEvent($item, [$label]));\n\n if(!is_null($item)) {\n $response = array(\n 'label'\t=> $item->getLabel(),\n 'uri' \t=> $item->getUri(),\n 'success' \t=> true,\n );\n } else {\n $response = ['success' => false];\n }\n\n $this->returnJson($response);\n }", "public function create() {\r\n }", "public function create()\n {\n $invoice = new InvoiceEntity();\n $invoice->setNumber('019101910191091')\n ->setValue(100.90)\n ->setUrl('http://domain.com')\n ->setIssuanceDate('2017-09-15')\n ->setKey('POL9898AS');\n\n $tracking = new TrackingEntity();\n $tracking->setOrderId('00001010101AA')\n ->setStatus('in_route')\n ->setCode('BR800OPR5')\n ->setInvoice($invoice);\n\n $this->dm->persist($tracking);\n $this->dm->flush();\n }", "public function create() {\n\t\t\t//\n\t\t}", "protected function createPayment() {\n /* @var \\Drupal\\commerce_payment\\Plugin\\Commerce\\PaymentGateway\\PaymentGatewayInterface $payment_gateway */\n $payment_gateway = $this->order->payment_gateway->entity;\n $payment_method = $this->order->payment_method->entity;\n\n $now = REQUEST_TIME;\n $mode = SIPSPaymentGateway::MODES[$payment_gateway->getPlugin()->configuration['mode']];\n\n // Create a payment entity which will be initially in \"pending mode\":\n // \"pending mode\": means that the payment was still not finished in SIPS,\n // so the user is in the platform filling in the credit card or he/she had\n // problems to pay that time (timeout/closed the browser/etc).\n $payment = Payment::create([\n 'order_id' => $this->order->id(),\n 'payment_method' => $payment_method->id(),\n 'payment_gateway' => $payment_gateway->id(),\n // Give it a status: pending/failed/done.\n 'state' => 'new',\n 'remote_state' => 'pending',\n // Give it a max_timestamp of 24 hours.\n 'authorization_expires' => $now + (24 * 60 * 60),\n // Give it a transaction reference.\n 'remote_id' => $this->order->id() . $now,\n 'test' => $mode != PaymentRequest::PRODUCTION,\n 'amount' => $this->order->getTotalPrice(),\n ]);\n\n $payment->save();\n\n return $payment;\n }", "public function create()\n\t{\n\t\t$this->auth->restrict('Purchase_Order.Orders.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_purchase_order())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('purchase_order_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'purchase_order');\n\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/orders/purchase_order');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_failure') . $this->purchase_order_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('purchase_order', 'purchase_order.js');\n\n\t\tTemplate::set('toolbar_title', lang('purchase_order_create') . ' Purchase Order');\n\t\tTemplate::render();\n\t}", "protected function createDonationEntry()\n {\n $this->donation = new Donation;\n \n $this->donation->set('donor_id', $this->donor->get('id'));\n $this->donation->set('fundraiser_id', $this->fundraiser_profile->get('user_id'));\n $this->donation->set('amount', $this->data['amount']);\n \n $this->donation->create();\n }", "public function create()\n {\n return view(\"purchases.create\");\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n //TODO\n }", "public function create() {\n }", "public function create() {\n }", "public function getBilling();", "public function create() {\n //\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}", "public function create() {\n\t\tupdate_option( 'woocommerce_calc_taxes', 'yes' );\n\t\tupdate_option( 'woocommerce_prices_include_tax', 'yes' );\n\n\t\t// Create tax rates.\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '25' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '12' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '6' );\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t}", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "protected function create()\n {\n return $this->proxyStripeExceptions(function () {\n return Customer::create([\n 'email' => $this->user->email,\n 'metadata' => [\n 'first_name' => $this->user->first_name,\n 'last_name' => $this->user->last_name,\n ],\n ]);\n });\n }", "public function create()\n {\n $credentials = Request()->validate([\n 'name' => ['required','string'],\n 'price' => ['required','numeric'],\n 'stock' => ['required','numeric'],\n 'instrument_type_id' => ['required']\n ]);\n Instrument::create([\n 'name' => request('name'),\n 'price' => request('price'),\n 'stock' => request('stock'),\n 'instrument_type_id' => request('instrument_type_id')\n ]);\n Binnacle::create([\n 'entity' => \"El insumo : \". request('name'),\n 'action' => \"inserto\",\n 'table' => \"Insumos\",\n 'user_id'=> Auth::user()->id\n ]);\n return redirect()->route('instruments.eachOne');\n }", "public function create()\r\n\t{\r\n\t\t//\r\n\t}", "public function new() {\n\t\t// For example 420483159374869903504802205626 -> USPS & DHL ECommerce & YANWEN & 4PX\n\t\t// For example 1Z95548F1380393061 -> UPS\n\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->autoRender = false;\n\n\t\t\t$trackingNumber = $this->request->params['named']['number'];\n\n\t\t\t// Get user\n\t\t\t$user = $this->Auth->user();\n\t\t\tif (!$user) {\n\t\t\t\treturn json_encode([\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => __('message.error.unauthorized')\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t$api = 'aftership';\n\t\t\t$key = Configure::read('aftership.key');\n\n\t\t\t// Get carrier\n\t\t\t$courier = new AfterShip\\Couriers($key);\n\t\t\t$carriers = $courier->detect($trackingNumber);\n\t\t\tif ($carriers['meta']['code'] != '200'){\n\t\t\t\treturn json_encode([\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => __('message.error.carrier_not_found')\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t$carrier = [\n\t\t\t\t'carrier_code' => $carriers['data']['couriers'][0]['slug'],\n\t\t\t\t'carrier_name' => $carriers['data']['couriers'][0]['name'],\n\t\t\t];\n\n\t\t\t// Create tracking\n\t\t\t$trackings = new AfterShip\\Trackings($key);\n\t\t\ttry {\n\t\t\t\t$tracking = $trackings->get($carriers['data']['couriers'][0]['slug'], $trackingNumber);\n\t\t\t}\n\t\t\tcatch (AfterShip\\AfterShipException $e) {\n\t\t\t\t$tracking = $trackings->create($trackingNumber, ['slug' => $carriers['data']['couriers'][0]['slug']]);\n\t\t\t\tsleep(5);\n\t\t\t\t$tracking = $trackings->get($carriers['data']['couriers'][0]['slug'], $trackingNumber);\n\t\t\t}\n\n\t\t\tif ($tracking['data']['tracking']['tag'] == 'Pending') {\n\t\t $trackingmore = new Trackingmore;\n\t\t $carrier_ = $trackingmore->detectCarrier($trackingNumber);\n\t if ($carrier_['meta']['code'] == '200') {\n\t \t$carriers = $carrier_['data'];\n\t\t\t\t\t$tracking_ = $trackingmore->getRealtimeTrackingResults($carriers[0]['code'], $trackingNumber);\n\t\t\t\t\tif ($tracking_['meta']['code'] == '200' && $tracking_['data']['items'][0]['status'] != 'notfound') {\n\t\t\t\t\t\t$tracking = $tracking_;\n\t\t\t\t\t\t$api = 'trackingmore';\n\t\t\t\t\t\t$carrier = [\n\t\t\t\t\t\t\t'carrier_code' => $carriers[0]['code'],\n\t\t\t\t\t\t\t'carrier_name' => $carriers[0]['name']\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Save user's parcel in DB\n\t\t\t$this->loadModel('TrackParcel');\n\t\t\t$trackparcel = $this->TrackParcel->save([\n\t\t\t\t'customer_id' => $user['id'],\n\t\t\t\t'num_parcel' => $trackingNumber,\n\t\t\t\t'carrier_code' => $carrier['carrier_code'],\n\t\t\t\t'carrier_name' => $carrier['carrier_name'],\n\t\t\t\t'api' => $api\n\t\t\t]);\n\n\t\t\t// Save in Session for next loading\n\t\t\t$this->Session->write($trackingNumber, [\n\t\t\t\t'trackparcel' => $trackparcel,\n\t\t\t\t'tracking' => $tracking\n\t\t\t]);\n\n\t\t\t// Return tracking HTML element\n\t\t\t$this->set('trackparcel', $trackparcel);\n\t\t\t$this->set('tracking', $tracking);\n\t\t\t$this->layout = 'ajax';\n\t\t\treturn $this->render('/Elements/tracking_'.$api);\n\t\t}\n\n\t\treturn $this->redirect(array('action' => 'dashboard', 'language' => $this->Session->read('Config.language')));\n\t}", "public function create(Request $request)\r\n {\r\n $business_id = request()->session()->get('business.id');\r\n\r\n $settlement_no = $request->settlement_no;\r\n $pump_operator_id = $request->operator_id;\r\n $settlement = Settlement::where('settlement_no', $settlement_no)->where('business_id', $business_id)->first();\r\n $pump_operator = PumpOperator::where('id', $pump_operator_id)->first();\r\n\r\n $business_locations = BusinessLocation::forDropdown($business_id);\r\n $default_location = current(array_keys($business_locations->toArray()));\r\n $payment_types = $this->productUtil->payment_types($default_location);\r\n\r\n $expense_no = $this->getExpenseNumber($settlement->id);\r\n $expense_categories = ExpenseCategory::where('business_id', $business_id)\r\n ->pluck('name', 'id');\r\n $expense_account_type_id = AccountType::where('business_id', $business_id)->where('name', 'Expenses')->first();\r\n $expense_accounts = [];\r\n if ($this->moduleUtil->hasThePermissionInSubscription($business_id, 'access_account')) {\r\n if (!empty($expense_account_type_id)) {\r\n $expense_accounts = Account::where('business_id', $business_id)->where('account_type_id', $expense_account_type_id->id)->pluck('name', 'id');\r\n }\r\n }\r\n $customers = Contact::customersDropdown($business_id, false, true, 'customer');\r\n $products = Product::where('business_id', $business_id)->pluck('name', 'id');\r\n\r\n $card_types = [];\r\n $card_group = AccountGroup::where('business_id', $business_id)->where('name', 'Card')->first();\r\n if (!empty($card_group)) {\r\n $card_types = Account::where('business_id', $business_id)->where('asset_type', $card_group->id)->where(DB::raw(\"REPLACE(`name`, ' ', ' ')\"), '!=', 'Cards (Credit Debit) Account')->pluck('name', 'id');\r\n }\r\n \r\n $customer_payments_tab = CustomerPayment::leftjoin('contacts', 'customer_payments.customer_id', 'contacts.id')\r\n ->where('customer_payments.settlement_no', $settlement->id)\r\n ->select('customer_payments.*', 'contacts.name as customer_name')\r\n ->get();\r\n $settlement_cash_payments = SettlementCashPayment::leftjoin('contacts', 'settlement_cash_payments.customer_id', 'contacts.id')\r\n ->where('settlement_cash_payments.settlement_no', $settlement->id)\r\n ->select('settlement_cash_payments.*', 'contacts.name as customer_name')\r\n ->get();\r\n $settlement_card_payments = SettlementCardPayment::leftjoin('contacts', 'settlement_card_payments.customer_id', 'contacts.id')\r\n ->leftjoin('accounts', 'settlement_card_payments.card_type', 'accounts.id')\r\n ->where('settlement_card_payments.settlement_no', $settlement->id)\r\n ->select('settlement_card_payments.*', 'contacts.name as customer_name', 'accounts.name as card_type')\r\n ->get();\r\n $settlement_cheque_payments = SettlementChequePayment::leftjoin('contacts', 'settlement_cheque_payments.customer_id', 'contacts.id')\r\n ->where('settlement_cheque_payments.settlement_no', $settlement->id)\r\n // ->where('settlement_cheque_payments.business_id', $business_id)\r\n ->select('settlement_cheque_payments.*', 'contacts.name as customer_name')\r\n ->get();\r\n $settlement_credit_sale_payments = SettlementCreditSalePayment::leftjoin('contacts', 'settlement_credit_sale_payments.customer_id', 'contacts.id')\r\n ->leftjoin('products', 'settlement_credit_sale_payments.product_id', 'products.id')\r\n ->where('settlement_credit_sale_payments.settlement_no', $settlement->id)\r\n ->select('settlement_credit_sale_payments.*', 'contacts.name as customer_name', 'products.name as product_name')\r\n ->get();\r\n $settlement_expense_payments = SettlementExpensePayment::leftjoin('accounts', 'settlement_expense_payments.account_id', 'accounts.id')\r\n ->leftjoin('expense_categories', 'settlement_expense_payments.category_id', 'expense_categories.id')\r\n ->where('settlement_expense_payments.settlement_no', $settlement->id)\r\n ->select('settlement_expense_payments.*', 'accounts.name as account_name', 'expense_categories.name as category_name')\r\n ->get();\r\n $settlement_shortage_payments = SettlementShortagePayment::where('settlement_shortage_payments.settlement_no', $settlement->id)\r\n ->select('settlement_shortage_payments.*')\r\n ->get();\r\n $settlement_excess_payments = SettlementExcessPayment::where('settlement_excess_payments.settlement_no', $settlement->id)\r\n ->select('settlement_excess_payments.*')\r\n ->get();\r\n /**\r\n * @ChangedBy Afes\r\n * @Date 25-05-2021\r\n * @Date 02-06-2021\r\n * @Task 12700\r\n * @Task 127004\r\n */ \r\n $total_daily_collection = floatval(DailyCollection::where('pump_operator_id', $pump_operator_id)->where('business_id', $business_id)->whereNull('settlement_id')->sum('current_amount')); \r\n\r\n /**\r\n * @ModifiedBy Afes Oktavianus\r\n * @Date 02-06-2021\r\n * @Date 03-06-2021\r\n * @Task 127004\r\n */\r\n $total_excess = $this->transactionUtil->getPumpOperatorExcessOrShortage($pump_operator_id, 'excess');\r\n \r\n $total_shortage = $this->transactionUtil->getPumpOperatorExcessOrShortage($pump_operator_id, 'shortage');\r\n\r\n $total_commission = $this->calculateCommission($pump_operator->id, $settlement->id);\r\n\r\n $total_meter_sale = MeterSale::where('settlement_no', $settlement->id)->sum('sub_total');\r\n $total_other_sale = OtherSale::where('settlement_no', $settlement->id)->sum('sub_total');\r\n $total_other_income = OtherIncome::where('settlement_no', $settlement->id)->sum('sub_total');\r\n $total_customer_payment = CustomerPayment::where('settlement_no', $settlement->id)->sum('sub_total');\r\n\r\n $total_amount = $total_meter_sale + $total_other_sale + $total_other_income + $total_customer_payment;\r\n\r\n $total_settlement_cash_payment = SettlementCashPayment::where('settlement_no', $settlement->id)->sum('amount');\r\n $total_settlement_card_payment = SettlementCardPayment::where('settlement_no', $settlement->id)->sum('amount');\r\n $total_settlement_cheque_payment = SettlementChequePayment::where('settlement_no', $settlement->id)->sum('amount');\r\n $total_settlement_credit_sale_payment = SettlementCreditSalePayment::where('settlement_no', $settlement->id)->sum('amount');\r\n $total_settlement_expense_payment = SettlementExpensePayment::where('settlement_no', $settlement->id)->sum('amount');\r\n $total_settlement_shortage_payment = SettlementShortagePayment::where('settlement_no', $settlement->id)->sum('amount');\r\n $total_settlement_excess_payment = SettlementExcessPayment::where('settlement_no', $settlement->id)->sum('amount');\r\n $total_paid = $total_daily_collection + $total_settlement_cash_payment + $total_settlement_card_payment + $total_settlement_cheque_payment + $total_settlement_credit_sale_payment + $total_settlement_expense_payment + $total_settlement_shortage_payment + $total_settlement_excess_payment;\r\n\r\n $business_details = Business::find($business_id);\r\n $currency_precision = $business_details->currency_precision;\r\n $total_balance = number_format($total_amount - $total_paid, $currency_precision, '.', '');\r\n\r\n\r\n return view('petro::settlement.partials.add_payment')->with(compact(\r\n 'settlement',\r\n 'pump_operator',\r\n 'customer_payments_tab',\r\n 'settlement_cash_payments',\r\n 'settlement_card_payments',\r\n 'settlement_cheque_payments',\r\n 'settlement_credit_sale_payments',\r\n 'settlement_expense_payments',\r\n 'settlement_shortage_payments',\r\n 'settlement_excess_payments',\r\n 'payment_types',\r\n 'expense_accounts',\r\n 'expense_categories',\r\n 'expense_no',\r\n 'customers',\r\n 'products',\r\n 'card_types',\r\n 'total_daily_collection',\r\n 'total_commission',\r\n 'total_amount',\r\n 'total_paid',\r\n 'total_balance',\r\n 'total_excess',\r\n 'total_shortage'\r\n ));\r\n }", "public function create()\n {\n return view('admin.bill.create');\n }", "function __construct()\n\t{\n\t\t$this->id = 1;\n\t\t$this->name = \"Awais\";\t\n\t\t$this->email = \"Customer : [email protected]\";\t\n\t\t$this->balance = \"$87\";\n\t}", "public function create()\n {\n $data = Merchant::all();\n return view('Barang.barang_create', compact('data'));\n }", "public function create_plan($requestData){\n \n // ### Create Plan\n try {\n // Create a new instance of Plan object\n $plan = new Plan();\n if(isset($requestData['plan'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['plan']), $plan);\n } \n // # Payment definitions for this billing plan.\n $paymentDefinition = new PaymentDefinition(); \n $paymentDefinition\n ->setAmount(new Currency($requestData['paymentDefinition']['Amount']));\n array_pop($requestData['paymentDefinition']);\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $this->setArrayToMethods(array_filter($requestData['paymentDefinition']), $paymentDefinition); \n }\n \n // Charge Models\n $chargeModel = new ChargeModel();\n $chargeModel->setAmount(new Currency($requestData['chargeModel']['Amount']));\n array_pop($requestData['chargeModel']);\n if(!empty($this->checkEmptyObject((array)$chargeModel))){\n $this->setArrayToMethods(array_filter($requestData['chargeModel']), $chargeModel); \n $paymentDefinition->setChargeModels(array($chargeModel));\n }\n \n $merchantPreferences = new MerchantPreferences();\n $baseUrl = $requestData['baseUrl'];\n\n $merchantPreferences->setReturnUrl($baseUrl.$requestData['ReturnUrl'])\n ->setCancelUrl($baseUrl.$requestData['CancelUrl']);\n if(!empty($this->checkEmptyObject($requestData['merchant_preferences']['SetupFee']))){\n $merchantPreferences->setSetupFee(new Currency($requestData['merchant_preferences']['SetupFee']));\n }\n array_pop($requestData['merchant_preferences']);\n \n if(isset($requestData['merchant_preferences'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['merchant_preferences']), $merchantPreferences);\n }\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $plan->setPaymentDefinitions(array($paymentDefinition));\n }\n if(!empty($this->checkEmptyObject((array)$merchantPreferences))){\n $plan->setMerchantPreferences($merchantPreferences);\n } \n $requestArray= clone $plan;\n $output = $plan->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $output->toArray();\n $returnArray['RAWREQUEST']=$requestArray->toJSON();\n $returnArray['RAWRESPONSE']=$output->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public function create() {\n\n\t\t\n\t}", "public function create($planData)\n {\n \t$planPurchase \t\t\t\t = new PlanPurchase();\n\t\t$planPurchase->user_id \t\t = $this->user->id;\n\t\t$planPurchase->plan_id \t\t = $planData->plan_id;\n\t\t$planPurchase->country_code = $planData->country_code;\n\t\t$planPurchase->gold_price = (float)$this->plan->gold_price;\n\t\t$planPurchase->transaction_id = $planData->transaction_id;\n\t\t$planPurchase->save();\n\n \t/** Add Chest Capacity value in user's table **/\n \t(new ChestService)->setUser($this->user)->expand($this->plan->bucket);\n \t\n /** Deduct User Gold **/\n $goldBalance = (new UserRepository($this->user))->deductGold($this->plan->gold_price);\n\n \t/** return the available skeleton keys **/\n \treturn ['chest_bucket'=> $this->user->buckets['chests'], 'available_gold_balance'=> $goldBalance];\n }", "protected function create() {\n\t}", "public static function getObject()\n {\n return new PayerInfo(self::getJson());\n }", "public function __construct($_billShippingChargeToInfo = NULL,$_billShippingChargeToOption = NULL)\n {\n parent::__construct(array('billShippingChargeToInfo'=>$_billShippingChargeToInfo,'billShippingChargeToOption'=>$_billShippingChargeToOption),false);\n }", "public function create()\r\n {\r\n $business_id = request()->session()->get('business.id');\r\n $business_locations = BusinessLocation::forDropdown($business_id);\r\n $default_location = current(array_keys($business_locations->toArray()));\r\n $payment_types = $this->productUtil->payment_types($default_location);\r\n $customers = Contact::customersDropdown($business_id, false);\r\n $pump_operators = PumpOperator::where('business_id', $business_id)->pluck('name', 'id');\r\n\r\n $items = [];\r\n\r\n $ref_no_prefixes = request()->session()->get('business.ref_no_prefixes');\r\n $ref_no_starting_number = request()->session()->get('business.ref_no_starting_number');\r\n $prefix = !empty($ref_no_prefixes['settlement']) ? $ref_no_prefixes['settlement'] : '';\r\n $starting_no = !empty($ref_no_starting_number['settlement']) ? (int) $ref_no_starting_number['settlement'] : 1;\r\n $count = Settlement::where('business_id', $business_id)->count();\r\n $settlement_no = $prefix . ($starting_no + $count);\r\n\r\n $active_settlement = Settlement::where('status', 1)\r\n ->where('business_id', $business_id)\r\n ->select('settlements.*')\r\n ->with(['meter_sales', 'other_sales', 'other_incomes', 'customer_payments'])->first();\r\n\r\n $business_locations = BusinessLocation::forDropdown($business_id);\r\n $default_location = current(array_keys($business_locations->toArray()));\r\n if (!empty($active_settlement)) {\r\n $already_pumps = MeterSale::where('settlement_no', $active_settlement->id)->pluck('pump_id')->toArray();\r\n $pump_nos = Pump::where('business_id', $business_id)->whereNotIn('id', $already_pumps)->pluck('pump_name', 'id');\r\n } else {\r\n $pump_nos = Pump::where('business_id', $business_id)->pluck('pump_name', 'id');\r\n }\r\n \r\n //other_sale tab\r\n $stores = Store::where('business_id', $business_id)->pluck('name', 'id');\r\n $fuel_category_id = Category::where('business_id', $business_id)->where('name', 'Fuel')->first();\r\n $fuel_category_id = !empty($fuel_category_id) ? $fuel_category_id->id : null;\r\n $items = $this->transactionUtil->getProductDropDownArray($business_id);\r\n \r\n // other income tab\r\n $services = Product::where('business_id', $business_id)->where('enable_stock', 0)->pluck('name', 'id');\r\n\r\n\r\n $payment_meter_sale_total = !empty($active_settlement->meter_sales) ? $active_settlement->meter_sales->sum('sub_total') : 0.00;\r\n $payment_other_sale_total = !empty($active_settlement->other_sales) ? $active_settlement->other_sales->sum('sub_total') : 0.00;\r\n $payment_other_income_total = !empty($active_settlement->other_incomes) ? $active_settlement->other_incomes->sum('sub_total') : 0.00;\r\n $payment_customer_payment_total = !empty($active_settlement->customer_payments) ? $active_settlement->customer_payments->sum('sub_total') : 0.00;\r\n\r\n $wrok_shifts = WorkShift::where('business_id', $business_id)->pluck('shift_name', 'id');\r\n $bulk_tanks = FuelTank::where('business_id', $business_id)->where('bulk_tank', 1)->pluck('fuel_tank_number', 'id');\r\n\r\n\r\n $select_pump_operator_in_settlement = $this->moduleUtil->hasThePermissionInSubscription($business_id, 'select_pump_operator_in_settlement');\r\n\r\n $message = $this->transactionUtil->getGeneralMessage('general_message_pump_management_checkbox');\r\n \r\n return view('petro::settlement.create')->with(compact(\r\n 'select_pump_operator_in_settlement',\r\n 'message',\r\n 'business_locations',\r\n 'payment_types',\r\n 'customers',\r\n 'pump_operators',\r\n 'wrok_shifts',\r\n 'pump_nos',\r\n 'items',\r\n 'settlement_no',\r\n 'default_location',\r\n 'active_settlement',\r\n 'stores',\r\n 'payment_meter_sale_total',\r\n 'payment_other_sale_total',\r\n 'payment_other_income_total',\r\n 'payment_customer_payment_total',\r\n 'bulk_tanks',\r\n 'services'\r\n ));\r\n }", "public function Create() {\n parent::Create();\n\n\t\t\t$this->RegisterPropertyString(\"Password\", \"\");\n\n\t\t\t$this->RegisterPropertyString(\n\t\t\t\t'RadioStations', '[{\"position\":1,\"station\":\"NDR2 Niedersachsen\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/800c150e9a6b16078a4a3b3b5aee0672\"},\n\t\t\t\t{\"position\":2,\"station\":\"MDR Jump\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/0888328132708be0905731457bba8ae0\"},\n\t\t\t\t{\"position\":3,\"station\":\"Inselradio Mallorca\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/14f799071150331b9a7994ca8c61f8c7\"}]'\n );\n\n $this->RegisterPropertyBoolean(\"HideVolume\",false);\n $this->RegisterPropertyBoolean(\"HideTitle\",false);\n $this->RegisterPropertyBoolean(\"HideTimeElapsed\",false);\n\n\t\t\t$this->RegisterTimer(\"KeepAliveTimer\", 1000, 'MPDP_KeepAlive($_IPS[\\'TARGET\\']);');\n\t\t}", "public function purchaseBill()\n {\n return new PurchaseBill($this);\n }", "public static function Create() {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$record = new Dbi_Record($model, array());\r\n\t\treturn $record;\r\n\t}", "public function create()\n {\n return view('backend.shipping.create');\n }", "public function create() {\r\n //\r\n }", "public function store(CreateBillingRequest $request)\n\t{\n $input = $request->all();\n\n\t\t$billing = $this->billingRepository->store($input);\n\n\t\tFlash::message('Billing saved successfully.');\n\n\t\treturn redirect(route('billings.index'));\n\t}", "public function create()\n\t{\n\t\t\n\t\t//\n\t}", "public function create()\r\n {\r\n }", "public function create()\r\n {\r\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }" ]
[ "0.6470694", "0.6039081", "0.6039081", "0.5971785", "0.59071326", "0.5743507", "0.573313", "0.5625403", "0.5610547", "0.56057733", "0.5597813", "0.55963236", "0.5592163", "0.55727917", "0.55717385", "0.5567481", "0.5543487", "0.5542238", "0.5534692", "0.5531217", "0.55172026", "0.5515473", "0.5503814", "0.5496566", "0.54738146", "0.5463187", "0.5463187", "0.5452284", "0.54513425", "0.54439574", "0.5410545", "0.5406789", "0.53966117", "0.53948313", "0.5388198", "0.5378272", "0.5373384", "0.537118", "0.5367126", "0.535555", "0.53518575", "0.53518575", "0.5334372", "0.53283095", "0.53283095", "0.5323761", "0.5310387", "0.53073955", "0.53073955", "0.5306032", "0.5294278", "0.5294278", "0.5294278", "0.5294278", "0.5294278", "0.5294278", "0.5294278", "0.5294278", "0.5294278", "0.5294278", "0.5294278", "0.5286803", "0.5286803", "0.5286803", "0.5286803", "0.5286803", "0.5286803", "0.5286803", "0.5286803", "0.5286803", "0.5286803", "0.5286803", "0.5286803", "0.5281248", "0.5279765", "0.5272227", "0.52709675", "0.5268955", "0.52689093", "0.5260805", "0.5258181", "0.5257017", "0.5255183", "0.5252509", "0.5250911", "0.5250413", "0.5247278", "0.52428794", "0.52380717", "0.5236979", "0.5236348", "0.5233533", "0.52330047", "0.5226387", "0.52219963", "0.5221344", "0.5221344", "0.5217727", "0.5217727", "0.5217727" ]
0.62406504
1
Create new Subscriber instance.
public function subscribers() { return new Subscriber($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createSubscriber();", "protected function subscriber()\n {\n return Subscriber::connection(1, [\n 'id' => 1,\n 'payload' => [\n 'query' => 'subscription { onPostCreated { id } }',\n 'variables' => [],\n 'operationName' => ''\n ]\n ]);\n }", "public function create()\n {\n $subscription = new Subscription();\n\n return $subscription;\n }", "public function __construct()\n {\n $this->subscription = new Subscription();\n }", "public function __construct()\n {\n $this->subscribe = new Subscribe();\n }", "public function subscribe()\n {\n $payload = request()->validate([\n 'topics' => 'required|array',\n 'callback' => 'required|url',\n ]);\n\n $topics = array_map(function ($topic) {\n return $this->topics->findOrCreate($topic);\n }, $payload['topics']);\n\n abort_unless(! empty($topics), 404);\n\n $subscriber = $this->subscribers->create($topics, $payload);\n\n }", "public function __construct()\n\t{\n\t\t$this->type('subscriber');\n\t}", "function createObject() {\n\t\treturn new InstitutionalSubscription();\n\t}", "public function subscribe($subscriber);", "public function subscription();", "public function subscribe();", "public function subscribe(SubscriberInterface $subscriber);", "private function initSubscriber()\n\t{\n\t\tif ( !isset( $this->m_cSubscriber ) || !$this->m_cSubscriber )\n\t\t{\n\t\t\tif ( $this->m_bHasEventLoop )\n\t\t\t{\n\t\t\t\t$this->m_cSubscriber = $this->m_cContext->getSocket( \\ZMQ::SOCKET_SUB );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->m_cSubscriber = new \\ZMQSocket( $this->m_cContext, \\ZMQ::SOCKET_SUB );\n\t\t\t}\n\n\t\t\t$this->m_cSubscriber->connect( \"tcp://\". Config::getWampZmqIP() .\":\". Config::getWampZmqPort() );\n\t\t}\n\t}", "protected function subscriber(string $queryString): Subscriber\n {\n $subscriber = $this->createMock(Subscriber::class);\n $subscriber->channel = Subscriber::uniqueChannelName();\n $subscriber->query = Parser::parse($queryString);\n\n return $subscriber;\n }", "public function subscribe($subscriber): void;", "public function handle(SubscribeSubscriberCommand $command)\n {\n $subscriber = Subscriber::create(['email' => $command->email]);\n\n if ($command->verified) {\n $this->dispatch(new VerifySubscriberCommand($subscriber));\n } else {\n event(new SubscriberHasSubscribedEvent($subscriber));\n }\n\n return $subscriber;\n }", "public function createSubscriber()\n {\n return view('add-subscriber');\n }", "public function __construct(SubscriberInterface $subscriber)\n {\n $this->subscriberRepository = $subscriber;\n }", "public function subscribe(): void;", "public static function new($params) {\n $subscriber=Subscriber::create($params);\n // 2. Include de la lview\n include(__DIR__ . '/../views/subscribers/create.php');\n }", "public function subscribe($subscriber)\n {\n if (is_string($subscriber)) {\n $Class = '\\\\'.$subscriber;\n $subscriber = new $Class($this->c);\n }\n $subscriber->subscribe($this);\n }", "private function subscriptionFactory($name, array $info = [])\n {\n return new Subscription(\n $this->connection,\n $this->projectId,\n $name,\n $this->name,\n $this->encode,\n $info\n );\n }", "public function create(CreateSubscriberRequest $request)\n {\n // create a new object, fill with data and save\n $data = $request->toArray();\n $subscriber = new Subscriber($data);\n $subscriber->save();\n\n // save to cache\n $cacheKey = \"subscriber-{$subscriber->id}\";\n RedisCache::instance()->set($cacheKey, serialize($subscriber));\n\n return new Response(201, 'Subscriber created', $subscriber);\n }", "public function subscribes();", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "public function create()\n {\n return view ('subscriber::subscriber_create');\n }", "public function subscriptions() {\n return new Subscription($this);\n }", "public function __construct($subscription)\n {\n $this->subscription = $subscription;\n }", "public function create()\n {\n $title = 'Create Subscriber';\n $topics = Auth::user()->topics;\n return view('subscriber.create', compact('title','topics'));\n }", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "public function subscription(): EventSubscription;", "public function collectSubscribers();", "public function create()\n {\n \n return view('backend.subscriber.create');\n \n }", "public function createSubscription($request);", "public function store(CreateSubscriberRequest $request)\n\t{\n\t\t$input = $request->all();\n\t\t$input['email'] = strtolower($input['email']);\n\n\t\t// Check whether subscriber exists\n\t\tif (Subscriber::where('email', $input['email'])->count() > 0) {\n\t\t\t// Fetch the subscriber from the database\n\t\t\t$subscriber = Subscriber::where('email', $input['email'])->firstOrFail();\n\n\t\t\t// If the subscriber isn't verified, resend verification email with new nonce\n\t\t\tif (!$subscriber->verified) {\n\t\t\t\t$subscriber->nonce = str_random(32);\n\t\t\t\t$subscriber->save();\n\n\t\t\t\t$this->sendVerificationEmail($subscriber);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If they are already subscribe, send an 'already-verified' email\n\t\t\t\t$this->sendAlreadyVerifiedEmail($subscriber);\n\t\t\t}\n\t\t} else {\n\t\t\t// Create a Subscriber\n\t\t\t$subscriber = new Subscriber($input);\n\t\t\t$subscriber->nonce = str_random(32);\n\t\t\t$subscriber->verified = False;\n\t\t\t$subscriber->save();\n\n\t\t\t// Send a verification email\n\t\t\t$this->sendVerificationEmail($subscriber);\n\t\t}\n\n\t\treturn view('subscribers/sent');\n\t}", "public function subscription($name)\n {\n return $this->subscriptionFactory($name);\n }", "public static function init(): self\n {\n return new self(new CancelSubscriptionResponse());\n }", "public function create(array $attributes = [])\n {\n $trialEndsAt = null;\n\n if (!$this->skipTrial) {\n if (!is_null($this->trialPeriod) && $this->trialPeriod > 0) {\n $trial = new Period($this->trialInterval, $this->trialPeriod, now());\n $trialEndsAt = $trial->getEndAt();\n } elseif ($this->plan->hasTrial()) {\n $trial = new Period($this->plan->trial_interval, $this->plan->trial_period, now());\n $trialEndsAt = $trial->getEndAt();\n }\n }\n\n $period = new Period($this->plan->invoice_interval, $this->plan->invoice_period, $trialEndsAt);\n\n return $this->subscriber->subscriptions()->create(array_merge([\n 'name' => $this->name,\n 'plan_id' => $this->plan->getKey(),\n 'trial_ends_at' => $trialEndsAt,\n 'starts_at' => $period->getStartAt(),\n 'ends_at' => $period->getEndAt(),\n ], $attributes));\n }", "public function created(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'started');\n }", "public function subscribes()\r\n\r\n {\r\n\r\n return new Engine_ProxyObject($this, Engine_Api::_()->getDbtable('subscribes', 'core'));\r\n\r\n }", "public function createSubscription($channels, Closure $callback, $method = 'subscribe')\n {\n //\n }", "protected function _create_subscription ( array $values ){\n\n return new Payment_Subscription( $values );\n\n }", "public function createForSuper()\n {\n $newsletter = new Newsletter();\n\n $newsletter->setRecipientType(Newsletter::RECIPIENT_TYPE_ALL);\n $newsletter->setWithoutBranch(true);\n\n // Select all branches\n $newsletter->setBranches(\n $this->entityManager->getRepository('IsicsOpenMiamMiamBundle:Branch')->findAll()\n );\n\n return $newsletter;\n }", "public function __construct(SubscriptionRepository $subscriptions)\n {\n $this->subscriptions = $subscriptions;\n }", "public function __construct(Subscriber $subscriber)\n {\n $this->subscriber = $subscriber;\n $this->url = Url::signedRoute('change-status-mail', ['subscriber' => $subscriber->id, 'status' => 'INACTIVE']);\n }", "public function create()\n {\n return view('table.subscribers.create');\n }", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "public function __construct(SubscriptionRepository $subscription)\n {\n $this->subscription = $subscription;\n }", "public static function factory(): Speak\n {\n return new static();\n }", "public function __construct($subscriptionsID)\n {\n $this->id = $subscriptionsID;\n }", "public function create()\n {\n $subscriptions = Subscription::all();\n\n return view('subscription.subscribe', compact('subscriptions'));\n }", "public static function create_subscribe($user_id, $forum_id)\n {\n $forum_subscribe = new ForumSubscribe();\n $forum_subscribe->set_forum_id($forum_id);\n $forum_subscribe->set_user_id($user_id);\n return $forum_subscribe->create();\n }", "public function __construct(ISubscriberListService $ISubscriberListService) {\n // $this->middleware ( 'guest' ) -> except ( 'logout' );\n $this->subscriberListService = $ISubscriberListService;\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create()\n\t{\n\t\treturn view('subscribers/create');\n\t}", "public function create(CreateSubscriberDTO $details)\r\n {\r\n $details = json_decode(json_encode($details), true);\r\n $res = $this->subscriberModel->create($details);\r\n\r\n return $res;\r\n }", "protected function createPubSub(array $options = null, $callable = null)\n {\n $pubsub = new PubSubConsumer($this, $options);\n\n if (!isset($callable)) {\n return $pubsub;\n }\n\n foreach ($pubsub as $message) {\n if (call_user_func($callable, $pubsub, $message) === false) {\n $pubsub->stop();\n }\n }\n }", "function pressforward_ab_subscriber() {\n\trequire( dirname( __FILE__ ) . '/includes/pressforward-ab-subscribe.php' );\n\treturn PF_AB_Subscriber::init();\n}", "public function addSubscriber(array $data)\n {\n return $this->ozioma->newsletter->addSubscriber($data);\n }", "private function subscribe()\n {\n $this->botman->hears('subscribe', function (BotMan $bot) {\n $userId = $bot->getUser()->getId();\n $user = Subscriber::where('telegram_user_id', $userId)->first();\n $userMsg = 'You are already subscribed';\n\n if(is_null($user))\n {\n Subscriber::create(['telegram_user_id' => $userId]);\n $userMsg = 'You have just subscribed to our updates!';\n }\n\n $bot->reply($userMsg);\n });\n }", "public function create()\n {\n return view(\"admin.subscriptions.create\");\n }", "public function __construct()\n {\n $this->eventPublisher = new InMemoryEventPublisher();\n EventPublisher::registerPublisher($this->eventPublisher);\n $this->prospectId = ProspectId::fromExisting('test-prospect-id');\n }", "public function __construct()\n\t{\n $subscriber = new SystemListern();\n Event::subscribe($subscriber);\n\t\t//$this->middleware('auth');\n\t}", "public function eventSubscription(string $name)\n\t{\n\t\treturn new EventSubscription($this, $name);\n }", "public function init()\n {\n $notified = [];\n /** @var ListenerInterface $subscriber */\n foreach ($this->subscribers as $message => $subscribers) {\n foreach ($subscribers as $subscriber) {\n if (in_array($subscriber, $notified)) {\n continue;\n }\n $subscriber->init();\n $notified[] = $subscriber;\n }\n }\n }", "public function newSubscription(array $data = [], string $name = 'default')\n {\n $trialEndsAt = null;\n if ($data['status'] === Paddle::STATUS_TRIALING) {\n $time = Carbon::parse($data['event_time'])->format('H:i:s');\n $trialEndsAt = Carbon::parse(\"{$data['next_bill_date']} {$time}\");\n }\n\n return $this->subscriptions()->create([\n 'user_id' => $this->id,\n 'name' => $name,\n 'paddle_id' => $data['subscription_id'],\n 'paddle_plan_id' => $data['subscription_plan_id'],\n 'paddle_cancel_url' => $data['cancel_url'],\n 'paddle_update_url' => $data['update_url'],\n 'paddle_status' => $data['status'],\n 'quantity' => $data['quantity'],\n 'trial_ends_at' => $trialEndsAt,\n 'ends_at' => null\n ]);\n }", "public function __construct( $subscription ) {\n\n\t\tparent::__construct( $subscription );\n\n\t\t$this->order_type = 'shop_subscription';\n\n\t\t$this->schedule = new stdClass();\n\t}", "public function fakeSubscription($subscriptionFields = [])\n {\n return new Subscription($this->fakeSubscriptionData($subscriptionFields));\n }", "public function __construct(Post $post, Subscriber $subscriber)\n {\n $this->post = $post;\n $this->subscriber = $subscriber;\n }", "public function Subscribe() {\n\t\t// Process pending messages if any\n\t\t$this->ProcessPendingMessages();\n\t\t// Subscribe\n\t\t$this->GetSubsConn()->subscribe(\n\t\t\t[$this->GetChannel()],\n\t\t\t[$this, 'SubscribeCallback']\n\t\t);\n\t}", "public function pubSubLoop(/* arguments */)\n {\n return $this->sharedContextFactory('createPubSub', func_get_args());\n }", "public function addSubscriber(EventSubscriberInterface $subscriber);", "protected function getVictoireI18n_LocaleSubscriberService()\n {\n return $this->services['victoire_i18n.locale_subscriber'] = new \\Victoire\\Bundle\\I18nBundle\\Subscriber\\LocaleSubscriber('en', $this->get('victoire_i18n.locale_resolver'));\n }", "public function setSubscriber($subscriber)\n {\n $this->subscriber = $subscriber;\n\n return $this;\n }", "public function __construct(SubscribeInterface $subscribes,SegmentInterface $segments)\n {\n $this->subscribes=$subscribes;\n $this->segments=$segments;\n $this->middleware(function ($request, $next) {\n \\Session::put('top_menu',\"subscribe\");\n \\Session::put('sub_menu',\"subscribe\");\n return $next($request);\n });\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME, $subject,\n 'Subject is not a valid instance'\n );\n }", "function create_subscription($subscription) {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Try to save the subscription\n if ( $CI->base_model->insert('subscriptions', $subscription) ) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n \n }", "public function actionCreate()\n {\n $model = new UserSubscriber();\n\n $success = false;\n $msg = 'There was an error, please try again later.';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $success = true;\n $msg = 'Thank you for subscription for newsletter.';\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['success' => $success, 'msg' => $msg];\n\n }", "public function getSubscriber()\n {\n return $this->subscriber;\n }", "protected function getVictoireBlog_Article_SubscriberService()\n {\n return $this->services['victoire_blog.article.subscriber'] = new \\Victoire\\Bundle\\BlogBundle\\Listener\\ArticleSubscriber($this->get('victoire_page.user_callable'), 'Victoire\\\\Bundle\\\\UserBundle\\\\Entity\\\\User');\n }", "public function getEventSubscriber();", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }", "public function subscribe(string $topic, string $subscriber)\n {\n return Topic::updateOrCreate([ 'name' => $topic ])->addSubscriber(\n Subscriber::updateOrCreate([ 'name' => $subscriber ])\n );\n }", "public function create($data = array())\n {\n $matches = array();\n preg_match('/([^@]+)$/', $data['email'], $matches);\n $data['domain'] = $matches[1];\n $table = $this->getTable(); \n $this->_subscriberId = $table->insert($data); \n return $this->_subscriberId;\n }", "public function create()\n {\n //\n return view('backend.subscriptions.create');\n }", "public function create(Request $request)\n {\n $id = $request->id;\n\n return view('subscriber.create',compact('id'));\n }", "public function create(): void\n {\n $this->register();\n }", "public function subscribe()\n {\n $url = 'https://api.instagram.com/v1/subscriptions/';\n $params = [\n 'client_id' => $this->getClientId(),\n 'client_secret' => $this->getClientSecret(),\n 'object' => 'user',\n 'aspect' => 'media',\n 'verify_token' => '592180',\n 'callback_url' => $this->_url->sessionUrlVar(\n $this->_url->getUrl($this->subscribe_redirect)\n )\n ];\n $this->_httpRequest($url, 'POST', $params);\n }", "public function __construct($user, $subscription)\n {\n //\n $this->subscription = $subscription;\n $this->user = $user;\n }", "public function show(Subscriber $subscriber)\n {\n// dd($subscriber);\n }", "protected function createInstance(Provider $provider): ProtectedFlushSubscriber\n {\n return new ProtectedFlushSubscriber($provider);\n }", "public function __construct($subscriptionId = null)\n {\n $this->subscriptionId = $subscriptionId;\n }", "public function createReceiver() {\n return ModelFactory::getReceiver();\n }", "static function create(): self;", "private function _setInfo(): PubSubService\n {\n $this->_info = [\n 'info' => [\n 'code' => Response::HTTP_CREATED,\n 'message' => [\n 'topicName' => $this->getTopicFullName(),\n 'subscriptionName' => $this->getSubscriptionFullName(),\n 'projectId' => $this->_projectId,\n ],\n 'status' => 'HTTP_CREATED',\n ],\n ];\n\n return $this;\n }", "public function __construct(Newsletter $newsletter)\n {\n $this->newsletter = $newsletter;\n }", "public static function instance() {\n\t\treturn tribe( 'events-aggregator.service' );\n\t}", "public function createInstance($processor);" ]
[ "0.82489216", "0.72450936", "0.67727983", "0.661997", "0.65834314", "0.654749", "0.6532735", "0.63951296", "0.63371754", "0.6264962", "0.62305635", "0.622792", "0.6138845", "0.6096697", "0.6072859", "0.6032218", "0.6029099", "0.6006208", "0.5975712", "0.59531957", "0.590516", "0.5902223", "0.59013575", "0.5880044", "0.5847951", "0.58230627", "0.57957876", "0.579013", "0.56854016", "0.5672333", "0.56454206", "0.56398565", "0.5634584", "0.5615842", "0.5607911", "0.560527", "0.55682766", "0.55580604", "0.5476893", "0.5443642", "0.54256064", "0.5424158", "0.53871316", "0.5331084", "0.5316447", "0.53094685", "0.5306395", "0.5297188", "0.529506", "0.52880913", "0.52746546", "0.5271632", "0.52583784", "0.5256958", "0.5256958", "0.5256958", "0.5248548", "0.5239914", "0.52082956", "0.5174128", "0.5169431", "0.5158146", "0.51575357", "0.5133621", "0.5130607", "0.51085675", "0.510614", "0.50956", "0.50841206", "0.5083778", "0.5079755", "0.50774825", "0.50713235", "0.5066205", "0.5057065", "0.5056356", "0.50496346", "0.5031279", "0.50261855", "0.5023316", "0.50190645", "0.5013215", "0.5013166", "0.50090396", "0.50054735", "0.50031245", "0.50000477", "0.4996196", "0.49957976", "0.49951237", "0.4992436", "0.49854037", "0.49734107", "0.49709168", "0.49643674", "0.4960279", "0.49490586", "0.49415755", "0.49411073", "0.493634" ]
0.6386006
8
Create a new Subscription instance.
public function subscriptions() { return new Subscription($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n $subscription = new Subscription();\n\n return $subscription;\n }", "function createObject() {\n\t\treturn new InstitutionalSubscription();\n\t}", "public function __construct()\n {\n $this->subscription = new Subscription();\n }", "public function createSubscription($request);", "protected function _create_subscription ( array $values ){\n\n return new Payment_Subscription( $values );\n\n }", "private function subscriptionFactory($name, array $info = [])\n {\n return new Subscription(\n $this->connection,\n $this->projectId,\n $name,\n $this->name,\n $this->encode,\n $info\n );\n }", "public function create(array $attributes = [])\n {\n $trialEndsAt = null;\n\n if (!$this->skipTrial) {\n if (!is_null($this->trialPeriod) && $this->trialPeriod > 0) {\n $trial = new Period($this->trialInterval, $this->trialPeriod, now());\n $trialEndsAt = $trial->getEndAt();\n } elseif ($this->plan->hasTrial()) {\n $trial = new Period($this->plan->trial_interval, $this->plan->trial_period, now());\n $trialEndsAt = $trial->getEndAt();\n }\n }\n\n $period = new Period($this->plan->invoice_interval, $this->plan->invoice_period, $trialEndsAt);\n\n return $this->subscriber->subscriptions()->create(array_merge([\n 'name' => $this->name,\n 'plan_id' => $this->plan->getKey(),\n 'trial_ends_at' => $trialEndsAt,\n 'starts_at' => $period->getStartAt(),\n 'ends_at' => $period->getEndAt(),\n ], $attributes));\n }", "public function createSubscriber();", "public function subscription($name)\n {\n return $this->subscriptionFactory($name);\n }", "public function __construct($subscription)\n {\n $this->subscription = $subscription;\n }", "protected function subscriber()\n {\n return Subscriber::connection(1, [\n 'id' => 1,\n 'payload' => [\n 'query' => 'subscription { onPostCreated { id } }',\n 'variables' => [],\n 'operationName' => ''\n ]\n ]);\n }", "public function fakeSubscription($subscriptionFields = [])\n {\n return new Subscription($this->fakeSubscriptionData($subscriptionFields));\n }", "public function makeSubscription($subscriptionFields = [])\n {\n /** @var SubscriptionRepository $subscriptionRepo */\n $subscriptionRepo = App::make(SubscriptionRepository::class);\n $theme = $this->fakeSubscriptionData($subscriptionFields);\n return $subscriptionRepo->create($theme);\n }", "public function createSubscription(CustomerInterface $customer, PaymentMethodInterface $payment_method, $product_name, string $period, ...$arguments): SubscriptionInterface;", "public function create()\n {\n $subscriptions = Subscription::all();\n\n return view('subscription.subscribe', compact('subscriptions'));\n }", "public function __construct(SubscriptionRepository $subscription)\n {\n $this->subscription = $subscription;\n }", "public function create()\n {\n return view(\"admin.subscriptions.create\");\n }", "function create_subscription($subscription) {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Try to save the subscription\n if ( $CI->base_model->insert('subscriptions', $subscription) ) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n \n }", "public function subscribe()\n {\n $payload = request()->validate([\n 'topics' => 'required|array',\n 'callback' => 'required|url',\n ]);\n\n $topics = array_map(function ($topic) {\n return $this->topics->findOrCreate($topic);\n }, $payload['topics']);\n\n abort_unless(! empty($topics), 404);\n\n $subscriber = $this->subscribers->create($topics, $payload);\n\n }", "public static function init(): self\n {\n return new self(new CancelSubscriptionResponse());\n }", "public function __construct( $subscription ) {\n\n\t\tparent::__construct( $subscription );\n\n\t\t$this->order_type = 'shop_subscription';\n\n\t\t$this->schedule = new stdClass();\n\t}", "public function subscription();", "public function __construct(PlanSubscription $subscription)\n {\n $this->subscription = $subscription;\n }", "public function __construct()\n {\n $this->subscribe = new Subscribe();\n }", "public function newSubscription(array $data = [], string $name = 'default')\n {\n $trialEndsAt = null;\n if ($data['status'] === Paddle::STATUS_TRIALING) {\n $time = Carbon::parse($data['event_time'])->format('H:i:s');\n $trialEndsAt = Carbon::parse(\"{$data['next_bill_date']} {$time}\");\n }\n\n return $this->subscriptions()->create([\n 'user_id' => $this->id,\n 'name' => $name,\n 'paddle_id' => $data['subscription_id'],\n 'paddle_plan_id' => $data['subscription_plan_id'],\n 'paddle_cancel_url' => $data['cancel_url'],\n 'paddle_update_url' => $data['update_url'],\n 'paddle_status' => $data['status'],\n 'quantity' => $data['quantity'],\n 'trial_ends_at' => $trialEndsAt,\n 'ends_at' => null\n ]);\n }", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "protected function createBasicSubscriptionAndOrder() {\n $subscription = Subscription::create([\n 'type' => 'product_variation',\n 'store_id' => $this->store->id(),\n 'billing_schedule' => $this->billingSchedule,\n 'uid' => $this->user,\n 'payment_method' => $this->paymentMethod,\n 'purchased_entity' => $this->variation,\n 'title' => $this->variation->getOrderItemTitle(),\n 'unit_price' => new Price('2', 'USD'),\n 'state' => 'pending',\n 'starts' => \\Drupal::time()->getRequestTime() - 5,\n 'ends' => \\Drupal::time()->getRequestTime() + 1000,\n ]);\n $subscription->save();\n\n $order_storage = \\Drupal::entityTypeManager()->getStorage('commerce_order');\n $result = $order_storage->getQuery()\n ->condition('type', 'recurring')\n ->pager(1)\n ->execute();\n $this->assertEmpty($result);\n\n $subscription->getState()->applyTransition($subscription->getState()->getTransitions()['activate']);\n $subscription->save();\n\n $orders = $order_storage->loadMultiple($order_storage->getQuery()\n ->condition('type', 'recurring')\n ->execute());\n $this->assertCount(1, $orders);\n $order = reset($orders);\n\n return [$subscription, $order];\n }", "abstract public function add_subscription( Payment_Subscription $subscription );", "function createNewSubscription(array $data){\nreturn $this->post($data, \"/subscription\");\n}", "public function created(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'started');\n }", "public function __construct(SubscriptionRepository $subscriptions)\n {\n $this->subscriptions = $subscriptions;\n }", "public function create()\n {\n //\n return view('backend.subscriptions.create');\n }", "public function subscription(): EventSubscription;", "public function get(string $id): Subscription\n {\n $response = $this->performApiCall(\n 'GET',\n \"subscriptions/{$id}\"\n );\n\n return new Subscription(collect($response));\n }", "public function newSubscription($subscription, Plan $plan, $dont_start = false): PlanSubscription\n {\n $trial = new Period($plan->trial_interval, $plan->trial_period, now());\n $period = new Period($plan->invoice_interval, $plan->invoice_period, $trial->getEndDate());\n\n return $this->subscriptions()->create([\n 'name' => $subscription,\n 'slug' => $subscription,\n 'plan_id' => $plan->getKey(),\n 'trial_ends_at' => $trial->getEndDate(),\n 'starts_at' => $dont_start ? null : $period->getStartDate(),\n 'ends_at' => $dont_start ? null : $period->getEndDate(),\n ]);\n }", "public function createRequest($create_subscription_request)\n {\n // verify the required parameter 'create_subscription_request' is set\n if ($create_subscription_request === null || (is_array($create_subscription_request) && count($create_subscription_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $create_subscription_request when calling create'\n );\n }\n\n $resourcePath = '/subscriptions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($create_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($create_subscription_request));\n } else {\n $httpBody = $create_subscription_request;\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\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 function create()\n {\n return view('subscription::create');\n }", "public function getSubscriptionByReference(string $subscription_reference): SubscriptionInterface;", "public function create()\n {\n return view('subscriptions.create');\n }", "public function create(CreateSubscriberRequest $request)\n {\n // create a new object, fill with data and save\n $data = $request->toArray();\n $subscriber = new Subscriber($data);\n $subscriber->save();\n\n // save to cache\n $cacheKey = \"subscriber-{$subscriber->id}\";\n RedisCache::instance()->set($cacheKey, serialize($subscriber));\n\n return new Response(201, 'Subscriber created', $subscriber);\n }", "public function subscription(): SubscriptionReceiptInterface;", "public function addSubscription()\n {\n $custId = $this->request->id;\n $customerObj = $this->_customer->find($custId);\n if (! is_object($customerObj)) {\n return false;\n }\n $fromDate = $this->request->start_date;\n $planId = $this->request->subscription_plan;\n $orderId = $this->request->orderid;\n $getPlan = SubscriptionPlan::where('id', $planId)->first();\n $duration = $getPlan->duration;\n $planName = $getPlan->name;\n $date = Carbon::createFromFormat('d-m-Y', $fromDate);\n $fromDate = Carbon::createFromFormat('d-m-Y', $fromDate)->format('Y-m-d');\n $endDate = $date->addDays($duration);\n $customerObj->expires_at = $endDate;\n $customerObj->save();\n $subscriber = new Subscribers();\n $subscriber->subscription_plan_id = $planId;\n $subscriber->customer_id = $custId;\n $subscriber->start_date = $fromDate;\n $subscriber->end_date = $endDate;\n $subscriber->is_active = 1;\n $subscriber->save();\n $paymentTrans = new PaymentTransactions();\n $paymentTrans->payment_method_id = 2;\n $paymentTrans->customer_id = $custId;\n $paymentTrans->status = \"Success\";\n $paymentTrans->transaction_message = \"Success\";\n $paymentTrans->transaction_id = $orderId;\n $paymentTrans->response = \"Success\";\n $paymentTrans->plan_name = $planName;\n $paymentTrans->subscriber_id = $custId;\n $paymentTrans->subscription_plan_id = $planId;\n $paymentTrans->save();\n return true;\n }", "public function subscribe(SubscriptionRequestEntity $requestEntity);", "protected function createSubscriptionPayment(array $data, Currency $currency): SubscriptionPayment\n {\n $this->configureStripeClient();\n return new SubscriptionPayment([\n 'paymentAmount' => $data['amount_due'] / (10 ** $currency->minorUnit),\n 'paymentCurrency' => $currency,\n 'paymentDate' => $data['created'],\n 'paymentReference' => $data['charge'],\n 'paid' => $data['paid'],\n 'response' => Json::encode($data),\n ]);\n }", "public static function init(string $name): self\n {\n return new self(new CatalogSubscriptionPlan($name));\n }", "public function asStripeSubscription() : StripeSubscription\n {\n $entity = $this->getSubscriberEntity();\n\n return $entity->getStripeCustomerInfo()->subscriptions->retrieve($this->stripe_id);\n }", "public function eventSubscription(string $name)\n\t{\n\t\treturn new EventSubscription($this, $name);\n }", "public static function createFromDiscriminatorValue(ParseNode $parseNode): CloudPcSubscription {\n return new CloudPcSubscription();\n }", "public function createSubscription($plan=null,$customer=null,$trial_period=null)\n {\n $subscription = \\Stripe\\Subscription::create([\n 'customer' => $customer,\n 'items' => [\n [\n 'plan' => $plan,\n ],\n ],\n 'expand' => ['latest_invoice.payment_intent'],\n 'trial_end' => ($trial_period > 0)? Carbon::now()->addDays($trial_period)->timestamp:null,\n ]);\n // Update stripe customer id in users table\n $user = Auth::user();\n $user->stripe_subscriptionId = $subscription->id;\n $user->save();\n\n return $subscription;\n }", "public function subscription()\n {\n return $this->hasOne('App\\Subscription');\n }", "public function __construct($subscriptionsID)\n {\n $this->id = $subscriptionsID;\n }", "public function created(PlanSubscription $planSubscription)\n {\n //\n }", "public function __construct($subscriptionId = null)\n {\n $this->subscriptionId = $subscriptionId;\n }", "public function subscription($id) {\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_Subscription::find_with_client($this, $id);\n\n }", "public static function fromSubscription(Subscription $subscription, ProviderInterface $provider = NULL) {\n $item = static::byData([\n 'list_id' => $subscription->list_id,\n 'email' => $subscription->email,\n ], [\n 'action' => static::SUBSCRIBE ? 'subscribe' : 'update',\n ]);\n if ($provider) {\n list($data, $fingerprint) = $provider->data($subscription, $item->data);\n $item->fingerprint = $fingerprint;\n $item->data = $data;\n }\n if ($subscription->delete) {\n $item->action = static::UNSUBSCRIBE;\n $item->data = NULL;\n }\n elseif ($subscription->new) {\n $item->action = static::SUBSCRIBE;\n $item->args = $subscription->queueItemArgs();\n if (!empty($subscription->source) && $subscription->source instanceof Submission) {\n $item->optin_info = FormSubmission::fromWebformSubmission($subscription->source);\n }\n }\n elseif ($item->action == static::UNSUBSCRIBE) {\n $item->action = static::SUBSCRIBE;\n }\n return $item;\n }", "protected function createdASubscription(): bool\n {\n $this->createSubscription();\n\n if(!$this->subscription):\n return $this->subscriptionCreationFailed();\n endif;\n\n // Making sure clients won't be charged after trial period.\n $this->subscription_api->cancelAtTerms($this->subscription);\n\n return true;\n }", "public function createSubscription($channels, Closure $callback, $method = 'subscribe')\n {\n //\n }", "public function __construct($user, $subscription)\n {\n //\n $this->subscription = $subscription;\n $this->user = $user;\n }", "public function __construct()\n\t{\n\t\t$this->type('subscriber');\n\t}", "public static function init(\n string $id,\n string $subscriptionEventType,\n string $effectiveDate,\n string $planVariationId\n ): self {\n return new self(new SubscriptionEvent($id, $subscriptionEventType, $effectiveDate, $planVariationId));\n }", "protected function subscriber(string $queryString): Subscriber\n {\n $subscriber = $this->createMock(Subscriber::class);\n $subscriber->channel = Subscriber::uniqueChannelName();\n $subscriber->query = Parser::parse($queryString);\n\n return $subscriber;\n }", "public function __construct(Subscription $subscription, User $user)\n {\n $this->subscription = $subscription;\n $this->user = $user;\n }", "public function Create()\n {\n \t// CREATE RETAILER TYPE ////////////////////////////////////////////\n \t$rs = mysql_query(\"INSERT INTO subscriptions (subscription_name_fr,\n\t subscription_name_en,\n \t\t\t\t\t\t\t\t\t\t\t\t subscription_desc_fr,\n\t subscription_desc_en,\n\t created_by_id,\n\t created_date,\n\t modified_by_id,\n\t modified_date,\n\t \t\t\t\t\t\t\t\t rowguid) VALUES\n ('\" . scrub($this->subscription_name_fr) .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . scrub($this->subscription_name_en) .\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"','\" . scrub($this->subscription_desc_fr) .\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"','\" . scrub($this->subscription_desc_en) .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . $this->created_by_id .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . $this->modified_by_id .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . create_guid() .\"')\");\n \t\t \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n \t\t \n \t\t \n \t$this->subscription_id = mysql_insert_id();\n \t\t \n \treturn mysql_insert_id();\n \t\t \n \t\n }", "public function create()\n {\n return view ('subscriber::subscriber_create');\n }", "public function subscribe();", "public function newSubscription($name, $plan)\n {\n return new SubscriptionBuilder($this, $name, $plan);\n }", "public function __construct( $subscription_id, $recurring ) {\n\t\tparent::__construct();\n\n\t\t$this->subscription = new Pronamic_WP_Pay_Subscription( $subscription_id );\n\t\t$this->payment = $this->subscription->get_first_payment();\n\t\t$this->recurring = $recurring;\n\t}", "public function subscribe(): void;", "public function pushSubscription()\n {\n return $this->hasOne(PushSubscription::class);\n }", "public function createTopicAndSubscription(string $topicName, string $subscriptionName, string $type): PubSubService\n {\n if (!$this->validName($topicName) || ('pull' == $type && !$this->validName($subscriptionName))) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'The Resource name (topic or subscription) has not a valid format see https://cloud.google.com/pubsub/docs/admin#resource_names for more information.', 'HTTP_CONFLICT')));\n }\n\n $topic = $this->pubSubClient()->topic($topicName);\n\n if (!$topic->exists()) {\n $topic = $this->createTopic($topicName);\n if ($this->getTopicFullName() == $topic) {\n $subscription = $this->pubSubClient()->subscription($subscriptionName);\n\n if ('pull' == $type) {\n if (!$subscription->exists()) {\n $topic = $this->createSubscription($topicName, $subscriptionName);\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n } else {\n if (!$subscription->exists()) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" not exist, add a new subscription in the GCP Console by specify the push method.', 'HTTP_CONFLICT')));\n }\n }\n\n $this->setTopicFullName($topicName);\n $this->setSubscriptionFullName($subscriptionName);\n\n $this->_setInfo();\n\n return $this;\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" not exist, there was an error during topic creation.', 'HTTP_CONFLICT')));\n }\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n }", "public function subscribe($userId = null)\n {\n $this->subscriptions()->create([\n 'user_id' => $userId ?: auth()->id()\n ]);\n\n return $this;\n }", "public function subscribes()\r\n\r\n {\r\n\r\n return new Engine_ProxyObject($this, Engine_Api::_()->getDbtable('subscribes', 'core'));\r\n\r\n }", "public function setSubscription(array $data)\n {\n $returnValue = false;\n\n // check if subscription id exists\n if (!isset($data['id'])) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'ID must be set before attempting a save'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $data['id']\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription has properties update the changed one's\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n $createdTimePropertyUri = $this->_subscriptionConfig->get($this->_propertyMatching['created_time']);\n $data['created_time'] = $subscriptionResourceProperties[$createdTimePropertyUri][0]['content'];\n\n // get the current time\n $now = new Zend_Date;\n\n // if lease seconds is set to the subscription, calculate a new expiration time\n if (isset($data['lease_seconds'])) {\n $data['expiration_time'] = $now\n ->add($data['lease_seconds'], Zend_Date::SECOND)\n ->get('yyyy-MM-dd HH:mms');\n }\n\n // generate new add and delete statements from subscriber data array\n $statements = $this->_generateStatements(\n $subscriptionResourceUri,\n $data,\n $subscriptionResourceProperties\n );\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_UPDATE_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add and delete the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n $this->_selectedModelInstance->deleteMultipleStatements($statements['deleteStatements']);\n\n $returnValue = false;\n // if the subscription has now proberties only add the properties\n } else {\n // generate the add statements\n $statements = $this->_generateStatements($subscriptionResourceUri, $data);\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_ADD_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n\n $returnValue = true;\n }\n\n // end versioning\n $this->_versioning->endAction();\n\n return $returnValue;\n }", "public function getSubscriptionWithId(int $subscriptionId);", "public function save(array $data) {\n $subscription = new Subscriptions();\n \n $subscription->user()->associate($data['customer']);\n $subscription->service()->associate($data['service']);\n $subscription->status()->associate($data['status']);\n $subscription->status_change = $data['date'];\n \n if (isset($data['previousStatus'])) {\n $subscription->previousStatus()->associate($data['previousStatus']);\n }\n \n $subscription->save();\n\n return $subscription;\n }", "public function subscription(): MorphOne\n {\n return $this->morphOne(\\App\\Models\\Subscription::class, 'subscribable');\n }", "public function __construct($id)\n {\n $this->subscription = Subscription::with(['Company.User'])->find($id);\n }", "public function create()\n {\n $title = 'Create Subscriber';\n $topics = Auth::user()->topics;\n return view('subscriber.create', compact('title','topics'));\n }", "public function subscribe(PlanPrice $price, Carbon $started_at, $settings) {\n $ended_at = Carbon::parse($started_at)->addDays(config()->get('subscription.billing_day'));\n\n switch (strtolower($price->recurring_opt)) {\n case 'day':\n $ended_at->addDays($price->recurring_val);\n break;\n case 'month':\n $ended_at->addMonthsNoOverflow($price->recurring_val);\n break;\n case 'year':\n $ended_at->addYearNoOverflow($price->recurring_val);\n break;\n default:\n break;\n }\n\n return Subscription::create([\n 'user_id' => $this->id,\n 'plan_price_id' => $price->id,\n 'started_at' => $started_at,\n 'ended_at' => $ended_at,\n 'settings' => $settings\n ]);\n }", "public function saveSubscription($subscription)\n {\n return Stripe\\Subscription::create(array(\n 'customer' => Stripe\\Customer::retrieve(\n Customer::where('id', $subscription->customer_id)->first()->token\n ),\n 'plan' => $subscription->plan_level\n ));\n }", "public function createSubscription(\\HGON\\HgonPayment\\Domain\\Model\\Article $article)\n {\n $settings = $this->getSettings();\n\n /** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n $objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n /** @var \\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder $uriBuilder */\n $uriBuilder = $objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\Routing\\\\UriBuilder');\n $returnUri = $uriBuilder->reset()->setCreateAbsoluteUri(true)\n ->setTargetPageUid(intval($settings['subscriptionPid']))\n ->uriFor('confirmSubscription', null, 'PayPal', 'HgonPayment', 'Subscription');\n\n // the api does not accept return urls without \".de\" at the end\n // because of this, the api throws error while testing. Use pseudo .de domain\n if (\n $this->context == \"Development\"\n //|| $this->context == \"Production/Staging\"\n ) {\n // override returnUri\n $returnUri = 'http://stage.hgon.de/mitmachen/hgon-sagt-danke/';\n }\n\n\n // get PayPalProduct by sku\n // -> create, if not exists\n $payPalProduct = $this->getPayPalProduct($article);\n\n // @toDo: get PayPayPlan by PayPalProduct (product_id)\n // -> create, if not exists\n // give Article: If it's a donation, this article will not be found in database table\n $payPalPlan = $this->getPayPalPlan($payPalProduct, $article);\n\n if (! ($payPalPlan instanceof \\HGON\\HgonPayment\\Domain\\Model\\PayPalPlan)) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('Cannot fetch PayPalPlan for Article with UID \"%s\". Please check the configuration.', $article->getUid()));\n return false;\n //===\n }\n\n // active directyl with \"SUBSCRIBE_NOW\": https://developer.paypal.com/docs/platforms/subscriptions/#step-3-create-a-subscription\n // (Optional) Use the application_context/user_action field to automatically activate subscriptions. Set the field to SUBSCRIBE_NOW or send it empty. The default value is SUBSCRIBE_NOW. Otherwise, you need to make a POST v1/billing/subscriptions/{ID}/activate call to activate the subscription.\n\n // Create subscription by plan_id\n $data = [\n 'plan_id' => $payPalPlan->getPlanId(),\n //'quantity' => 1,\n 'application_context' => [\n 'user_action' => 'SUBSCRIBE_NOW',\n 'shipping_preference' => 'NO_SHIPPING',\n // IMPORTANT: A local URI with .local to the end was NOT supported by the sandbox for testing!!\n 'return_url' => $returnUri,\n 'cancel_url' => $settings['api']['cancelUrl']\n ]\n ];\n\n $url = $this->host . '/v1/billing/subscriptions';\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n\n $curl = curl_init();\n try {\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n } catch (\\Exception $e) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('An error occurred while trying to make following api call \"%s\". Please check the configuration. Error: %s', $url, $e->getMessage()));\n }\n\n $this->cUrl = $curl;\n return $this->sendRequest();\n //===\n }", "public function subscribe()\n {\n $url = 'https://api.instagram.com/v1/subscriptions/';\n $params = [\n 'client_id' => $this->getClientId(),\n 'client_secret' => $this->getClientSecret(),\n 'object' => 'user',\n 'aspect' => 'media',\n 'verify_token' => '592180',\n 'callback_url' => $this->_url->sessionUrlVar(\n $this->_url->getUrl($this->subscribe_redirect)\n )\n ];\n $this->_httpRequest($url, 'POST', $params);\n }", "public function createSubscription($parameters) {\r\n $request = FlexmailAPI::parseArray($parameters);\r\n\r\n $response = $this->execute(\"CreateGroupSubscription\", $request);\r\n return FlexmailAPI::stripHeader($response, $this->config->get('debug_mode'));\r\n }", "public function create()\n {\n \n return view('backend.subscriber.create');\n \n }", "public function getSubscription()\n {\n /** @var \\ParadoxLabs\\Subscriptions\\Api\\Data\\SubscriptionInterface $subscription */\n $subscription = $this->registry->registry('current_subscription');\n\n return $subscription;\n }", "public function subscribe($subscriber, $startDateTime = null, $createInvoice = true, $user = null) {\n\t\tif ($this->isNewRecord) throw new \\Exception('Subscription package is not yet saved. ');\n\t\t\t\n\t\tif ($subscriber instanceof User) {\n\t\t\t$user = $subscriber;\n\t\t\tif (!$user->id) throw new \\Exception('User is not an valid user. ');\n\t\n\t\t\t$billTo = $user;\n\t\t} else if ($subscriber instanceof Organization || $subscriber instanceof OldOrganizationClass) {\n\t\t\t$organization = $subscriber;\n\t\t\tif (!$organization->id) throw new \\Exception('Organization is not an valid organization. ');\n\t\t\t$billTo = $organization;\n\t\t} else {\n\t\t\tthrow new \\Exception('Subscriber must be instance of either User or Organization. ');\n\t\t}\n\t\t\n\t\t$items = SubscriptionPackageItem::findAll(['package_id' => $this->id]);\n\t\t\n\t\t$transaction = Yii::$app->db->beginTransaction();\n\t\t\n\t\ttry {\n\t\t\tif ($createInvoice) {\n\t\t\t\tif (!isset($user->profile->contact)) throw new \\Exception('Cannot issue invoice to user (user ID: '.$user->id.') without default contact info. ');\n\n\t\t\t\t$invoice = Invoice::createFromBillableItem($this, $billTo);\n\t\t\t}\n\t\t\t\n\t\t\t$bundle = new SubscriptionBundle;\n\t\t\t$bundle->attributes = $this->attributes;\n\t\t\t$bundle->invoice_id = isset($invoice) ? $invoice->id : null;\n\t\t\t$bundle->package_id = $this->id;\n\t\t\t$bundle->organization_id = isset($organization) ? $organization->id : null;\n\t\t\tif (!$bundle->save()) throw new \\Exception('Failed to create bundle. '.print_r($bundle->errors, 1));\n\t\t\t\n\t\t\tforeach ($items as $item) {\n\t\t\t\t\n\t\t\t\t$subscription = new Subscription;\n\t\t\t\t$subscription->bundle_id = $bundle->id;\n\t\t\t\t\n\t\t\t\t$subscription->attributes = [\n\t\t\t\t\t'subscription_identity' => $item->subscription_identity,\n\t\t\t\t\t'price' => $this->price,\n\t\t\t\t\t'purchased_unit' => $item->unit,\n\t\t\t\t\t'used_unit' => 0,\n\t\t\t\t\t'content_valid_period' => $item->content_valid_period,\n\t\t\t\t\t'content_valid_period_type' => $item->content_valid_period_type,\n\t\t\t\t\t'invoice_id' => isset($invoice) ? $invoice->id : null,\n\t\t\t\t\t'priority' => $item->priority,\n\t\t\t\t];\n\t\t\t\tif (isset($user)) $subscription->owned_by = $user->id;\n\t\t\t\t\n\t\t\t\t$subscription->package_id = $this->id;\n\t\t\t\t$subscription->owned_by = isset($user) ? $user->id : null;\n\t\t\t\t$subscription->setExpireAt($item->valid_period, $item->valid_period_type, true, $startDateTime);\n\t\t\t\t\n\t\t\t\tif (!$subscription->save()) throw new \\Exception('Failed to create subscription. '.print_r($subscription->errors, 1));\n\t\t\t}\n\t\t\t\n\t\t\t$transaction->commit();\n\t\t\t\n\t\t\treturn $bundle;\n\t\t} catch (\\Exception $ex) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $ex;\n\t\t}\n\t}", "public function setSubscription(Subscription $subscription)\n {\n $this->subscription = $subscription;\n\n return $this;\n }", "public function createAction(Request $request)\n {\n $entity = new SubscriptionBase();\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('admin_subscriptions_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public static function create_subscribe($user_id, $forum_id)\n {\n $forum_subscribe = new ForumSubscribe();\n $forum_subscribe->set_forum_id($forum_id);\n $forum_subscribe->set_user_id($user_id);\n return $forum_subscribe->create();\n }", "public function subscription($plan = null)\n {\n return new SubscriptionBillableTrait\\Subscription($this, $this->gatewaySubscription(), $plan);\n }", "public function store(SubscriptionStoreRequest $request)\n {\n $user = Auth::user();\n\n $company_name = $request->get('company_name');\n\n $user_password = $request->get('user_password');\n\n\n try {\n\n\n $result = $this->saasService->validateAccount($company_name, $user->email);\n\n if ($result->status == 'error') {\n flash($result->message)->error();\n return back();\n }\n\n } catch (\\Exception $exception) {\n flash(trans('saas.error_something_went_wrong'))->error();\n }\n\n\n $plan = $this->planSservice->getByGateway($request->get('plan'));\n\n $subscription = $request->user()->newSubscription('main', $request->plan);\n\n if ($plan->trial) {\n $subscription->trialDays($plan->trial_days);\n\n }\n\n\n\n if ($request->has('coupon')) {\n $subscription->withCoupon($request->coupon);\n }\n\n try {\n if (config('saas.payment_gateway', '') == 'stripe') {\n $subscription->create($request->token);\n } else {\n $subscription->create($request->payment_method_nonce);\n }\n\n\n } catch (\\Exception $exception) {\n\n flash(trans($exception->getMessage()))->warning();\n\n return redirect(route('account.index'));\n }\n\n try {\n\n if (!config('saas.api_url')) {\n flash(trans('saas.thanks_for_becoming_a_subscriber'))->success();\n return back();\n }\n\n $result = $this->saasService->createAccount($company_name, $user->name, $user->email, $user_password, $plan->teams_limit, $plan->storage_limit, $plan->api_plan);\n\n if ($result->status) {\n\n $user->application_id = $result->data->company->id;\n\n if ($user->save()) {\n\n\n flash(trans('saas.thanks_for_becoming_a_subscriber'))->success();\n } else {\n flash(trans('saas.error_something_went_wrong'))->error();\n }\n } else {\n flash(trans('saas.error_something_went_wrong'), $result->message)->error();\n }\n\n } catch (\\Exception $exception) {\n\n\n flash(trans('saas.error_something_went_wrong'), $exception->getMessage())->error();\n }\n\n return redirect(route('account.index'));\n }", "public function store(CreateSubscriberRequest $request)\n\t{\n\t\t$input = $request->all();\n\t\t$input['email'] = strtolower($input['email']);\n\n\t\t// Check whether subscriber exists\n\t\tif (Subscriber::where('email', $input['email'])->count() > 0) {\n\t\t\t// Fetch the subscriber from the database\n\t\t\t$subscriber = Subscriber::where('email', $input['email'])->firstOrFail();\n\n\t\t\t// If the subscriber isn't verified, resend verification email with new nonce\n\t\t\tif (!$subscriber->verified) {\n\t\t\t\t$subscriber->nonce = str_random(32);\n\t\t\t\t$subscriber->save();\n\n\t\t\t\t$this->sendVerificationEmail($subscriber);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If they are already subscribe, send an 'already-verified' email\n\t\t\t\t$this->sendAlreadyVerifiedEmail($subscriber);\n\t\t\t}\n\t\t} else {\n\t\t\t// Create a Subscriber\n\t\t\t$subscriber = new Subscriber($input);\n\t\t\t$subscriber->nonce = str_random(32);\n\t\t\t$subscriber->verified = False;\n\t\t\t$subscriber->save();\n\n\t\t\t// Send a verification email\n\t\t\t$this->sendVerificationEmail($subscriber);\n\t\t}\n\n\t\treturn view('subscribers/sent');\n\t}", "public function getSubscription($request);", "public function __construct(UserMeta $subscription)\n {\n $this->subscription = $subscription;\n }", "public function createSubscriber()\n {\n return view('add-subscriber');\n }", "public function makeSubscription()\n {\n\n $url = Credentials::getCredentials('/pre-approvals');\n\n $response = Http::withHeaders([\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1'\n ])\n ->post($url, [\n 'plan' => $this->data['plan_reference'],\n 'sender' => [\n 'name' => 'Teste Usuário Sender',\n 'email' => '[email protected]',\n 'hash' => $this->data['senderHash'],\n 'phone' => [\n 'areaCode' => '98',\n 'number' => '984283432'\n ],\n 'address' => [\n 'street' => 'Rua Teste',\n 'number' => '29',\n 'complement' => '',\n 'district' => 'São Bernado',\n 'city' => 'São Luis',\n 'state' => 'MA',\n 'country' => 'BRA',\n 'postalCode' => '65056000'\n ],\n 'documents' => [\n [\n 'type' => 'CPF',\n 'value' => '38868146029'\n ]\n ]\n ],\n 'paymentMethod' => [\n 'type' => 'CREDITCARD',\n 'creditCard' => [\n 'token' => $this->data['token'],\n 'holder' => [\n 'name' => 'Customer Credit Name',\n 'birthDate' => '30/10/1990',\n 'documents' => [\n [\n 'type' => 'CPF',\n 'value' => '38868146029'\n ]\n ],\n 'billingAddress' => [\n 'street' => 'Rua Teste',\n 'number' => '29',\n 'complement' => '',\n 'district' => 'São Bernado',\n 'city' => 'São Luis',\n 'state' => 'MA',\n 'country' => 'BRA',\n 'postalCode' => '65056000'\n ],\n 'phone' => [\n 'areaCode' => '98',\n 'number' => '984283432'\n ]\n ]\n\n ]\n ]\n ]);\n\n return $response->json();\n }", "public function __construct(SubscriptionRepository $subscriptionRepository)\n {\n $this->subscriptionRepository = $subscriptionRepository;\n $this->middleware('auth');\n }", "public function createWithHttpInfo($create_subscription_request)\n {\n $request = $this->createRequest($create_subscription_request);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function stripeSubscribe(Request $request)\n {\n $this->validate($request, [\n 'plan_id' => 'string|required',\n 'payment_method_id' => 'string|required',\n ]);\n\n // Create New Stripe customer\n if (is_null(auth()->user()->stripe_id) || empty(auth()->user()->stripe_id)) {\n $name = auth()->user()->fullname ? auth()->user()->email : null;\n $address = [\n 'line1' => '510 Townsend St',\n 'postal_code' => '98140',\n 'city' => 'San Francisco',\n 'state' => 'CA',\n 'country' => 'US',\n ];\n $email = (auth()->user()->email) ? auth()->user()->email : null;\n $customer = $this->stripeCustomer->createSubscriptionCustomer($name,$email,$address,$request->payment_method_id);\n }\n //stripe customer id\n $customer_id = auth()->user()->stripe_id;\n\n // Subscribe customer to a plan\n $subscription = $this->stripeCustomer->createSubscription($request->plan_id, $customer_id, $request->trial_period);\n\n $sub = Subscriptions::create([\n 'user_id' => auth()->user()->id,\n 'customer_id' => $subscription->customer,\n 'subscription_id' => $subscription->id,\n 'subscription_amount' => $subscription->plan->amount,\n 'plan_name' => $subscription->plan->nickname,\n 'subscription_start_date' => date('Y-m-d h:i:s', $subscription->current_period_start),\n 'subscription_end_date' =>date('Y-m-d h:i:s', $subscription->current_period_end),\n 'subscription_trial_period' => date('Y-m-d h:i:s', $subscription->trial_end),\n ]);\n\n if ($subscription && $sub) {\n $response = \"successful\";\n return json_encode($response);\n } else {\n $response = \"failed\";\n return json_encode($response);\n }\n }", "public function subscribe(SubscriberInterface $subscriber);" ]
[ "0.85392255", "0.73278034", "0.72578204", "0.72071785", "0.7053173", "0.69039595", "0.67673475", "0.67636335", "0.67546886", "0.6713553", "0.6652339", "0.6533789", "0.65286106", "0.6461284", "0.64533013", "0.63908494", "0.63785213", "0.63754284", "0.6340799", "0.63401586", "0.62864465", "0.62812334", "0.62541646", "0.6218941", "0.6217274", "0.6185597", "0.6125956", "0.611027", "0.610604", "0.6094214", "0.60941505", "0.6093531", "0.6066681", "0.6039638", "0.60170233", "0.6009909", "0.6004865", "0.5978031", "0.5972612", "0.5969039", "0.5944673", "0.5942432", "0.5930839", "0.59193367", "0.5908515", "0.5897148", "0.5875859", "0.58460635", "0.58413893", "0.58332205", "0.5830006", "0.5801262", "0.576259", "0.5753829", "0.5751993", "0.57182443", "0.57161516", "0.5714976", "0.5713769", "0.57123566", "0.570574", "0.56834394", "0.56757486", "0.56668514", "0.56597435", "0.56388724", "0.5632273", "0.56250226", "0.5620088", "0.5610532", "0.5605704", "0.560313", "0.5598238", "0.55955714", "0.55910695", "0.55869865", "0.558024", "0.55653256", "0.55616164", "0.55550116", "0.5552944", "0.55518365", "0.5547772", "0.55470175", "0.5528934", "0.5514513", "0.5506044", "0.5505465", "0.5465565", "0.5464723", "0.5452873", "0.5449033", "0.5448549", "0.54477555", "0.5443916", "0.5438792", "0.543438", "0.54074174", "0.53916067", "0.53572965" ]
0.65591764
11
Create a new Invoice instance.
public function invoices() { return new Invoice($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function createNew(): Invoice {\n return new Invoice();\n }", "public function createInvoice()\n {\n $class = $this->class;\n\n return new $class;\n }", "public function createInvoice(Invoice $invoice): Invoice;", "public function createInvoice()\r\n {\r\n }", "public function createInvoice(CreateInvoice $createInvoice): Invoice\n {\n $out = $this->request('createInvoice', ['query' => $createInvoice->toArray()]);\n return new Invoice($out['result']);\n }", "function create_invoice ($invoice) {\n global $sql;\n return $sql->sql_insert('invoice', $invoice);\n }", "public function __construct(Invoice $invoice)\n {\n $this->invoice = $invoice;\n }", "public function newInvoice($options = array(), $draft = false)\n {\n if ($draft) {\n $parameters = array('type_doc' => 'draft');\n } else {\n $parameters = array();\n }\n\n return $this->newItem(\"invoice\", \"invoices\", $options, $parameters);\n }", "public static function init(Invoice $invoice): self\n {\n return new self(new CreateInvoiceRequest($invoice));\n }", "public function createinvoiceAction() {\n\t\t$request = Zend_Controller_Front::getInstance ()->getRequest ();\n\t\tif (is_numeric ( $request->id )) {\n\t\t\t$invoiceID = Invoices::Create ( $request->id );\n\t\t\tif (is_numeric ( $invoiceID )) {\n\t\t\t\tInvoices::setInvoice ( $request->id, $invoiceID );\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'The task requested has been executed successfully.' ), 'status' => 'success' ) );\n\t\t\t} else {\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'An invoice already exists for this order.' ), 'status' => 'danger' ) );\n\t\t\t}\n\t\t}\n\t}", "public function __construct(Invoice $invoice)\n {\n $this->invoice = $invoice;\n }", "public function __construct(Invoice $invoice)\n {\n $this->invoice = $invoice;\n }", "public function __construct(Invoice $invoice)\n {\n $this->invoice = $invoice;\n }", "public function __construct(Invoice $invoice)\n {\n $this->invoice = $invoice;\n }", "public function __construct()\n {\n $this->invoice = $invoice;\n }", "public function create()\n {\n if (! Gate::allows('invoice_create')) {\n return abort(401);\n }\n \n $users = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $projects = \\App\\Project::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $expense_types = \\App\\ExpenseType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $meetings = \\App\\Meeting::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $contingencies = \\App\\Contingency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $providers = \\App\\Provider::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $service_types = \\App\\ServiceType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $pms = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $finances = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n return view('admin.invoices.create', compact('users', 'projects', 'expense_types', 'meetings', 'contingencies', 'providers', 'service_types', 'pms', 'finances'));\n }", "public function invoiceCreate(Request $request)\n {\n $invoice_request = $invoice_data = $request->all();\n\n $response = BilldeskHmac::invoiceCreate($invoice_request);\n }", "public function createAction(Request $request)\n {\n $entity = new Invoice();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n $user = $this->container->get('security.context')->getToken()->getUser();\n\n $data = $this->get('request')->request->all();\n $data = $data['invoice_line'];\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity->setCreatedBy($user);\n foreach ($data['description'] as $key => $description) {\n $line = new InvoiceLine();\n $line->setInvoice($entity);\n $line->setDescription($data['description'][$key]);\n $line->setUnitPrice($data['unitPrice'][$key]);\n $line->setQuantity($data['quantity'][$key]);\n $em->persist($line);\n }\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('invoice_show', array('id' => $entity->getId())));\n }\n\n return $this->render('AcmeInvoiceBundle:Invoice:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createInvoice(OrderInterface $order = NULL, array $options = []);", "public function createInvoice($data) {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n\r\n $invoice = new Invoice();\r\n\r\n $invoice->invoicedate = (isset($data->invoicedate) && $this->validMySQLDate($data->invoicedate)) ? $data->invoicedate : date('Y-m-d');\r\n if (isset($data->amount)) {\r\n $invoice->amount = $data->amount;\r\n } else {\r\n throw new RestException(400, \"amount not specified\");\r\n }\r\n $invoice->vatamount = isset($data->vatamount) ? $data->vatamount : 0;\r\n $invoice->paymenttype = isset($data->paymenttype) ? $data->paymenttype : 'cash';\r\n $invoice->chequenumber = isset($data->chequenumber) ? $data->chequenumber : 0;\r\n if (isset($data->clientid)) {\r\n $invoice->clientid = $data->clientid;\r\n } else {\r\n throw new RestException(400, \"clientid not specified\");\r\n }\r\n if (isset($data->productid)) {\r\n if(!Product::find_by_id($data->productid)) {\r\n throw new RestException(400, \"product doesn't exist\");\r\n }\r\n $invoice->productid = $data->productid;\r\n } else {\r\n throw new RestException(400, \"productid not specified\");\r\n }\r\n//return $invoice;\r\n $result = $invoice->save();\r\n if ($result) {\r\n return $invoice;\r\n } else {\r\n throw new RestException(400, \"Unknown error - Invoice not created\");\r\n }\r\n }", "public function createInvoice($quote)\n {\n $this->clearSessionData();\n if (get_class($quote) == \"Mage_Sales_Model_Quote\") {\n $array_key = \"quoteId\";\n $currency_code_key = \"quote_currency_code\";\n } else {\n $array_key = \"orderId\";\n $currency_code_key = \"order_currency_code\";\n }\n $base_price = $quote->getData(\"grand_total\");\n $base_ccy = $quote->getData($currency_code_key);\n $quote_id = $quote->getData(\"entity_id\");\n\n /// create the ipn url based on the site configuration\n if(Mage::helper(\"bitcoin\")->doesTheStoreHasSSL()){\n $ipnUrl = Mage::getUrl(\"bitcoin/index/ipn\", array(\"_secure\" => true, \"id\" => base64_encode($quote_id)));\n }else{\n $ipnUrl = Mage::getUrl(\"bitcoin/index/ipn\", array(\"_secure\" => false, \"id\" => base64_encode($quote_id)));\n }\n $this->log( \"GENERATED IPN URL : \" . $ipnUrl);\n $http_client = $this->getHTTPClient();\n $yellow_payment_data = array(\n \"base_price\" => $base_price, /// Set to 0.30 for testing\n \"base_ccy\" => $base_ccy, /// Set to \"USD\" for testing\n \"callback\" => $ipnUrl\n );\n $post_body = json_encode($yellow_payment_data);\n $nonce = round(microtime(true) * 1000);\n $url = $this->server_root . $this->api_uri_create_invoice;\n $message = $nonce . $url . $post_body;\n $private_key = Mage::helper('core')->decrypt($this->getConfiguration(\"private_key\"));\n $hash = hash_hmac(\"sha256\", $message, $private_key, false);\n\n $http_client->setHeaders($this->getHeaders($nonce, $hash));\n $http_client->setMethod(\"POST\")\n ->setUri($url);\n $http_client->setRawData($post_body);\n try {\n $response = $http_client->request();\n if ($response->getStatus() == \"200\") {\n $body = $response->getBody();\n $data = json_decode($body, true);\n $this->log(\"Response: \" . $response, $data[\"id\"]);\n /* save the invoice in the database */\n $invoice_data = array(\n $array_key => $quote_id,\n \"invoice_id\" => $data[\"id\"],\n \"url\" => $data[\"url\"],\n \"status\" => $data[\"status\"],\n \"address\" => $data[\"address\"],\n \"invoice_price\" => $data[\"invoice_price\"],\n \"invoice_ccy\" => $data[\"invoice_ccy\"],\n \"server_time\" => $data[\"server_time\"],\n \"expiration_time\" => $data[\"expiration\"],\n \"raw_body\" => $yellow_payment_data,\n \"base_price\" => $yellow_payment_data[\"base_price\"],\n \"base_ccy\" => $yellow_payment_data[\"base_ccy\"],\n \"hash\" => $hash\n );\n /// replace https with http on the invoice url in case the store doesn't have ssl certificate\n $helper = Mage::helper(\"bitcoin\");\n if(!$helper->doesTheStoreHasSSL())\n {\n $invoice_data[\"url\"] = $helper->replaceHttps($data[\"url\"]);\n $data[\"url\"] = $helper->replaceHttps($data[\"url\"]);\n }\n\n Mage::getModel(\"bitcoin/ipn\")->saveInvoice($invoice_data);\n /* end saving invoice */\n Mage::getSingleton('core/session')->setData('invoice', $data);\n Mage::getSingleton('core/session')->setData('has_invoice', true);\n return $data;\n } else {\n Mage::throwException($response->getBody());\n $this->log(\"Error code response received: {$response->getStatus()}\", $array_key . \":\" . $quote_id);\n $this->log(\"Response body:\" . json_encode($response->getBody()), $array_key . \":\" . $quote_id);\n return false;\n }\n } catch (Exception $exc) {\n $this->log($exc->getMessage(), $array_key . \":\" . $quote_id);\n $this->log(\"EXCEPTION: \" . json_encode($exc), $array_key . \":\" . $quote_id);\n Mage::throwException(\n Mage::helper('bitcoin')->__(\n \"{$exc->getMessage()}\\n We're sorry, an error has occurred while completing your request. Please refresh the page to try again. If the error persists, please send us an email at [email protected]\"\n )\n );\n }\n }", "public function __construct($invoice)\n {\n $this->invoice = $invoice;\n }", "public function create()\n {\n $page_title = 'Invoice';\n $page_description = 'Make Invoice';\n return view('invoice.create', compact('page_title', 'page_description'));\n }", "public function actionCreate()\n\t{\n\t\t$model = new AccountInvoice();\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function create()\n\t{\n\t\treturn view('invoices.create');\n\t}", "public function create()\n {\n $data = [];\n $data['menu'] = 'sales';\n if (isset($_GET['type']) && $_GET['type'] == 'project') {\n if (!(Project::where('id', $_GET['project_id'])->exists())) {\n abort(404);\n }\n if (!empty($_GET['customer_id'])) {\n if (!(Customer::where('id', $_GET['customer_id'])->exists()) || (!(Project::where('id', $_GET['project_id'])->exists()) && !(Customer::where('id', $_GET['customer_id'])->exists()))) {\n abort(404);\n }\n }\n $data['menu'] = 'project';\n $data['project_id'] = $_GET['project_id'];\n $data['customer_id'] = $_GET['customer_id'];\n $data['projects'] = Project::all();\n }\n $data['sub_menu'] = 'sales/direct-invoice';\n $data['page_title'] = __('Create Invoice');\n $data['url'] = 'invoice/list';\n\n $data['customerData'] = Customer::with(['currency:id,name,symbol'])->where(['is_active' => 1])->get();\n\n $data['countries'] = Country::getAll();\n $data['currencies'] = Currency::getAll();\n $data['paymentTerms'] = PaymentTerm::getAll();\n $data['locations'] = Location::getAll()->where('is_active', 1);\n $data['salesType'] = SaleType::select('sale_type', 'id')->get();\n\n $invoice_count = SaleOrder::where('transaction_type', 'SALESINVOICE')->count();\n\n if ($invoice_count > 0) {\n $invoiceReference = SaleOrder::where('transaction_type', 'SALESINVOICE')\n ->latest('id')\n ->first(['reference']);\n $ref = explode(\"-\", $invoiceReference->reference);\n $data['invoice_count'] = (int)$ref[1];\n } else {\n $data['invoice_count'] = 0;\n }\n\n $taxTypeList = TaxType::getAll();\n $data['taxes'] = json_encode($taxTypeList);\n $taxOptions = '';\n $selectStart = \"<select name='item_tax[]' class='inputTax form-control bootstrap-select selectpicker' multiple>\";\n $selectEnd = \"</select>\";\n\n $selectStartCustom = \"<select class='inputTax form-control bootstrap-select selectpicker' multiple name='custom_item_tax[1][]'>\";\n $selectEndCustom = \"</select>\";\n $taxHiddenField = \"\";\n\n foreach ($taxTypeList as $key => $value) {\n $taxHiddenField.=\"<input type='hidden' class='itemTaxAmount itemTaxAmount-\".$value->id.\"'>\";\n $taxOptions .= \"<option title='\" . $value->tax_rate . \"%' value='\" . $value->id . \"' taxrate='\" . $value->tax_rate . \"'>\" . $value->name . '(' . $value->tax_rate . ')' . \"</option>\";\n }\n $data['tax_type'] = $selectStart . $taxOptions . $selectEnd;\n $data['custom_tax_type'] = $selectStartCustom . $taxOptions . $selectEndCustom . $taxHiddenField;\n $data['projects'] = Project::where('customer_id', '!=', 0)->get();\n $preference = Preference::getAll()->pluck('value', 'field')->toArray();\n $data['exchange_rate_decimal_digits'] = $preference['exchange_rate_decimal_digits'];\n\n return view('admin.invoice.add', $data);\n }", "public function invoice(array $options = [])\n {\n $this->assertCustomerExists();\n\n $parameters = array_merge($options, ['customer' => $this->paddle_id]);\n\n try {\n /** @var \\Stripe\\Invoice $invoice */\n $stripeInvoice = StripeInvoice::create($parameters, $this->stripeOptions());\n\n $stripeInvoice = $stripeInvoice->pay();\n\n return new Invoice($this, $stripeInvoice);\n } catch (StripeInvalidRequestException $exception) {\n return false;\n } catch (StripeCardException $exception) {\n $payment = new Payment(\n StripePaymentIntent::retrieve(\n ['id' => $stripeInvoice->refresh()->payment_intent, 'expand' => ['invoice.subscription']],\n $this->stripeOptions()\n )\n );\n\n $payment->validate();\n }\n }", "public function create()\n {\n $invoice = new InvoiceEntity();\n $invoice->setNumber('019101910191091')\n ->setValue(100.90)\n ->setUrl('http://domain.com')\n ->setIssuanceDate('2017-09-15')\n ->setKey('POL9898AS');\n\n $tracking = new TrackingEntity();\n $tracking->setOrderId('00001010101AA')\n ->setStatus('in_route')\n ->setCode('BR800OPR5')\n ->setInvoice($invoice);\n\n $this->dm->persist($tracking);\n $this->dm->flush();\n }", "public function testCreateFromOrderShouldReturnAnInvoiceObject()\n {\n $order = new Order();\n $invoice = $this->invoiceFactory->createFromOrder($order);\n static::assertInstanceOf(Invoice::class, $invoice);\n }", "public function whmcs_create_invoice($params = array()) {\n\t\t$params['action'] = 'CreateInvoice';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function create()\n {\n if (! Gate::allows('invoice_create')) {\n return prepareBlockUserMessage();\n }\n \n $customers = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CUSTOMERS_TYPE);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $sales_agent = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CONTACT_SALE_AGENT);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $currencies = \\App\\Currency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $taxes = \\App\\Tax::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $discounts = \\App\\Discount::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $enum_status = Invoice::$enum_status;\n $enum_discounts_format = Invoice::$enum_discounts_format;\n $enum_tax_format = Invoice::$enum_tax_format;\n \n return view('admin.invoices.create', compact('enum_status', 'customers', 'sales_agent','currencies', 'taxes', 'discounts', 'enum_discounts_format', 'enum_tax_format'));\n }", "public function create()\n {\n //\n\t\treturn view('invoice.create');\n }", "public function create(Request $request) {\n $data = $request->all();\n $invoice = $this->service\n ->store($data);\n return response()->json($invoice);\n }", "public function create()\n {\n return view('admin::sales.invoices.add', [\n 'data' => Invoice::factory()->make(),\n 'customers' => Contact::asCustomers()\n ]);\n }", "public function brokerSetupInvoice()\r\n {\r\n $em = $this->entityManager;\r\n $invoiceEntity = $this->invoiceEntity;\r\n $invoiceEntity->setUserId($this->userId);\r\n $invoiceEntity->setGeneratedOn(new \\DateTime());\r\n $invoiceEntity->setAmount($this->amount);\r\n $invoiceEntity->setStatus($em->find('Transactions\\Entity\\InvoiceStatus', UNPAID)); // Paid and Unpaid // set it as unpaid\r\n $invoiceEntity->setInvoiceCategory($em->find('Transactions\\Entity\\InvoiceCategory', 2)); // This is Broker SetUp Invoice\r\n $invoiceEntity->setCurrency($em->find('Settings\\Entity\\Currency', 1)); // tis is set to Naira\r\n try {} catch (\\Exception $e) {\r\n echo 'Invoice generation error';\r\n }\r\n }", "public function create()\n {\n return view('dashboard.invoices.create-purchase-inv');\n }", "private function createPayPalInvoice($order)\n {\n $body = [\n 'merchant_info' => [\n 'email' => '[email protected]',\n 'first_name' => 'Jakob',\n 'last_name' => 'Johansson',\n 'business_name' => 'Woo'\n ],\n 'shipping_info' => [\n 'first_name' => $order->get_shipping_first_name(),\n 'last_name' => $order->get_shipping_last_name(),\n 'address' => [\n 'line1' => $order->get_shipping_address_1(),\n 'city' => $order->get_shipping_city(),\n 'state' => $order->get_shipping_state(),\n ]\n ],\n 'shipping_cost' => [\n 'amount' => [\n 'currency' => $order->get_currency(),\n 'value' => $order->get_total()\n ]\n ]\n ];\n\n $response = wp_remote_retrieve_body(wp_remote_post($this->invoiceUrl, [\n 'method' => 'POST',\n 'headers' => [\n 'Authorization' => 'Bearer ' . $this->getAccessToken(),\n 'Content-Type' => 'application/json'\n ],\n 'body' => json_encode($body)\n ]));\n\n $response = json_decode($response, true);\n\n update_post_meta($order->get_id(), 'paypal_invoice_id', $response['id']);\n }", "public function create()\n {\n //\n return view('finance.invoice.create');\n }", "public function create()\n {\n return view('chuckcms-module-booker::backend.invoices.create');\n }", "public function create(Request $request): View\n {\n $clientId = $request->input('client', null);\n $projectId = $request->input('project', null);\n\n $project = null;\n $client = null;\n $projects = $request->user()->projectsForMenu();\n\n if ($projectId) {\n $project = $request->user()->project($projectId)->with('client')->firstOrFail();\n $client = $project->client;\n $projects = $request->user()->projectsForMenu($client->getKey());\n }\n\n if ($clientId) {\n $project = null;\n $client = $request->user()->client($clientId)->firstOrFail();\n $projects = $request->user()->projectsForMenu($client->getKey());\n }\n\n $invoice = new Invoice();\n $invoice->project_id = $projectId;\n\n $viewVars = [\n 'pageTitle' => 'New Invoice',\n 'projects' => $projects,\n 'client' => $client,\n 'model' => $invoice,\n 'submission_route' => 'invoice.store',\n 'submission_method' => 'POST',\n ];\n\n return view('invoice.form', $viewVars);\n }", "public function __construct(Invoice $invoice)\n {\n $this->invoice = $invoice->load('client', 'items');\n }", "public function create()\n {\n\n return view('invoices.create')\n ->with('couriers', Courier::all())\n ->with('invoiceid', false);\n // return view('invoices.create');\n }", "public function getInvoice(string $id): Invoice;", "public function create()\n\t{\n\t\t// Database Queries\n\t\t$contracts = Contract::with(['asset', 'tenant'])->notEnded()->get();\n\n\t\t// Config/Constants.php 'Queries'\n\t\t// Changes need to be made in the constants.php file AND on the DB\n\t\t$statuses = Config::get('constants.statuses');\n\t\t$priorities = Config::get('constants.priorities');\n\n\t\treturn view('invoices.create', compact('contracts', 'priorities', 'statuses'));\n\t}", "public function createInvoicePdf(): void\n {\n if (is_null($this->invoice)){\n throw new \\InvalidArgumentException(\"You forgot to pass the invoice\");\n }\n\n if ($this->invoice->getType() == Invoice::RECHARGE) {\n $this->rechargeInvoice->createInvoicePdf($this->invoice);\n }\n\n if ($this->invoice->getType() == Invoice::WALLET) {\n $this->walletInvoice->createInvoicePdf($this->invoice);\n }\n\n // if the missing invoice is complementary or additional\n if ($this->invoice->getType() == Invoice::ADDITIONAL) {\n $this->additionalInvoice->createInvoicePdf($this->invoice);\n }\n\n // if the missing invoice is monthly and for an agency or a network\n if ($this->invoice->getType() == Invoice::MONTHLY_PER_ORGANIZATION) {\n $this->organizationMonthly->createInvoicePdf($this->invoice);\n }\n\n // if the missing invoice is monthly and for a single user\n if ($this->invoice->getType() == Invoice::MONTHLY_PER_USER) {\n $this->userMonthlyInvoice->createInvoicePdf($this->invoice);\n }\n\n // if the missing invoice is ordinary\n if ($this->invoice->getType() == Invoice::ORDINARY) {\n $this->ordinaryInvoice->createInvoicePdf($this->invoice);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new ClientInvoice;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ClientInvoice']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ClientInvoice'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n return view('invoice.create');\n }", "public function __construct(array $invoice)\n {\n $this->invoice = $invoice;\n }", "public function create()\n {\n JavaScript::put('invoice_id',(int)$this->service->getLastInsertId()+1);\n return view('admin.invoice.add',[\n 'invoice_id'=>((int)$this->service->getLastInsertId()+1),\n 'taxes' => Tax::all(),\n ]);\n }", "private function _generateInvoice()\n {\n $order = $this->_getOrder();\n if ($order->canInvoice()) {\n $invoice = $order->prepareInvoice();\n\n $invoice->register();\n Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder())\n ->save();\n \n $invoice->pay()->save();\n\n $order->save();\n\n $invoice->sendEmail(\n (boolean) Mage::getStoreConfig(\n 'payment/paymentnetwork_pnsofortueberweisung/send_mail', \n Mage::app()->getStore()->getStoreId()\n ), ''\n );\n }\n }", "public function create()\n {\n return view('dashboard.invoices.create-sale-inv');\n }", "public function upcomingInvoice()\n {\n $this->assertCustomerExists();\n\n try {\n $stripeInvoice = StripeInvoice::upcoming(['customer' => $this->paddle_id], $this->stripeOptions());\n\n return new Invoice($this, $stripeInvoice);\n } catch (StripeInvalidRequestException $exception) {\n //\n }\n }", "public function actionCreate()\n {\n $model = new Invoice();\n $model->loadDefaultValues();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } elseif (Yii::$app->request->isAjax) {\n return $this->renderAjax('create', [\n 'model' => $model\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }", "public function create()\n\t{\n /*if(!in_array('viewProduct', $this->permission)) {\n redirect('dashboard', 'refresh');\n }*/\n\n $this->data['vendor'] = $this->model_products->getVendorData();\n $this->data['products'] = $this->model_products->getProductData();\n\n\t\t$this->render_template('invoice/create', $this->data);\t\n\t}", "public function copy(): Invoice {\n throw new \\LogicException('Not implemented yet');\n }", "public function create()\n {\n return view('invoice::create', $this->service->create());\n }", "public function create() {\n\t\t$title = trans( 'invoice.new' );\n\t\t$this->generateParams();\n\n\t\treturn view( 'layouts.create', compact( 'title' ) );\n\t}", "public function create()\n {\n\n\n \n return view('invoices.create');\n }", "public function create()\n {\n $companies = Company::all();//->pluck('name', 'id');\n $lastNumber = Invoice::getLastNumber();\n $authorizations = Authorization::openForInvoices();\n\n return view('invoice.create', compact('companies', 'lastNumber', 'authorizations'));\n }", "public function _add()\n {\n $type_code = post_param_string('type_code');\n $object = find_product($type_code);\n\n $amount = post_param_string('amount', '');\n if ($amount == '') {\n $products = $object->get_products(false, $type_code);\n $amount = $products[$type_code][1];\n if ($amount == '?') {\n warn_exit(do_lang_tempcode('INVOICE_REQUIRED_AMOUNT'));\n }\n }\n\n $to = post_param_string('to');\n $member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($to);\n if (is_null($member_id)) {\n warn_exit(do_lang_tempcode('_MEMBER_NO_EXIST', escape_html($to)));\n }\n\n $id = $GLOBALS['SITE_DB']->query_insert('invoices', array(\n 'i_type_code' => $type_code,\n 'i_member_id' => $member_id,\n 'i_state' => 'new',\n 'i_amount' => $amount,\n 'i_special' => post_param_string('special'),\n 'i_time' => time(),\n 'i_note' => post_param_string('note')\n ), true);\n\n log_it('CREATE_INVOICE', strval($id), $type_code);\n\n send_invoice_notification($member_id, $id);\n\n $url = build_url(array('page' => '_SELF', 'type' => 'outstanding'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "public function invoice($id = '')\r\n {\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n if ($this->input->post()) {\r\n $invoice_data = $this->input->post(NULL, FALSE);\r\n if ($id == '') {\r\n if (!has_permission('invoices', '', 'create')) {\r\n access_denied('invoices');\r\n }\r\n $id = $this->invoices_model->add($invoice_data);\r\n if ($id) {\r\n set_alert('success', _l('added_successfuly', _l('invoice')));\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n } else {\r\n if (!has_permission('invoices', '', 'edit')) {\r\n access_denied('invoices');\r\n }\r\n $success = $this->invoices_model->update($invoice_data, $id);\r\n if ($success) {\r\n set_alert('success', _l('updated_successfuly', _l('invoice')));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n }\r\n if ($id == '') {\r\n $title = _l('create_new_invoice');\r\n $data['billable_tasks'] = array();\r\n } else {\r\n $invoice = $this->invoices_model->get($id);\r\n\r\n if (!$invoice || (!has_permission('invoices', '', 'view') && $invoice->addedfrom != get_staff_user_id())) {\r\n blank_page(_l('invoice_not_found'), 'danger');\r\n }\r\n\r\n $data['invoices_to_merge'] = $this->invoices_model->check_for_merge_invoice($invoice->clientid, $invoice->id);\r\n $data['expenses_to_bill'] = $this->invoices_model->get_expenses_to_bill($invoice->clientid);\r\n $data['invoice_recurring_invoices'] = $this->invoices_model->get_invoice_recuring_invoices($id);\r\n\r\n $data['invoice'] = $invoice;\r\n $data['edit'] = true;\r\n $data['billable_tasks'] = $this->tasks_model->get_billable_tasks($invoice->clientid);\r\n $title = _l('edit', _l('invoice_lowercase')) . ' - ' . format_invoice_number($invoice->id);\r\n }\r\n if ($this->input->get('customer_id')) {\r\n $data['customer_id'] = $this->input->get('customer_id');\r\n $data['do_not_auto_toggle'] = true;\r\n }\r\n\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(\r\n 'expenses_only !=' => 1\r\n ));\r\n $this->load->model('taxes_model');\r\n $data['taxes'] = $this->taxes_model->get();\r\n $this->load->model('invoice_items_model');\r\n $data['items'] = $this->invoice_items_model->get_grouped();\r\n $data['items_groups'] = $this->invoice_items_model->get_groups();\r\n\r\n $this->load->model('currencies_model');\r\n $data['currencies'] = $this->currencies_model->get();\r\n\r\n $where_clients = 'tblclients.active=1';\r\n\r\n if (!has_permission('customers', '', 'view')) {\r\n $where_clients .= ' AND tblclients.userid IN (SELECT customer_id FROM tblcustomeradmins WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['clients'] = $this->clients_model->get('', $where_clients);\r\n if ($id != '') {\r\n if (total_rows('tblclients', array(\r\n 'active' => 0,\r\n 'userid' => $data['invoice']->clientid\r\n )) > 0 || (total_rows('tblcustomeradmins', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'customer_id' => $data['invoice']->clientid\r\n )) == 0 && !has_permission('customers', '', 'view'))) {\r\n $data['clients'][] = $this->clients_model->get($data['invoice']->clientid, array(), 'row_array');\r\n }\r\n }\r\n\r\n $data['projects'] = array();\r\n if ($id != '' || isset($data['customer_id'])) {\r\n\r\n $where = '';\r\n $where_customer_id = (isset($data['customer_id']) ? $data['customer_id'] : $invoice->clientid);\r\n $where .= 'clientid=' . $where_customer_id;\r\n\r\n if (!has_permission('projects', '', 'view')) {\r\n $where .= ' AND id IN (SELECT project_id FROM tblprojectmembers WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['projects'] = $this->projects_model->get('', $where);\r\n\r\n if ($id != '' && $data['invoice']->project_id != 0) {\r\n if (total_rows('tblprojectmembers', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'project_id' => $data['invoice']->project_id\r\n )) == 0 && !has_permission('projects', '', 'view')) {\r\n $this->db->where('id', $data['invoice']->project_id);\r\n $data['projects'][] = $this->db->get('tblprojects')->row_array();\r\n }\r\n }\r\n }\r\n\r\n $data['staff'] = $this->staff_model->get('', 1);\r\n $data['title'] = $title;\r\n $data['bodyclass'] = 'invoice';\r\n $data['accounting_assets'] = true;\r\n $this->load->view('admin/invoices/invoice', $data);\r\n }", "public function invoiceAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n /**\n * Get order Id\n * @var unknown\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n /**\n * Getting order product ids\n */\n $orderPrdouctIds = Mage::helper ( 'marketplace/vieworder' )->getOrderProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n /**\n * Getting cancel order items\n */\n $cancelOrderItemProductIds = Mage::helper ( 'marketplace/vieworder' )->cancelOrderItemProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n\n /**\n * Getting the sonfiguration for order manage.\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Check whether product id count is greater than one\n */\n if (count ( $orderPrdouctIds ) >= 1 && $orderStatusFlag == 1) {\n $order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n $itemsarray = $itemsArr = array ();\n /**\n * prepare invoice items\n */\n foreach ( $order->getAllItems () as $item ) {\n $qty = 0;\n /**\n * Prepare invoice qtys\n */\n $itemProductId = $item->getProductId ();\n $itemId = $item->getItemId ();\n /**\n * check whether item is in array\n */\n if (in_array ( $itemProductId, $orderPrdouctIds ) && ! in_array ( $itemProductId, $cancelOrderItemProductIds )) {\n $itemsArr [] = $itemId;\n /**\n * Qty ordered for that item\n */\n $qty = $item->getQtyOrdered () - $item->getQtyInvoiced ();\n }\n $itemsarray [$itemId] = $qty;\n }\n\n try {\n /**\n * Create invoice\n */\n if ($order->canInvoice ()) {\n /**\n * Generate invoice for shippment.\n */\n Mage::getModel ( 'sales/order_invoice_api' )->create ( $order->getIncrementId (), $itemsarray, '', 1, 1 );\n\t\t Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $itemsArr, $orderId, 1 );\n\t\t $order->setStatus('processing');\n\t\t $order->save();\n /**\n * add success message\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( 'The invoice has been created.' ) );\n }\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Checkk the permission for generate invoice.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "public function __construct($invoice_id)\n {\n $this->invoice_id = $invoice_id;\n }", "public function create()\n {\n $days = [\n '0' => '--Select Day--', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' =>'16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28'\n ];\n return view('invoices.create', compact('days'));\n }", "public function addNewInvoice(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editInvoiceWlg', ['id'=>$id]);\n\n }", "public function store(Request $request)\n {\n $invoice = new Invoice;\n $invoice->cust_id = isset($request->cust_id) && $request->cust_id ? $request->cust_id : null;\n $invoice->user_id = isset($request->user_id) && $request->user_id ? $request->user_id : null;\n $invoice->product_id = isset($request->product_id) && $request->product_id ? $request->product_id : null;\n $invoice->quantity = isset($request->quantity) && $request->quantity ? $request->quantity : null;\n $invoice->discount_percentage = isset($request->discount_percentage) && $request->discount_percentage ? $request->discount_percentage : null;\n $invoice->tax_percentage = isset($request->tax_percentage) && $request->tax_percentage ? $request->tax_percentage : null;\n $invoice->remarks = isset($request->remarks) && $request->remarks ? $request->remarks : null;\n $invoice->time = isset($request->time) && $request->time ? $request->time : null;\n $invoice->place = isset($request->place) && $request->place ? $request->place : null;\n $invoice->status = isset($request->status) && $request->status ? $request->status : null;\n $invoice->save();\n\n if($invoice){\n echo 'success';\n }else{\n echo 'error';\n }\n }", "public function __construct(LaravelInvoice $invoice)\n {\n //\n $this->xero = new PrivateApplication(config('laravel-xero-boilerplate'));\n $this->invoice = $invoice;\n }", "public function create()\n {\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n $purchaseorderlists = PurchaseOrderLists::pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }else {\n $purchaseorderlists = PurchaseOrderLists::where('quote_sales_person_id', Auth::user()->id)\n ->pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }\n return view('admin.invoice.create', compact('invoice', 'purchaseorderlists'));\n }else{\n Alert::info('No Access !', 'Attention !');\n return redirect('admin/invoice-list');\n }\n }", "public function createInvoice()\n {\n if (!$this->getAutenticacion()) {\n throw new WsException('Error de autenticacion');\n }\n\n $this->validarDatosFactura();\n\n try {\n $ultimoComprobante = $this->wsConsultarUltimoComprobanteAutorizado(\n $this->client,\n $this->authRequest,\n $this->datos->codigoComprobante,\n $this->datos->puntoVenta\n );\n } catch (WsException $e) {\n $codigo = json_decode($e->getMessage())->codigo;\n if ($codigo != 1502) {\n throw new WsException($e->getMessage());\n }\n $ultimoComprobante = 0;\n }\n $this->datos = $this->parseFacturaArray($this->datos);\n $this->datos->numeroComprobante = $ultimoComprobante + 1;\n\n return $this->wsAutorizarComprobante($this->client, $this->authRequest, $this->datos);\n }", "public function actionCreate()\n {\n $model = new Invoice();\n $selection = Yii::$app->request->post('selection');\n if(empty($selection)) {\n Yii::$app->session->setFlash('error', 'Products not selected');\n return $this->redirect(Yii::$app->request->referrer);\n }\n $searchModel = new ProductSearch();\n $dataProvider = $searchModel->search([]);\n $dataProvider->query->where('id in ('.implode(',',$selection).')');\n $model->product_ids=$selection;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n \n return $this->render('create', [\n 'model' => $model,\n 'productsDataProvider' => $dataProvider,\n ]);\n }\n }", "public function actionCreateInvoice() {\n // Create Record with Pending status, the status will turn to Ready as\n // soon as all jobs are retrieved, marked as send, and the invoice\n // is uploaded to S3. The record is being auto created if an instance \n // oh InvoiceHistoryB is not provided to method getInstance()\n $invoiceComponent = InvoiceComponent::getInstance();\n \n // Get data provider\n $data = $this->getData();\n if($data === false || empty($data)) {\n // Redirect back to dashboard page with flag of no selection\n $this->redirect($this->createUrl('billingDashboard/index', array('no-selection' => 1,)));\n }\n \n // Make data provider\n $dataProvider = new CArrayDataProvider($data, array(\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']),\n ),\n ));\n // Update file name to include client name\n $invoiceComponent->setClientData($data[0]->project->client);\n \n // Export to xlsx document.\n $gridViewExcelWriter = $this->widget('GridViewExcelWriter', array(\n 'dataProvider' => $dataProvider,\n 'clearDollarSign' => false,\n 'title' => 'EExcelWriter',\n 'stream' => false,\n 'fileName' => 'invoice-exported-at.' . date('d.m.Y', time()) . '.xlsx',\n 'columns' => require(YiiBase::getPathOfAlias('billing.views.invoice._invoice_grid_columns').'.php'),\n ));\n // Upload the file to S3\n if($invoiceComponent->save($gridViewExcelWriter->getTempFileContent())) {\n // Mark invoice as ready\n $invoiceComponent->markInvoiceAsReady();\n \n // Contains all project ids\n $projectIds = array();\n // Mark project children items as sent\n foreach($data as $item) {\n // Collect project ids\n $projectIds[$item->project_id] = $item->project_id;\n // Item is either ProjectJobB or ProjectExtraServiceB\n $item->markAsSent();\n }\n // Mark all those projects as sent\n ProjectB::model()->manageInvoiceStatus($projectIds);\n \n // Redirect back to dashboard page with flag of no selection\n $this->redirect($this->createUrl('billingDashboard/index', array(\n 'activeTab' => 'Invoice_History',\n )));\n }\n }", "public function create()\n {\n if (! Gate::allows('invoice_create')) {\n return abort(401);\n }\n $relations = [\n 'users' => User::ofType('employee')->get()->pluck('name', 'id')->prepend('Please select', ''),\n ];\n\n return view('invoices.create', $relations);\n }", "public function addNewCommercialInvoice(Request $request, $id){ \n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editCommercialInvoiceWlg', ['id'=>$id]);\n }", "public function create(array $invoicePayload): array\n {\n return Billingo::post('invoices', $invoicePayload);\n }", "public function create()\n {\n $data['action'] = 'invoice.store';\n return view('invoice.form', $data);\n }", "public function insert($shoppingcartInvoice);", "public static function creatCheckoutWithInvoice($cartInfoSession){\n\t\t\n\t\t\n\t\treturn;\n\t}", "public function store(Request $request)\n {\n \n $user = Auth::user();\n $business = $user->business;\n\n // $validator = Validator::make($request->all(), [\n // 'invoice_number' => 'required|numeric|integer',\n // 'invoice_date' => 'required|date',\n // 'due_date' => 'required|date|after:invoice_date',\n // 'currency' => 'in:eur,gbp,usd',\n // 'note' => 'nullable|string|max:1000',\n // ]);\n // if ($validator->fails()) {\n // return response()->json(['error' => 'Unauthorised - Validation failed', 'messages' => $validator->errors()], 422);\n // }\n\n //Create an Invoice\n $invoice = new Invoice;\n $latestInvoice = $business->outgoingInvoices()->orderBy('invoice_number', 'desc')->first();\n if (isset($latestInvoice)) {\n $invoice->invoice_number= $latestInvoice->invoice_number + 1;\n } else {\n $invoice->invoice_number=0;\n }\n $invoice->invoice_date = date('Y-m-d');\n $invoice->due_date = date('Y-m-d', strtotime(\"+1 day\"));\n $invoice->currency = 'eur';\n $invoice->status = 'draft';\n $invoice->draft_email = $request->user_email;\n $invoice->user_id = null;\n $invoice->business_id = $business->id;\n\n //Calculate total cost + adjust for stripe\n $invoice->total_cost = 0;\n foreach ($request->invoiceLines as $line) {\n $invoice->total_cost += $line['cost'] * ceil($line['sec'] / 60) * 100;\n }\n $invoice->save();\n\n //Attach each product as invoice item\n foreach ($request->invoiceLines as $line) {\n $invoiceItem = new InvoiceItems([\n 'name' => $line['name'],\n 'description' => $line['description'],\n 'cost' => $line['cost'] * 100,\n 'quantity' => ceil($line['sec'] / 60),\n 'sub_total' => $line['cost'] * ceil($line['sec'] / 60) * 100\n ]);\n if (isset($line['rate_unit'])) {\n $invoiceItem->rate_unit = $line['rate_unit'];\n }\n $invoice->invoiceItems()->save($invoiceItem);\n }\n return response()->json(200);\n }", "public function __construct(Invoice $invoice, $subject, $body)\n {\n $this->invoice = $invoice;\n $this->subject = $subject;\n $this->body = $body;\n }", "public function invoice(){\n return $this->hasOne(Invoice::class);\n }", "public function ajax_make_invoice() {\n $post_id = (int)$_POST['post_id'];\n $ifpaid = self::extract_ifpaid_tag(get_post_field('post_content', $post_id));\n if (!$ifpaid) return status_header(404);\n\n $invoice = $this->charge->invoice([\n 'currency' => $ifpaid->currency,\n 'amount' => $ifpaid->amount,\n 'description' => get_bloginfo('name') . ': pay to continue reading ' . get_the_title($post_id),\n 'metadata' => [ 'source' => 'wordpress-lightning-publisher', 'post_id' => $post_id, 'url' => get_permalink($post_id) ]\n ]);\n\n wp_send_json($invoice->id, 201);\n }", "protected function createInvoice(OrderInterface $order, Transaction $transaction)\n {\n if (!$order->canInvoice()) {\n return null;\n }\n\n // @todo fix it\n // throwing an exception, might be because of Gateway process with SDK\n return null;\n\n $invoice = $this->invoiceService->prepareInvoice($order);\n $invoice->setRequestedCaptureCase(Invoice::CAPTURE_ONLINE);\n $invoice->register();\n\n $transaction->addObject($invoice)->addObject($invoice->getOrder());\n\n $transaction->save();\n\n return $invoice;\n }", "public function getInvoiceModel(){}", "public function create()\n\t{\n $customers = $this->customers->all();\n\t\treturn View::make('invoices.create', compact('customers'));\n\t}", "public function create()\n {\n $clients = Client::all();\n return view('importinvoice.create', compact('clients'));\n }", "public function actionCreate()\n {\n $model = new Payment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n if(Invoice::setStatus($model->invoice_id, Invoice::STATUS_PAID) ) {\n Yii::$app->session->addFlash(\n 'success', Yii::t('auth', 'You have successfully payed Invoice № '\n . $model->invoice->invoice_number . ' by Payment № '\n . $model->id)\n );\n } else {\n Yii::$app->session->addFlash(\n 'error',\n Yii::t('auth', 'Sorry, but something went wrong, Invoice №'.\n $model->invoice->invoice_number . ' not payed')\n );\n }\n\n $this->redirect('index');\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'invoicesList' => Invoice::getSelfInvoicesWithoutPaymentDropDown(Yii::$app->user->identity),\n 'paymentMethodList' => Payment::PAYMENT_METHODS_ARRAY,\n 'createFrom' => false\n ]);\n }\n }", "public function testCreateFromOrderShouldAssociateOrderToInvoice()\n {\n $order = new Order();\n $invoice = $this->invoiceFactory->createFromOrder($order);\n static::assertEquals($order, $invoice->getOrder());\n }", "public function generateAndSetInvoiceNumber();", "public function addNewInvoiceProForma(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editInvoiceProForma', ['id'=>$id]);\n\n }", "public function createInvoice(LocalOrder $order)\n {\n $invoice = null;\n try {\n $invoice = $this->invoiceService->prepareInvoice($order);\n $invoice->setState($invoice::STATE_OPEN);\n $invoice->register();\n $invoice->save();\n $transactionSave = $this->transaction\n ->addObject($invoice)\n ->addObject($invoice->getOrder());\n $transactionSave->save();\n //send notification code\n $order->addStatusHistoryComment(\n __('The invoice has been create from Magento-Odoo Integration module')\n )\n ->save();\n return $invoice;\n } catch (\\Exception $e) {\n $this->logException($e);\n }\n return $invoice;\n }", "public function store(Request $request, Invoice $invoice)\n {\n }", "public static function create($body)\n\t{\n\t\t$returned = \\QuickFile\\Request::_sendData($body, '/invoice/create');\n\t\treturn $returned->Invoice_Create->Body;\n\t}", "public function __construct(InvoiceService $serv)\n {\n $this->serv = $serv;\n }", "public static function getInstance(int $id): Invoice {\n $cols = implode(',', self::getColumns());\n $table = self::getTableName();\n $sql = \"SELECT $cols FROM $table WHERE invoice_id = :id\";\n $db = DBEngine::getInstance();\n try {\n $db->open();\n } catch (\\Exception $e) {\n return null;\n }\n $row = $db->query($sql, array(':id' => $id))->fetch(\\PDO::FETCH_ASSOC);\n $emp = self::createInstanceFromRow($row);\n $db->close();\n return $emp;\n }", "public function invoiceCreated($invoice)\n\t{\n\n\t}", "public function create() {\n\n\t\t// $product = new \\App\\Product;\n\t\t// $product->name = 'Ettiene';\n\t\t// $product->save();\n\t\treturn view('/invoices/createform');\n\t}", "public function getCurrentInvoice () {\n $pendingInvoice = $this->getPendingInvoice();\n\n if ($pendingInvoice instanceof invoice) return $pendingInvoice;\n\n $invoice = new invoice(array(\"uid_empresa\" => $this->getUID()), NULL);\n\n return $invoice;\n }", "public function __construct(array $data, Invoice $invoice)\n {\n $this->data = $data;\n $this->invoice = $invoice;\n }", "protected function createInvoice($spaceId, $transactionId, Mage_Sales_Model_Order $order)\n {\n $invoice = $order->prepareInvoice();\n $invoice->register();\n $invoice->setTransactionId($spaceId . '_' . $transactionId);\n\n /* @var Mage_Core_Model_Resource_Transaction $transactionSave */\n $transactionSave = Mage::getModel('core/resource_transaction');\n $transactionSave->addObject($invoice)->addObject($invoice->getOrder());\n $transactionSave->save();\n return $invoice;\n }", "public function create(Request $request)\n {\n $customers = Customer::all();\n $customer = Customer::find($request->customer_id);\n $tax = '20';\n $products = Product::all();\n return view('invoices.create', compact('customer', 'products', 'tax', 'customers'));\n }" ]
[ "0.8449245", "0.8397223", "0.82045454", "0.81029445", "0.7537925", "0.7402321", "0.72521687", "0.72495294", "0.7206147", "0.7167472", "0.7145911", "0.7145911", "0.7145911", "0.7145911", "0.7053372", "0.7047809", "0.6992998", "0.69655645", "0.6958713", "0.69263303", "0.68993884", "0.6896605", "0.68958175", "0.6785766", "0.6783148", "0.67359483", "0.67152125", "0.6711877", "0.6698462", "0.66958743", "0.66655326", "0.66589093", "0.6640171", "0.663966", "0.6620581", "0.66155756", "0.6596728", "0.659672", "0.6591104", "0.6581134", "0.6572676", "0.65607834", "0.65435296", "0.6510396", "0.6494623", "0.6482735", "0.64572597", "0.6448062", "0.64435285", "0.64297163", "0.64164335", "0.6397", "0.6378455", "0.6377654", "0.63691616", "0.63656217", "0.6334964", "0.63280994", "0.63178116", "0.6282076", "0.6280815", "0.627416", "0.62681514", "0.6265048", "0.6254793", "0.6249421", "0.6238698", "0.6230468", "0.6218532", "0.6200607", "0.6199642", "0.61875194", "0.6177652", "0.6152549", "0.61475533", "0.614104", "0.6138123", "0.6118771", "0.61148775", "0.6111737", "0.6107239", "0.6082491", "0.60774237", "0.6073188", "0.6071933", "0.60680956", "0.6064655", "0.6057696", "0.6051238", "0.6043172", "0.603747", "0.60324025", "0.6023316", "0.6012247", "0.60076594", "0.6001307", "0.59754163", "0.5974396", "0.5965801", "0.59564835" ]
0.6335295
56
Create a new Payment instance.
public function payments() { return new Payment($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createPayment()\n\t{\n\n\t}", "protected function createPayment() {\n /* @var \\Drupal\\commerce_payment\\Plugin\\Commerce\\PaymentGateway\\PaymentGatewayInterface $payment_gateway */\n $payment_gateway = $this->order->payment_gateway->entity;\n $payment_method = $this->order->payment_method->entity;\n\n $now = REQUEST_TIME;\n $mode = SIPSPaymentGateway::MODES[$payment_gateway->getPlugin()->configuration['mode']];\n\n // Create a payment entity which will be initially in \"pending mode\":\n // \"pending mode\": means that the payment was still not finished in SIPS,\n // so the user is in the platform filling in the credit card or he/she had\n // problems to pay that time (timeout/closed the browser/etc).\n $payment = Payment::create([\n 'order_id' => $this->order->id(),\n 'payment_method' => $payment_method->id(),\n 'payment_gateway' => $payment_gateway->id(),\n // Give it a status: pending/failed/done.\n 'state' => 'new',\n 'remote_state' => 'pending',\n // Give it a max_timestamp of 24 hours.\n 'authorization_expires' => $now + (24 * 60 * 60),\n // Give it a transaction reference.\n 'remote_id' => $this->order->id() . $now,\n 'test' => $mode != PaymentRequest::PRODUCTION,\n 'amount' => $this->order->getTotalPrice(),\n ]);\n\n $payment->save();\n\n return $payment;\n }", "public function createPayment() {\n $api = new ApiPayment($this->_clientId, $this->_clientSecret, $this->_isTest);\n return $api;\n }", "public function create()\n {\n\n $this->validate($this->request, Payment::createRules());\n\n $payment = new Payment;\n\n $payment->bill_id= $this->request->bill_id;\n \n $payment->save();\n \n return $this->response(201,\"Payment\", $payment );\n\n\n }", "public static function newPayment(){\n $result = mysql_query(\"INSERT INTO school_payments () VALUES()\") or die(mysql_error());\n $payment = new payment(mysql_insert_id());\n $payment->completed = date(\"Y-m-d H:i:s\");\n $payment->saveInfo();\n return $payment;\n }", "public function create()\n {\n $payment = new Payment();\n\n $locations = Location::all()->pluck('name', 'id');\n $courses = Course::all()->pluck('name', 'id');\n $subjects = Subject::all()->pluck('name', 'id');\n $batch = Batch::where('id', request()->old('batch_id'))->pluck('name', 'id');\n $student = Student::where('id', request()->old('student_id'))->pluck('name', 'id');\n $session = Session::where('id', request()->old('session_id'))->pluck('name', 'id');\n $payer = User::where('id', request()->old('paid_by'))->pluck('name', 'id');\n $payee = request()->old('paid_to') ? User::where('id', request()->old('paid_to'))->pluck('name', 'id') : [access()->user()->id => access()->user()->name];\n\n return view('backend.payment.create')->with(compact(\n 'batch',\n 'student',\n 'session',\n 'payer',\n 'payee',\n 'locations',\n 'courses',\n 'subjects',\n 'payment'\n ));\n }", "public function createPayment(array $details): Payment\n {\n return $this->payments()->create($details);\n }", "private function createPaymentModel(CreatePaymentData $paymentData, string $type): Payment\n {\n $payment = new Payment([\n 'type' => $type,\n 'amount' => $paymentData->getAmount(),\n 'paid_at' => $paymentData->getPaidAt(),\n 'reference' => $paymentData->getReference(),\n ]);\n\n $userId = $paymentData->getUserId();\n if (null !== $userId) {\n $payment->user_id = $userId;\n }\n\n return $payment;\n }", "public function create()\n {\n //Create Payment\n return view('billing.payment.create');\n }", "public function create(){\n $payer = new Payer();\n $payer->setPaymentMethod(\"paypal\");\n\n // Set redirect URLs\n $redirectUrls = new RedirectUrls();\n\n if (App::environment() == 'production') {\n $app_url = \"https://doomus.com.br/public\";\n } else {\n $app_url = \"http://localhost:8000\";\n }\n\n $redirectUrls->setReturnUrl(\"$app_url/execute-payment\")\n ->setCancelUrl(\"$app_url/cancel-payment\");\n\n // Set payment amount\n if(session('cupom') !== null && session('valorFrete') !== null){\n $amount = new Amount();\n $amount->setCurrency(\"BRL\")\n ->setTotal(round(Cart::total(), 2) + str_replace(',','.', session('valorFrete')));\n }elseif(session('valorFrete') !== null){\n $amount = new Amount();\n $amount->setCurrency(\"BRL\")\n ->setTotal(Cart::total() + str_replace(',','.', session('valorFrete')));\n }else{\n $amount = new Amount();\n $amount->setCurrency(\"BRL\")\n ->setTotal(Cart::total());\n }\n\n // Set transaction object\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setDescription(\"Payment description\");\n\n // Create the full payment object\n $payment = new Payment();\n $payment->setIntent('sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirectUrls)\n ->setTransactions(array($transaction));\n\n // Create payment with valid API context\n try {\n $payment->create($this->_apiContext);\n \n // Get PayPal redirect URL and redirect the customer\n return redirect($payment->getApprovalLink());\n \n // Redirect the customer to $approvalUrl\n } catch (PayPalConnectionException $ex) {\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n } catch (Exception $ex) {\n die($ex);\n }\n }", "public function __construct(Payment $payment)\n {\n $this->payment = $payment;\n }", "public function __construct(Payment $payment)\n {\n $this->payment = $payment;\n }", "public function actionCreate()\n {\n $model = new Payment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n if(Invoice::setStatus($model->invoice_id, Invoice::STATUS_PAID) ) {\n Yii::$app->session->addFlash(\n 'success', Yii::t('auth', 'You have successfully payed Invoice № '\n . $model->invoice->invoice_number . ' by Payment № '\n . $model->id)\n );\n } else {\n Yii::$app->session->addFlash(\n 'error',\n Yii::t('auth', 'Sorry, but something went wrong, Invoice №'.\n $model->invoice->invoice_number . ' not payed')\n );\n }\n\n $this->redirect('index');\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'invoicesList' => Invoice::getSelfInvoicesWithoutPaymentDropDown(Yii::$app->user->identity),\n 'paymentMethodList' => Payment::PAYMENT_METHODS_ARRAY,\n 'createFrom' => false\n ]);\n }\n }", "public function createPayment(Paysera_WalletApi_Entity_Payment $payment)\n {\n return $this->mapper->decodePayment($this->client->post('payment', $this->mapper->encodePayment($payment)));\n }", "public function create()\n {\n try{\n $mollie = new MollieApiClient();\n $mollie->setApiKey(\"test_WD2sWvUWWRqBKfUTy5VS5t8f623ad3\");\n $payment = $mollie->payments->create([\n \"amount\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"10.00\"\n ],\n \"description\" => \"My first API payment\",\n \"redirectUrl\" => \"http://google.com\",\n ]);\n return $payment->getCheckoutUrl();\n// header(\"Location: \" . $payment->getCheckoutUrl(), true, 303);\n } catch (\\Exception $e) {\n return response()->json($e->getMessage(), 400);\n }\n\n }", "public function makePayment() {\n\t\tLoggerRegistry::debug('CustomerModule::makePayment()');\n\t\t// TODO Payment gateway integration\n\t}", "public function createPayment(Request $request) {\n //Setup Payer\n $payer = new Payer();\n $payer->setPaymentMethod('paypal');\n //Setup Amount\n $amount = new Amount();\n $amount->setCurrency('USD');\n $amount->setTotal($request->amount);\n //Setup Transaction\n $transaction = new Transaction();\n $transaction->setAmount($amount);\n $transaction->setDescription('Your awesome\n Product!');\n //List redirect URLS\n $redirectUrls = new RedirectUrls();\n $redirectUrls->setReturnUrl($request->return_url);\n $redirectUrls->setCancelUrl($request->return_url);\n //And finally set all the prerequisites and create the payment\n $payment = new Payment();\n\n $payment->setIntent('sale');\n $payment->setPayer($payer);\n $payment->setRedirectUrls($redirectUrls);\n $payment->setTransactions(array($transaction));\n\n $response = $payment->create($this->api_context);\n //Return our payment info to the user\n return $response;\n\n }", "public function createPayment()\n {\n //return dd($payment);\n //return view('frontend.checkout')->with(['payment' => $payment]);\n }", "public function newEntity(array $attributes = [])\n {\n return new CustomerPayment();\n }", "public function __construct($payment)\n {\n //\n $this->payment = $payment;\n }", "public function create()\n\t{\n\t\t$v = Payment::validate(Input::all());\n\t\t\n\t\t// if everything ok...\n\t\tif ( $v->passes() ) {\n\t\t\t\n\t\t\t// create a new instance\n\t\t\t$payment = new Payment();\n\t\t\t// populate \n\t\t\t$payment->name = Input::get('name');\n\t\t\t$payment->slug = trim(Input::get('slug'));\n\t\t\t$payment->action = Input::get('action');\n\t\t\t$payment->amount = str_replace(',','.',Input::get('amount'));\n\t\t\t$payment->active = 1;\n\t\t\t// setConnection -required- for BRAND DB\n\t\t\t$payment->setConnection(Auth::user()->options->brand_in_use->slug);\n\t\t\t// save the line(s)\n\t\t\t$payment->save();\n\n\t\t\t// success message\n\t\t\tAlert::success(trans('messages.Payment Option saved'));\n\t\t\n\t\t// if not ok...\n\t\t} else {\n\t\t\t\n\t\t\t// prepare error message composed by validation messages\n\t\t\t$messages = ''; foreach($v->messages()->messages() as $error) { $messages .= $error[0].'<br>'; } Alert::error($messages);\n\t\t}\n\t\t\n\t\t// redirect back\n\t\treturn redirect()->back();\n\t}", "public function __construct($payment)\n {\n $this->payment = $payment;\n }", "public function __construct($payment)\n {\n $this->payment = $payment;\n }", "public function createTransferPayment(Request $request);", "public function getPayment()\n {\n return new Payment($this->getSeller(),\n $this->getAmount(),\n $this->getCurrency(),\n $this->getDescription(),\n $this->getOrderId());\n }", "function opalmembership_payment( $payment_id ){\n\treturn new OpalMembership_Payment( $payment_id );\n}", "public function create(\n Token $token,\n int $amount,\n string $currency = 'GBP',\n string $description = null,\n array $metadata = [],\n string $customerUid = null,\n array $params = []\n ): Payment;", "abstract public function getPaymentInstance($payment, $order = array(), $config = array());", "public function createPayment(Transaction $tx)\n {\n $response = $this->request('POST', 'payments', [\n 'order_id' => $tx->id,\n 'receiver' => $tx->to_address,\n 'receiver_name' => $tx->customer ?\n $tx->customer->getFullName() : $tx->from_name,\n 'value' => round($tx->value, 2),\n 'symbol' => 'USD',\n 'expire_time' => time() + 30,\n ]);\n return $response->redirect_page;\n }", "public function created(ReservationPayment $ReservationPayment)\n {\n //\n }", "public function newAction()\n {\n $entity = new Payment();\n \n $user = $this->getUser();\n $em = $this->getDoctrine();\n \n //exit(\\Doctrine\\Common\\Util\\Debug::dump($guides));\n $pobox = $user->getPobox();\n if (!$pobox) {\n throw $this->createNotFoundException('Usted no es cliente...');\n } \n $customer = $pobox->getCustomer();\n $entity->setCustomer($customer);\n $form = $this->createCreateForm($entity);\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'nameform' => 'Reportar pago',\n );\n }", "public function __construct(\\App\\Payment $payment)\n {\n $this->user = $payment->user;\n $this->payment = $payment;\n }", "private function createPaymentRequest()\n {\n $helper = Mage::helper('pagseguro');\n\n // Get references that stored in the database\n $reference = $helper->getStoreReference();\n\n $paymentRequest = new PagSeguroPaymentRequest();\n $paymentRequest->setCurrency(PagSeguroCurrencies::getIsoCodeByName(self::REAL));\n $paymentRequest->setReference($reference . $this->order->getId()); //Order ID\n $paymentRequest->setShipping($this->getShippingInformation()); //Shipping\n $paymentRequest->setSender($this->getSenderInformation()); //Sender\n $paymentRequest->setItems($this->getItensInformation()); //Itens\n $paymentRequest->setShippingType(SHIPPING_TYPE);\n $paymentRequest->setShippingCost(number_format($this->order->getShippingAmount(), 2, '.', ''));\n $paymentRequest->setNotificationURL($this->getNotificationURL());\n $helper->getDiscount($paymentRequest);\n\n //Define Redirect Url\n $redirectUrl = $this->getRedirectUrl();\n\n if (!empty($redirectUrl) and $redirectUrl != null) {\n $paymentRequest->setRedirectURL($redirectUrl);\n } else {\n $paymentRequest->setRedirectURL(Mage::getUrl() . 'checkout/onepage/success/');\n }\n\n //Define Extra Amount Information\n $paymentRequest->setExtraAmount($this->extraAmount());\n\n try {\n $paymentUrl = $paymentRequest->register($this->getCredentialsInformation());\n } catch (PagSeguroServiceException $ex) {\n Mage::log($ex->getMessage());\n $this->redirectUrl(Mage::getUrl() . 'checkout/onepage');\n }\n\n return $paymentUrl;\n }", "public function createPaymentMethod(Request $request)\n {\n $request->validate([\n 'name' => 'required|string|max:255',\n 'price' => 'required|numeric',\n 'description' => 'string|max:255'\n ], [], [\n 'name' => 'název',\n 'price' => 'cena',\n 'description' => 'popisek'\n ]);\n $payment_method = new PaymentMethod;\n $payment_method->fill($request->all());\n $payment_method->save();\n session()->flash('success_message', 'Nový způsob platby byl úspěšně přidán.');\n return redirect(route('admin.delivery_and_payment_methods'));\n }", "public function newAction()\n {\n $entity = new Payment();\n $form = $this->createForm(new PaymentType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "function __construct ()\n\t\t{\n\t\t\tparent::__construct ('Payments', 'Payment', 'Payment');\n\t\t\t$this->Order ('PaidOn', FALSE);\n\t\t}", "public function activatePayment()\n {\n $this->payment = new Payment();\n return $this;\n }", "public function createCreditCardPayment(CreatePaymentData $paymentData): Payment\n {\n $paymentProcessor = app()->make(CreditCardPaymentProcessor::class);\n $purchasedData = $paymentProcessor->process($paymentData)\n ->getData()['response'];\n\n $createdAt = new Carbon($purchasedData['created_at']);\n\n // paidAt not null fill it with $createdAt value\n $paymentData->setPaidAt($createdAt);\n\n $captureCallback = function (Payment $payment) use ($paymentData, $purchasedData, $paymentProcessor) {\n $capturedData = $paymentProcessor\n ->capture($paymentData, $purchasedData['token'])\n ->getData()['response'];\n\n $settledAt = new Carbon($capturedData['captured_at']);\n $createdAt = new Carbon($purchasedData['created_at']);\n\n $creditCardTransaction = new CreditCardTransaction([\n 'payment_id' => $payment->id,\n 'amount' => $payment->amount,\n 'external_transaction_id' => $capturedData['token'],\n 'settled_at' => $settledAt,\n 'created_at' => $createdAt,\n ]);\n\n $creditCardTransaction->saveOrFail();\n $payment->update(['paid_at' => $settledAt]);\n };\n\n $payment = $this->createPayment($paymentData, PaymentTypes::CREDIT_CARD, $captureCallback);\n\n $creditCard = $paymentProcessor->getCreditCard();\n if (!empty($creditCard->getEmail())) {\n $invoice = $paymentProcessor->getInvoice();\n $recipientEmail = $creditCard->getEmail();\n\n $receipt = new PaymentReceipt([\n 'jobId' => $invoice->job_id,\n 'paidAt' => $payment->paid_at,\n 'externalTransactionId' => $payment->creditCardTransaction->external_transaction_id,\n 'amount' => $payment->amount,\n ]);\n event(new CreditCardPaymentProcessedEvent($recipientEmail, $receipt));\n }\n\n return $payment;\n }", "public function getPaymentResource()\n {\n return new PaymentResource($this->paymentAdapter->getConfiguration(), new Curl());\n }", "public function create()\n {\n $paymentMethod = new PaymentMethod();\n return view('paymentMethod.create',compact('paymentMethod'));\n }", "public function createCreditNotePayment(CreatePaymentData $paymentData): Payment\n {\n return $this->createPayment($paymentData, PaymentTypes::CREDIT_NOTE);\n }", "protected function createPayment(Session $session, OrderInterface $order)\n {\n $payment = new Payment();\n $delivery = $this->getShippingDelivery($order);\n\n $total = $order->getSubtotal();\n\n $items = [];\n foreach ($order->getAllVisibleItems() as $item) {\n $items[] = new Product(\n $item->getName(),\n $item->getRowTotalInclTax(),\n $item->getQtyOrdered()\n );\n }\n\n // Secure delivery version adding shipping amount on payment processing side\n if (!$delivery && $order->getShippingAmount() > 0) {\n $items[] = new Product(\n $order->getShippingDescription(),\n $order->getShippingAmount(),\n 1\n );\n $total += $order->getShippingAmount();\n }\n\n $ok = $payment->create(\n $this->getPaymentConfig('merchant_id'),\n $session->id,\n $items,\n $total,\n PaymentType::HOLD == $this->getPaymentConfig('payment_type'),\n $order->getRealOrderId(),\n $delivery\n );\n\n if (!$ok) {\n $res = $payment->getResponse();\n $result = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n $result->setHttpResponseCode(406);\n $data = [\n 'errors' => [\n $res instanceof ResponseError\n ? $res->message\n : __('Cannot post a payment')\n ],\n 'method' => 'createPayment',\n 'shipping' => $delivery\n ];\n if ($this->getPaymentConfig('debug')) {\n $data = array_merge($data, $this->getDebugInfo());\n }\n $result->setData($data);\n return $result;\n }\n return $payment;\n }", "public function create()\n {\n return view('payments.create');\n }", "public function testConstructorAndSetters()\n {\n $payment = new Payment(\n \"T. Test\",\n \"NL29INGB0123456789\",\n 1000,\n Payment::TYPE_FIRST,\n $this->now,\n \"123456\",\n $this->now,\n \"Test payment\"\n );\n\n $this->assertEquals(\"T. Test\", $payment->getName());\n $this->assertEquals(\"NL29INGB0123456789\", $payment->getIban());\n $this->assertEquals(1000, $payment->getAmount());\n $this->assertEquals(Payment::TYPE_FIRST, $payment->getType());\n $this->assertEquals($this->now, $payment->getCollectionDate());\n $this->assertInstanceOf('\\DateTime', $payment->getCollectionDate());\n $this->assertEquals(\"123456\", $payment->getMandateId());\n $this->assertEquals($this->now, $payment->getMandateDate());\n $this->assertInstanceOf('\\DateTime', $payment->getMandateDate());\n $this->assertEquals(\"Test payment\", $payment->getDescription());\n\n // Optional setters/getters\n $payment->setBic(\"INGBNL2A\");\n $payment->setEndToEndId(\"123456\");\n\n $this->assertEquals(\"INGBNL2A\", $payment->getBic());\n $this->assertEquals(\"123456\", $payment->getEndToEndId());\n }", "public function createPayment(PayPlugPaymentEvent $paymentEvent)\n {\n try {\n $parameters = $paymentEvent->getFormattedPaymentParameters();\n $payPlugPayment = Payment::create($parameters);\n\n $paymentEvent->setPaymentId($payPlugPayment->id)\n ->setIsPaid($payPlugPayment->is_paid)\n ->setPaymentUrl($payPlugPayment->hosted_payment->payment_url);\n\n } catch (PayplugException $exception) {\n throw new \\Exception($this->formatErrorMessage($exception), 0, $exception);\n }\n }", "public function create(Request $request)\n {\n $pay = new Payment;\n\n $val = Crypt::decryptString($request->key);\n $str_arr = explode (\"-\", $val);\n $pay->event = $str_arr[0];\n $pay->team_id = $str_arr[1];\n $pay->trxid = $request->trxid;\n $pay->save();\n alert()->success('Your payment information has been submitted successfully. Please visit our selected participants section to get the confirmation. It might take upto 6 hours for us to update.')->autoclose(120000);\n return redirect()->route('front');\n \n }", "public static function factory($attributes)\n {\n $instance = new self();\n $instance->revokedPaymentMethod = PaymentMethodParser::parsePaymentMethod($attributes);\n $instance->customerId = $instance->revokedPaymentMethod->customerId;\n $instance->token = $instance->revokedPaymentMethod->token;\n return $instance;\n }", "public function create()\n {\n $order = new Order();\n $order->setAccountId($this->accountId);\n $order->setLanguage($this->language);\n\n return $order;\n }", "public static function initializeWithRawData($data)\n {\n $item = new Payment();\n\n if(isset($data['amount'])) $item->setAmount($data['amount']);\n if(isset($data['paid_at'])) $item->setPaidAt(new \\DateTime('@' . strtotime($data['paid_at'])));\n if(isset($data['identifier'])) $item->setIdentifier($data['identifier']);\n\n return $item;\n }", "public function create(Request $request)\n {\n try{\n $data = $this->parser->parse($request);\n $payment = $this->repository->create($data);\n return Response::json($payment, 201);\n } catch(RequestParserException $e) {\n return Response::json([\n 'message' => $e->getMessage()\n ], 400);\n } catch(\\Exception $e) {\n return Response::json([\n 'message' => $e->getMessage()\n ], 500);\n }\n }", "public function paymentForm() {\n return new PaymentRequestForm();\n }", "public static function createFromData(PaymentProviderInterface $provider)\n {\n $payment = new static(\n $provider->getSeller(),\n $provider->getAmount(),\n $provider->getCurrency(),\n $provider->getDescription(),\n $provider->getId()\n );\n\n return $payment;\n }", "public function create() {\n\t\t$this->generateParam();\n\t\t$title = trans( 'payment.new' );\n\n\t\treturn view( 'layouts.create', compact( 'title' ) );\n\t}", "function PaymentGateway()\n\t\t{\n\t\t\t// exit(\"Cannot instantiate this class directly\");\n\t\t}", "public function create($amount, $currency = null): Money;", "public function add_payments() {\n\n global $redis;\n\n $user_id = $this->params['user_id'];\n $associate_id = !empty($this->params['associate_id']) ? $this->params['associate_id'] : 0;\n $payment_account_id = $this->params['payment_account_id'];\n $paypal_username = $this->params['paypal_username'];\n $account_dbobj = $this->params['account_dbobj'];\n\n // validate paypal username\n $paypal = new PaypalAccount($account_dbobj);\n $paypal->findOne(\"username='\".$account_dbobj->escape($paypal_username).\"'\");\n if($paypal->getId() === 0) {\n if(!$paypal->setUsername($paypal_username)) {\n $this->errnos[INVALID_PAYPAL_ACCOUNT] = 1;\n $this->status = 1;\n return;\n }\n }\n $paypal->save();\n\n $payment_account = new PaymentAccount($account_dbobj);\n if(!empty($payment_account_id)) {\n $payment_account->findOne('id='.$payment_account_id);\n }\n $payment_account->setPaypalAccountId($paypal->getId());\n $payment_account->save();\n\n $user = new User($account_dbobj);\n $user->findOne('id='.$user_id);\n BaseMapper::saveAssociation($user, $payment_account, $account_dbobj);\n\n if(!empty($associate_id) && $is_active_associate = AssociatesMapper::is_active_associate($associate_id, $account_dbobj)) {\n $associate = new Associate($account_dbobj);\n $associate->findOne('id='.$associate_id);\n $associate->setStatus(ACTIVATED);\n $associate->save();\n $redis->set(\"associate::$associate_id:status\", $associate->getStatus());\n }\n\n $this->response['paypal_account_id'] = $paypal->getId();\n $this->response['paypal_username'] = $paypal->getUsername();\n\n $this->status = 0;\n\n // warm up cache\n $redis->set(\"user:$user_id:payment_account_id\", $payment_account->getId());\n $redis->set(\"payment_account:{$payment_account->getId()}:paypal_account_id\",$paypal->getId());\n $paypal_account_id = $paypal->getId();\n $redis->set(\"paypal_account:$paypal_account_id:username\", $paypal->getUsername());\n $redis->set(\"paypal_account:$paypal_account_id:status\", $paypal->getStatus());\n $redis->set(\"paypal_account:$paypal_account_id:created\", $paypal->getCreated());\n $redis->set(\"paypal_account:$paypal_account_id:updated\", $paypal->getUpdated());\n\n\n }", "public function create()\n\t\t{\n\t\t\treturn View::make('admin.payment_methods.payment-methods-new');\n\t\t}", "public static function create_paypal_button() {\r\n\t\trequire_once(\"class-tpg-pp-donate-button.php\");\r\n\t\t$obj = new tpg_pp_donate_button();\r\n\t\treturn $obj;\r\n\t}", "public function createPaypalPayment(){\n try {\n $client = new Client();\n $paymentResponse = $client->request('POST', $this->paypalPaymentUrl, [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->accessKey,\n ],\n 'body' => $this->salesData->salesData()\n ]);\n $this->parsePaymentBody($paymentResponse);\n \n } catch (\\Exception $ex) {\n $error = $ex->getMessage();\n return $error;\n }\n return $this->paymentBody->id;\n\n }", "public function create()\n {\n return view('dashboard.payment-methods.create');\n }", "public function payoutShouldCreatePaymentAndCallPayoutWithPayment(): void\n {\n $paymentType = (new SepaDirectDebit('1234'))->setId('typeId');\n $customer = (new Customer())->setId('customerId');\n $metadata = (new Metadata())->setId('metadataId');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n /** @noinspection PhpParamsInspection */\n $resourceSrvMock->expects(self::once())->method('createResource')\n ->with(self::callback(static function ($payout) use ($customer, $metadata) {\n return $payout instanceof Payout &&\n $payout->getAmount() === 1.23 &&\n $payout->getCurrency() === 'testCurrency' &&\n $payout->getPayment() instanceof Payment &&\n $payout->getReturnUrl() === 'http://return.url' &&\n $customer === $payout->getPayment()->getCustomer() &&\n $metadata === $payout->getPayment()->getMetadata();\n }));\n $heidelpay = (new Heidelpay('s-priv-123'))->setResourceService($resourceSrvMock);\n $heidelpay->getPaymentService()->payout(1.23, 'testCurrency', $paymentType, 'http://return.url', $customer, 'OrderId', $metadata);\n }", "function pay() {\n if($this->active_invoice->isLoaded()) {\n\n if($this->request->isSubmitted()) {\n try {\n $payment_data = $this->request->post('payment');\n $payment_gateway_id = $this->request->post('payment_gateway_id');\n\n $payment_data['payment_gateway_id'] = $payment_gateway_id;\n\n $payer_email = $payment_data['payer_email'];\n if($payer_email && is_valid_email($payer_email)) {\n $payer = Users::findByEmail($payer_email);\n if(!$payer instanceof User) {\n $payer = new AnonymousUser($payer_email, $payer_email);\n } //if\n } //if\n\n if(!$payer instanceof IUser) {\n throw new Error('Please enter valid Email address');\n } //if\n\n $this->response->assign(array(\n 'payment_data'\t=> $payment_data,\n ));\n\n $cc_number = trim($payment_data['credit_card_number']);\n if($cc_number) {\n $response = is_valid_cc($cc_number);\n if($response !== true) {\n throw new Error($response);\n }//if\n }//if\n\n $payment_data['amount'] = str_replace(\",\",\"\",$payment_data['amount']);\n\n if(!is_numeric($payment_data['amount'])) {\n throw new Error('Total amount must be numeric value');\n }//if\n\n //check if this payment can proceed\n $this->active_invoice->payments()->canMarkAsPaid($payment_data['amount']);\n\n DB::beginWork('Creating new payment @ ' . __CLASS__);\n\n if($payment_gateway_id && $payment_gateway_id > 0) {\n $active_payment_gateway = PaymentGateways::findById($payment_gateway_id);\n if(!$active_payment_gateway instanceof PaymentGateway) {\n $this->response->notFound();\n }//if\n } else {\n throw new Error('Please select preferred payment option');\n }//if\n\n //if this method exists, please check is all necessery extension loaded\n if(method_exists($active_payment_gateway, 'checkEnvironment')) {\n $active_payment_gateway->checkEnvironment();\n }//if\n\n $active_payment = $active_payment_gateway->makePayment($payment_data, $this->active_invoice->getCurrency(), $this->active_invoice);\n\n if(!$active_payment->getIsError() && $active_payment instanceof Payment) {\n\n $active_payment->setIsPublic(true);\n $active_payment->setCreatedBy($payer);\n $active_payment->setParent($this->active_invoice);\n $active_payment->setAttributes($payment_data);\n $active_payment->setStatus(Payment::STATUS_PAID);\n $active_payment->setCurrencyId($this->active_invoice->getCurrency()->getId());\n\n //if we do express checkout\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $active_payment->setStatus(Payment::STATUS_PENDING);\n $active_payment->setReason(Payment::REASON_OTHER);\n $active_payment->setReasonText(lang('Waiting response from paypal express checkout'));\n } //if\n\n $active_payment->save();\n\n //TO-Do check this\n $this->active_invoice->payments()->changeStatus($payer, $active_payment, $payment_data);\n $this->active_invoice->activityLogs()->logPayment($payer);\n\n // Notify if not gagged\n if(!($active_payment instanceof PaypalExpressCheckoutPayment) && !$this->active_invoice->payments()->isGagged()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToFinancialManagers();\n }//if\n\n if($payer instanceof IUser && !$payer->isFinancialManager()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment_to_payer', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToUsers($payer);\n }//if\n\n $this->active_invoice->payments()->paymentMade($active_payment);\n\n DB::commit('Payment created @ ' . __CLASS__);\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $this->response->redirectToUrl($active_payment->getRedirectUrl());\n } //if\n } else {\n throw new Error($active_payment->getErrorMessage());\n } //if\n\n $this->response->assign(array(\n 'active_object'\t=> $this->active_invoice,\n ));\n } catch (Exception $e) {\n DB::rollback('Failed to make payment @ ' . __CLASS__);\n $this->response->assign('errors', $e);\n }//try\n } //if\n } else {\n $this->response->notFound();\n } // if\n }", "public function getPayment(int $paymentId): Payment\n {\n return Payment::findOrFail($paymentId);\n }", "public function actionAddpayment() {\n\n $paymentmodel = new Payment();\n $paymentmodel->price = Yii::$app->request->post('price');\n $paymentmodel->id_orders = Yii::$app->request->post('id_orders');\n $paymentmodel->card_number = Yii::$app->request->post('card_number');\n $paymentmodel->expiration_year = Yii::$app->request->post('expiration_year');\n $paymentmodel->expiration_month = Yii::$app->request->post('expiration_month');\n $paymentmodel->cvcode = Yii::$app->request->post('cvcode');\n\n if(!$paymentmodel->validate()){\n \\Yii::$app->response->statusCode=409;\n return $paymentmodel->getErrors();\n }\n\n $paymentmodel->save();\n\n $last_payment = Payment::find()->orderBy(['id'=>SORT_DESC])->one();\n\n return [\"payment\"=>$last_payment];\n\n }", "public function store(AddPaymentRequest $request)\n {\n $data = $request->validated();\n\n $paymentdata = Payment::create($data);\n\n return response([\n 'data' => $paymentdata,\n ]);\n }", "public function create()\n {\n $data['breadcrumbs'] = [\n [\n 'title' => 'Payments',\n 'url' => 'payments',\n ]\n ];\n view()->share('page_title', 'Add Payment');\n return view('payments.modify',$data);\n }", "public function create()\n {\n Policy::canCreate(new PaymentStructure());\n\n return view('modules.company.payment.structures.create');\n }", "public function create_payment_using_paypal($param = ''){\n\t\t// This sample code demonstrates how you can process a \n\t\t// PayPal Account based Payment.\n\t\t// API used: /v1/payments/payment\n\n\t\t// ### Payer\n\t\t// A resource representing a Payer that funds a payment\n\t\t// For paypal account payments, set payment method\n\t\t// to 'paypal'.\n\n\t\t//load settings \n\t\t$this->_api_context->setConfig($this->config->item('settings'));\n\n\n\t\t$payer = new Payer();\n\t\t$payer->setPaymentMethod(\"paypal\");\n\n\t\t$items = array(array(\n\t\t\t'name'\t\t=> 'coffee cup',\n\t\t\t'currency' => 'USD',\n\t\t\t'quantity' => 1,\n\t\t\t'sku'\t\t=> \"123123\",\n\t\t\t'price'\t\t=> \"7.50\"\n\t\t\t),array(\n\t\t\t'name'\t\t=> 'coffee bars',\n\t\t\t'currency' => 'USD',\n\t\t\t'quantity' => 5,\n\t\t\t'sku'\t\t=> \"321321\",\n\t\t\t'price'\t\t=> \"2\"\n\t\t\t));\n\n\t\t// ### Itemized information\n\t\t// (Optional) Lets you specify item wise\n\t\t// information\n\n\t\t$itemList = new ItemList();\n\t\t$itemList->setItems($items);\n\n\t\t// ### Additional payment details\n\t\t// Use this optional field to set additional\n\t\t// payment information such as tax, shipping\n\t\t// charges etc.\n\n\t\t$details = array(\n\t\t\t'shipping' => \"1.20\",\n\t\t\t'tax' => \"1.30\",\n\t\t\t'subtotal' => \"17.50\"\n\t\t\t);\n\n\t\t// ### Amount\n\t\t// Lets you specify a payment amount.\n\t\t// You can also specify additional details\n\t\t// such as shipping, tax.\n\t\t$amount = array(\n\t\t\t'currency' => 'USD',\n\t\t\t'total' => \"20\",\n\t\t\t'details' => $details\n\t\t\t);\n\n\t\t// ### Transaction\n\t\t// A transaction defines the contract of a\n\t\t// payment - what is the payment for and who\n\t\t// is fulfilling it. \n\n\t\t$transaction = array(\n\t\t\t'amount'\t=> $amount,\n\t\t\t'item_list' => $itemList,\n\t\t\t'description'=> 'payment description',\n\t\t\t'invoice_number'=> uniqid()\n\t\t\t);\n\n\t\t// ### Redirect urls\n\t\t// Set the urls that the buyer must be redirected to after \n\t\t// payment approval/ cancellation.\n\t\t$baseUrl = HOMEURL;\n\t\t$redirectUrls = new RedirectUrls();\n\t\t$redirectUrls->setReturnUrl($baseUrl.\"paypal_1/statuspayment\")\n\t\t ->setCancelUrl($baseUrl.\"paypal_1/cancelpayment\");\n\n\t\t// ### Payment\n\t\t// A Payment Resource; create one using\n\t\t// the above types and intent set to 'sale'\n\t\t$payment = new Payment();\n\t\t$payment->setIntent(\"sale\")\n\t\t ->setPayer($payer)\n\t\t ->setRedirectUrls($redirectUrls)\n\t\t ->setTransactions(array($transaction));\n\n\n\t\t// For Sample Purposes Only.\n\t\t$request = clone $payment;\n\n\t\t// ### Create Payment\n\t\t// Create a payment by calling the 'create' method\n\t\t// passing it a valid apiContext.\n\t\t// (See bootstrap.php for more on `ApiContext`)\n\t\t// The return object contains the state and the\n\t\t// url to which the buyer must be redirected to\n\t\t// for payment approval\n\t\ttry {\n\t\t $payment->create($this->_api_context);\n\t\t} catch (Exception $ex) {\n\t\t // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY\n\t\t ResultPrinter::printError(\"Created Payment Using PayPal. Please visit the URL to Approve.\", \"Payment\", null, $request, $ex);\n\t\t exit(1);\n\t\t}\n\n\t\t// ### Get redirect url\n\t\t// The API response provides the url that you must redirect\n\t\t// the buyer to. Retrieve the url from the $payment->getApprovalLink()\n\t\t// method\n\t\t$approvalUrl = $payment->getApprovalLink();\n\n\t\t// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY\n\t\t//ResultPrinter::printResult(\"Created Payment Using PayPal. Please visit the URL to Approve.\", \"Payment\", \"<a href='$approvalUrl' >$approvalUrl</a>\", $request, $payment);\n\n\t\t//return $payment;\n\t\t//echo \"<pre>\";print_r($payment);die;\n\n\t\t//process payment function redirection\n\n\t\tforeach ($payment->getLinks() as $link) {\n\t\t\tif($link->getRel() == 'approval_url'){\n\t\t\t\t$redirect_url = $link->getHref();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(isset($redirect_url)){\n\t\t\tredirect($redirect_url);\n\t\t}\n\n\t\techo \"Some Error Was occured please try again...!\";\n\n\t\t\n\n\t}", "function create_payment_with_paypal()\n\t{\n\t\t$this->_api_context->setConfig($this->config->item('settings'));\n\n\n\t\t// ### Payer\n\t\t// A resource representing a Payer that funds a payment\n\t\t// For direct credit card payments, set payment method\n\t\t// to 'credit_card' and add an array of funding instruments.\n\n\t\t$payer = new \\PayPal\\Api\\Payer();\n\t\t$payer->setPaymentMethod('paypal');\n\n\t\t// ### Itemized information\n\t\t// (Optional) Lets you specify item wise\n\t\t// information\n\n\n\t\t$ListItemes = array();\n\n\t\tif (is_null(get_cookie(\"cart\")))\n\t\t\tredirect(\"cart\");\n\n\n\t\t$arr = json_decode(get_cookie(\"cart\"), TRUE);\n\n\t\t$ids = array();\n\n\t\tforeach ($arr as $a) {\n\t\t\t$ids[] = $a['id'];\n\t\t}\n\n\t\tif (count($ids) > 0)\n\t\t\t$info = $this->m_p->s_cart(\"products\", $ids, FALSE);\n\t\telse\n\t\t\tredirect(\"cart\");\n\n\n\t\t$products = array();\n\n\t\t$tprice = 0;\n\t\t$ship = get_info(\"shipping\", $this->input->post(\"shipping\"), \"price\") ?? 0;\n\n\t\t$i = 0;\n\n\t\tforeach ($info as $key) {\n\t\t\t$infoa[$key->id] = $key;\n\t\t}\n\n\t\tforeach ($arr as $idk => $k) {\n\t\t\t$key = $infoa[$k['id']];\n\n\t\t\t$options = isset($k['op']) ? json_decode($k['op']) : array();\n\n\t\t\t$products[] = array(\"q\" => $k[\"q\"], \"id\" => $k['id'], \"op\" => $options);\n\n\t\t\t$pr = number_format($key->price - ($key->price * $key->discount / 100), 2);\n\t\t\t$tpr = isset($k['q']) ? number_format($pr * $k['q'], 2) : $pr;\n\n\t\t\t$tprice = $tprice + $tpr;\n\n\t\t\t$ListItemes[$i] = array(\n\t\t\t\t\"name\" \t\t\t=> get_info(\"products\", $key->id, \"title\"),\n\t\t\t\t\"sku\" \t\t\t=> $key->id,\n\t\t\t\t\"currency\" => \"USD\",\n\t\t\t\t\"quantity\" \t\t=> isset($k['q']) ? $k['q'] : 1,\n\t\t\t\t\"price\" \t\t=> $pr\n\t\t\t);\n\n\t\t\t$i++;\n\t\t}\n\n\t\t$date = \"Y-m-d\";\n\n\t\t// if(!empty($coupon))\n\t\t// {\n\t\t// \t$c = $this->m_p->s_a(\"discounts\", array(\"coupon\" => $coupon, \"date >=\" => $date));\n\n\t\t// \tif(count($c) != 0)\n\t\t// \t{\n\t\t// \t\tforeach($c as $k)\n\t\t// \t\t\t$num = $k->num;\n\n\t\t// \t\t$tprice = $tprice - $num * $tprice / 100;\n\t\t// \t}\n\t\t// }\n\n\t\t$ip = $this->input->ip_address();\n\n\t\t$date = date(\"Y-m-d\");\n\n\t\t$results = $this->db->query(\"SELECT * FROM account where dateat like '$date%' \")->row();\n\t\tif ($results) {\n\t\t\t$target = $results->target;\n\t\t} else {\n\t\t\t$target = '00';\n\t\t}\n\t\t$bill_no = '#OR' . strtoupper(substr(md5(uniqid(mt_rand(), true)), 0, 4));\n\t\t$currency_type = $this->input->post(\"currency_type\");\n\t\t$arrInsert = array(\n\t\t\t\"name\" => $this->input->post(\"fullname\"),\n\t\t\t\"tele\" => $this->input->post(\"phone\"),\n\t\t\t\"email\" => $this->input->post(\"email\"),\n\t\t\t\"address\" => $this->input->post(\"address\"),\n\t\t\t\"address2\" => $this->input->post(\"address2\"),\n\t\t\t\"city\" => $this->input->post(\"city\"),\n\t\t\t\"state\" => $this->input->post(\"state\"),\n\t\t\t\"zipcode\" => $this->input->post(\"zipcode\"),\n\t\t\t\"country\" => $this->input->post(\"country\"),\n\t\t\t\"note\" => $this->input->post(\"note\"),\n\t\t\t\"ip\" => $ip,\n\t\t\t\"pay\" => \"paypal\",\n\t\t\t\"totalPrice\" => $tprice + $ship,\n\t\t\t\"products\" => json_encode($products),\n\t\t\t\"date\" => time(),\n\t\t\t\"target\" => $target,\n\t\t\t\"order_id\" => $bill_no,\n\t\t\t\"datetime\" => date('Y-m-d\\TH:i:s'),\n\t\t\t'currency_type' => $currency_type\n\t\t);\n\n\t\t$orderId = $this->m_p->ins(\"orders\", $arrInsert);\n\t\t\n\t\t$itemList = new ItemList();\n\t\t$itemList->setItems($ListItemes);\n\n\t\t// ### Additional payment details\n\t\t// Use this optional field to set additional\n\t\t// payment information such as tax, shipping\n\t\t// charges etc.\n\t\t$details['tax'] = number_format($ship, 2);\n\t\t$details['subtotal'] = number_format($tprice, 2);\n\t\t// ### Amount\n\t\t// Lets you specify a payment amount.\n\t\t// You can also specify additional details\n\t\t// such as shipping, tax.\n\t\t$amount['currency'] = \"USD\";\n\t\t$amount['total'] = number_format($details['tax'] + $details['subtotal'], 2);\n\t\t$amount['details'] = $details;\n\t\t// ### Transaction\n\t\t// A transaction defines the contract of a\n\t\t// payment - what is the payment for and who\n\t\t// is fulfilling it.\n\n\t\t//exit();\n\n\t\t$transaction['description'] = 'Payment';\n\t\t$transaction['amount'] = $amount;\n\t\t$transaction['invoice_number'] = uniqid();\n\t\t$transaction['item_list'] = $itemList;\n\t\t$transaction['custom'] = $orderId;\n\n\t\t// ### Redirect urls\n\t\t// Set the urls that the buyer must be redirected to after\n\t\t// payment approval/ cancellation.\n\t\t$baseUrl = base_url();\n\t\t$redirectUrls = new RedirectUrls();\n\t\t$redirectUrls->setReturnUrl($baseUrl . \"paypal/getPaymentStatus\")\n\t\t\t->setCancelUrl($baseUrl . \"paypal/getPaymentStatus\");\n\n\t\t// ### Payment\n\t\t// A Payment Resource; create one using\n\t\t// the above types and intent set to sale 'sale'\n\t\t$payment = new Payment();\n\t\t$payment->setIntent(\"sale\")\n\t\t\t->setPayer($payer)\n\t\t\t->setRedirectUrls($redirectUrls)\n\t\t\t->setTransactions(array($transaction));\n\n\t\ttry {\n\t\t\t$payment->create($this->_api_context);\n\t\t} catch (Exception $ex) {\n\t\t\t// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY\n\t\t\tprint_r($ex);\n\t\t\texit(1);\n\t\t}\n\t\tforeach ($payment->getLinks() as $link) {\n\t\t\tif ($link->getRel() == 'approval_url') {\n\t\t\t\t$redirect_url = $link->getHref();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (isset($redirect_url)) {\n\t\t\t/** redirect to paypal **/\n\t\t\tredirect($redirect_url);\n\t\t}\n\n\t\t$this->session->set_flashdata('success_msg', 'Unknown error occurred');\n\t\tredirect('home/checkout');\n\t}", "public function payment()\n {\n return $this->hasOne('App\\Payment');\n }", "public function create(){}", "public function processPayment()\n {\n $paymentMethod = $this\n ->methodFactory\n ->create();\n\n /**\n * At this point, order must be created given a card, and placed in\n * PaymentBridge.\n *\n * So, $this->paymentBridge->getOrder() must return an object\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderLoad(\n $this->paymentBridge,\n $paymentMethod\n );\n\n /**\n * Order exists right here.\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderCreated(\n $this->paymentBridge,\n $paymentMethod\n );\n\n /**\n * Payment paid done.\n *\n * Paid process has ended (No matters result)\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderDone(\n $this->paymentBridge,\n $paymentMethod\n );\n\n /**\n * Payment paid successfully.\n *\n * Paid process has ended successfully\n */\n $this\n ->paymentEventDispatcher\n ->notifyPaymentOrderSuccess(\n $this->paymentBridge,\n $paymentMethod\n );\n\n return $this;\n }", "public function store(PaymentCreateRequest $request)\n {\n\n try {\n\n $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_CREATE);\n\n $payment = $this->repository->create($request->all());\n\n $response = [\n 'message' => 'Payment created.',\n 'data' => $payment->toArray(),\n ];\n\n if ($request->wantsJson()) {\n\n return response()->json($response);\n }\n\n return redirect()->back()->with('message', $response['message']);\n } catch (ValidatorException $e) {\n if ($request->wantsJson()) {\n return response()->json([\n 'error' => true,\n 'message' => $e->getMessageBag()\n ]);\n }\n\n return redirect()->back()->withErrors($e->getMessageBag())->withInput();\n }\n }", "public function create($data)\n {\n // create the payment method\n $cpm = CompanyPaymentMethod::create($data);\n return $cpm;\n }", "public function create()\n {\n return 'create payment working';\n }", "public function createDirectDepositPayment(CreatePaymentData $paymentData): Payment\n {\n return $this->createPayment($paymentData, PaymentTypes::DIRECT_DEPOSIT);\n }", "protected static function newFactory(): Factory\n {\n return OrderPaymentFactory::new();\n }", "public function create()\n {\n return view('forms.payments');\n }", "public function __construct(PaymentTransaction $transaction)\n {\n $this->transaction = $transaction;\n }", "public function createAction(Request $request)\n {\n $entity = new Payment();\n $form = $this->createForm(new PaymentType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $securityContext = $this->container->get('security.context');\n $user= $securityContext->getToken()->getUser();\n// $entity->set $user->getId();\n\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('payment_edit', \n array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function store(ModelRequest $request): Payment\n {\n $item = $request->validated()['item'];\n $item['user_id'] = $request->user()->id;\n return Payment::query()->create($item);\n }", "public function create()\n {\n $invoices = Invoice::all();\n $posts = Post::all();\n\n \treturn view('payment.create')\n ->with('invoices', $invoices)\n ->with('posts', $posts);\n }", "public function create() {\n // Prepares query\n $query = \"INSERT INTO \" . Bill::$table_name . \" SET date=:date, user=:user,\n payment=:payment, paid=:paid\";\n $stmt = $this->db->prepare($query);\n\n // Sets the variables in the query to the corresponding attribute values of the bill object\n $stmt->bindParam(\":date\", $this->date);\n $stmt->bindParam(\":user\", $this->user);\n $stmt->bindParam(\":payment\", $this->payment);\n $stmt->bindParam(\":paid\", $this->paid);\n\n // If the execution of the query is successful return true and set the ID of the bill object\n // To the one of the newly created record in the database.\n if($stmt->execute()) {\n $this->id = $this->db->lastInsertId();\n return true;\n } else {\n return false;\n }\n }", "public function create(Request $request)\n {\n $aid = $request->input('aid', 0);\n $account = $this->accounts->getForSelectForAccount($aid);\n\n if (!$account)\n return redirect()->route('admin.payments.index', ['aid' => 0])\n ->withFlashWarning('Unable to create a payment for account ' . $aid);\n\n $dt = Carbon::today()->format($this->userDateFormat);\n\n return view('admin.payments.create')\n ->withAccount($account)\n ->withAccountid($aid)\n ->withDate($dt);\n }", "public function createAction(Request $request)\n {\n $entity = new Payment();\n \n $user = $this->getUser();\n // exit(\\Doctrine\\Common\\Util\\Debug::dump($user));\n $pobox = $user->getPobox();\n if (!$pobox) {\n throw $this->createNotFoundException('Usted no es cliente...');\n } \n $customer = $pobox->getCustomer(); \n $entity->setCustomer($customer);\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $guide = $em->getRepository('NvCargaBundle:Payment')->findByGuide($entity->getGuide());\n if ($guide) {\n throw $this->createNotFoundException('Ya existe un pago reportado para esa guía.');\n }\n $entity->setCreationdate(new \\DateTime());\n $entity->setPaydate(new \\DateTime($entity->getPaydate()));\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('payment_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'nameform' => 'Reportar pago',\n );\n }", "function Payment ($Amt, $glt, $ref, $cur, $leg, $id, $tipocambio, $conversion, $tag){\n\t\t$this->Amount =$Amt;\n\t\t$this->gltemp = $glt;\n\t\t$this->reference = $ref;\n\t\t$this->currency = $cur;\n\t\t$this->legalname = $leg;\n\t\t$this->ID = $id;\n\t\t$this->tipocambio = $tipocambio;\n\t\t$this->conversion = $conversion;\n\t\t$this->tag = $tag;\n\t}", "public function create()\n {}", "public function create()\n\t{\n\t\t$accounts = Account::where('organization_id',Confide::user()->organization_id)->where('active',true)->get();\n\t\treturn View::make('paymentmethods.create',compact('accounts'));\n\t}", "public static function init(): self\n {\n return new self(new V1ListPaymentsRequest());\n }", "public function create(array $data): object\n {\n try {\n $request = new OrdersCreateRequest();\n $request->prefer('return=representation');\n $request->body = $this->buildRequestBody($data);\n\n // Call API with your client and get a response for your call\n $response = $this->client->execute($request);\n\n // initialize payment url\n $paymentUrl = null;\n\n foreach ($response->result->links as $link) {\n if ($link->rel === 'approve') {\n $paymentUrl = $link->href;\n\n break;\n }\n }\n\n return (object) [\n 'id' => $response->result->id,\n 'amount' => (float) $response->result->purchase_units[0]->amount->value,\n 'payment_url' => $paymentUrl,\n 'status' => $response->result->status,\n ];\n } catch (HttpException $ex) {\n // log the error\n Log::error(sprintf(\n 'PAYPAL_API_ERROR:: Code: %s | Message: %s',\n $ex->statusCode,\n $ex->getMessage()\n ));\n\n throw $ex;\n }\n }", "public function create()\n {\n if (!is_null($this->_charge)) {\n return $this;\n }\n\n $this->_charge = Charge::create($this->getParams(), $this->getAuth());\n $this->mapChargeToObject();\n return $this;\n }", "public function __construct($paymentId = null)\n {\n $this->paymentId = $paymentId;\n }", "public function testIsPaymentMethodCreatable()\n {\n $params = self::PAYMENT_METHOD_PARAMS;\n\n $response = self::PAYMENT_METHOD_RESPONSE;\n\n $this->stubRequest(\n 'POST',\n '/payment_methods',\n $params,\n [],\n $response\n );\n\n $result = DirectDebit::createPaymentMethod($params);\n\n $this->assertEquals($response, $result);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.7870808", "0.7763901", "0.75403476", "0.7448342", "0.7366734", "0.69253695", "0.69115764", "0.6855279", "0.68303514", "0.6828394", "0.6769017", "0.6769017", "0.67545223", "0.6710586", "0.667321", "0.6663093", "0.6630997", "0.65884906", "0.6585618", "0.6579959", "0.6519246", "0.64632374", "0.64632374", "0.64549", "0.64524615", "0.643469", "0.6423664", "0.6405752", "0.63244987", "0.627278", "0.62724274", "0.62481534", "0.622459", "0.6208565", "0.62037617", "0.6202314", "0.618166", "0.6173078", "0.61518687", "0.61030316", "0.6096244", "0.6086218", "0.6074023", "0.60337615", "0.6021734", "0.6011681", "0.6000327", "0.59814996", "0.59808004", "0.5975821", "0.597492", "0.59672517", "0.59611136", "0.59607637", "0.5951859", "0.5951682", "0.59447205", "0.5913111", "0.5912694", "0.5902862", "0.59017193", "0.58961356", "0.5890615", "0.5876593", "0.5875482", "0.585584", "0.58540946", "0.58443946", "0.58415616", "0.5839971", "0.5826811", "0.58107096", "0.5798784", "0.5795362", "0.57928514", "0.57766384", "0.57713497", "0.57692885", "0.57609093", "0.57361877", "0.5729374", "0.5728021", "0.57184434", "0.5716497", "0.571589", "0.5706671", "0.5706636", "0.569072", "0.5667048", "0.56580925", "0.56539804", "0.5651148", "0.5649876", "0.56174564", "0.56174564", "0.56174564", "0.56174564", "0.56174564", "0.56174564", "0.56174564" ]
0.64183354
27
Create a new Coupon instance.
public function coupons() { return new Coupon($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create(CouponRequest $request)\n {\n try {\n $this->checkForDuplicateCode($request);\n\n $newCoupon = Coupon::create([\n 'code' => $request->input('coupon-code'),\n 'discount_amount' => (is_null($request->input('coupon-amount')) || $request->input('coupon-amount') == 0) ? NULL : $request->input('coupon-amount'),\n 'discount_type' => $request->input('coupon-type')\n\n ]);\n\n $newCoupon->save();\n } catch (\\Exception $e) {\n return back()->withErrors($e->getMessage())->withInput();\n }\n\n return redirect('/coupon');\n }", "public function __construct(Coupon $coupon)\n {\n $this->coupon = $coupon;\n }", "public function create()\n {\n return view(\"coupons-views.create-coupon\");\n }", "public function create()\n { \n if ($this->validate([\n 'name' => 'required|min_length[3]|max_length[255]',\n ])) {\n $data = [\n 'name' => $this->request->getVar('name'),\n 'type' => url_title($this->request->getVar('type')),\n 'code' => $this->request->getVar('code'),\n 'offer' => $this->request->getVar('offer'),\n 'apply_to' => $this->request->getVar('apply_to'),\n 'buy_x_get_y' => $this->request->getVar('buy_x_get_y')[0]!=0 ? implode(\",\",$this->request->getVar('buy_x_get_y')):null,\n 'apply_value' => $this->request->getVar('apply_value')!=0 ? implode(\",\",$this->request->getVar('apply_value')):null,\n 'user_id' => $this->user_data['id'],\n 'valid_from' => $this->request->getVar('valid_from'),\n 'valid_to' => $this->request->getVar('valid_to')\n ];\n $this->coupons->save($data);\n return $this->response->setJSON(['status_code'=> 201,'message'=>'coupon created succesfully','data'=>$data]);\n }\n $data = [\n 'folder_name' => 'coupons',\n 'page_name' => 'create_coupon',\n 'page_title' => 'Create Coupon',\n 'collection' => $this->collection->findAll(),\n 'errors' => $this->validation->getErrors(),\n ];\n return view('admin/view', $data);\n }", "public function create(CouponAction $couponAction){\n return response()->json(['coupon' => $couponAction->execute($this->user), 'error' => false], 200);\n }", "public function create(CreateCouponRequest $request)\n {\n return view('backend.coupons.create');\n }", "public function create()\n {\n if (Auth::user()->cant('create', Coupon::class)) {\n return redirect()->route('admin.home')->with(['message'=>'You don\\'t have permissions']);\n }\n $view = view('admin.coupon_create');\n $view->with('title', 'New coupon');\n return $view;\n }", "public function testCouponCreation()\n {\n $this->Details=array( 'recipient_id' => \"13245245\",\n 'offerType' => \"4534234\",\n 'expringdate' => date(\"Y-m-d H:i:s\")\n );\n $this->Coupon = new Coupon();\n $this->assertContains('success', $this->Coupon->addCoupon($this->Details));\n\n }", "public function asStripeCoupon(): StripeCoupon\n {\n return StripeCoupon::retrieve(\n $this->code,\n CashierExtended::stripeOptions()\n );\n }", "public function create()\n {\n return view('backstage.manager.coupon.create');\n }", "public function create(){\n\t\tglobal $TBL_ecommerce_coupon;\n\n\t\t//Check if the coupon has already been created\n\t\tif($this->id) return FALSE;\n\n\t\t/**\n\t\t * @todo Do complete verifications on the created object coherence.\n\t\t */\n\n\t\t$link = dbConnect();\n\t\t//Create a random coupon code\n\t\t$found=true;\n\t\twhile($found){\n\t\t\t$code = substr(strtoupper(md5(uniqid(rand(), true))),3,8);\n\t\t\t//check if the coupon exists in DB\n\t\t\t$request = request(\"SELECT `id` FROM `$TBL_ecommerce_coupon` WHERE `code`='$code'\",$link);\n\t\t\t//break the loop, the generated code is unique\n\t\t\tif(!mysql_num_rows($request)) $found=false;\n\t\t}\n\t\tmysql_close($link);\n\n\t\t$this->code = $code;\n\n\t\treturn $this->save();\n\t}", "public function create()\n {\n return view('plugin::coupon.create');\n }", "public function create()\n {\n return view('backend.coupon.create');\n }", "public function createCoupon()\n {\n //wsw_coupon insert rows\n $entity_Coupon_base = new entity_Coupon_base();\n $entity_Coupon_base->uid = $this->memberInfo->uid;\n $entity_Coupon_base->coupon_money = $this->coupon_value;\n $entity_Coupon_base->coupon_status = service_Coupon_base::coupon_status_unused;\n $entity_Coupon_base->create_time = $this->now;\n\n $dao = dao_factory_base::getCouponDao();\n //$dao->getDb()->startTrans();\n\n for ( $i = 0; $i <= $this->coupon_num; $i++ ) {\n $entity_Coupon_base->coupon_code = $this->getCouponCode();\n $res = $dao->insert( $entity_Coupon_base );\n }\n return $res;\n /**\n * if ( $spec_value_map_dao->getDb()->isSuccess() && $spec_value_map_dao->getDb()->getNumRows() > 0 ) {\n\n if ( $dao->getDb()->isSuccess() ) {\n $dao->getDb()->commit();\n return true;\n } else {\n $dao->getDb()->rollback();\n return false;\n }\n * \n * @return type \n */\n }", "public function create()\n {\n return view('vendorpanel.coupon.create');\n \n }", "public function create()\n {\n return view('admin.coupon.create');\n }", "public function store(Request $request)\n {\n if (Auth::user()->cant('create', Coupon::class)) {\n return redirect()->route('admin.home')->with(['message'=>'You don\\'t have permissions']);\n }\n $rules = [\n 'code' => 'required|unique:coupons',\n 'value' => 'required|numeric|min:0.01',\n 'expire' => 'date_format:\"d.m.Y\"|nullable',\n 'min_order_price' => 'numeric|nullable|min:0.01',\n 'max_usages' => 'integer|nullable|min:0',\n ];\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return redirect()->route('coupons.create')->withErrors($validator)->withInput();\n }\n\n $coupon = new Coupon();\n $coupon->code = $request->get('code');\n $coupon->value = $request->get('value');\n $coupon->type = $request->get('type');\n $coupon->expire = $request->get('expire');\n $coupon->min_order_price = $request->get('min_order_price');\n $coupon->max_usages = $request->get('max_usages');\n $coupon->save();\n return redirect()->route('coupons.edit', ['id'=>$coupon->id]);\n }", "public function create()\n {\n return view('backend.marketing.coupons.create');\n }", "public function create()\n {\n return view('pos.coupons.create');\n }", "public function create()\n {\n //\n return view('admin.coupon.coupon_add');\n }", "public function create()\n {\n //\n return view('coupons.create');\n }", "public function create()\n {\n return view('coupons.create');\n }", "public function create()\n {\n return view('backend.coupons.create');\n }", "public function create()\n {\n return view('admin.pages.coupon.create');\n }", "public function create()\n {\n return view('Admin.coupons.create');\n }", "public function store(CouponRequest $request)\n {\n // Retrieve the validated input data...\n $data = $request->validated();\n Log::debug('input:', $data);\n $coupon = new Coupon();\n $coupon->name = $data['name'];\n $coupon->code = $data['code'];\n $coupon->description = $data['description'];\n $coupon->discount = $data['discount'];\n\n $coupon->start_time = Carbon::createFromFormat('Y-m-d H:i', $data['start_time']);\n $coupon->end_time = Carbon::createFromFormat('Y-m-d H:i', $data['end_time']);\n\n $coupon->total_usage = $data['total_usage'];\n\n DB::transaction(function () use ($coupon, $data) {\n $coupon->save();\n\n // discountType\n $coupon_discountType = Category::find($data['discountType']);\n $coupon->discountType()->associate($coupon_discountType)->save();\n\n // discountType\n $coupon_business = Category::find($data['business']);\n $coupon->business()->associate($coupon_business)->save();\n\n Log::info(\"create coupon \" . $coupon->id);\n });\n\n $request->session()->flash('alert-success', 'Coupon added successfully.');\n\n return redirect()->route('admin.coupons.index');\n }", "public function create()\n {\n return view('seller.coupon.create');\n }", "public function store(CreateCouponRequest $request)\n {\n $input = $request->all();\n\n $coupon = $this->couponRepository->create($input);\n\n Flash::success('Coupon saved successfully.');\n\n return redirect(route('coupon.cuopons.index'));\n }", "public function __construct(StripeEvent $coupon) {\n $this->coupon = $coupon;\n }", "public function create()\n {\n return view('admin.coupons.create');\n }", "public function create()\n\t{\n\t\treturn view('admin.tour_coupon.add');\n\t}", "public function __construct(CouponService $couponService)\n {\n $this->couponService = $couponService;\n }", "protected function create(array $data)\n {\n $user = User::create([\n 'name' => $data['surname'].' '.$data['name'],\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'token' => $this->userRepository->createToken(),\n 'active' => 1,\n ]);\n $user->assignRole('customer');\n\n $customer = new Customer;\n $customer->user_id = $user->id;\n $customer->surname = $data['surname'];\n $customer->name = $data['name'];\n $customer->email = $data['email'];\n $dob = false;\n if( array_key_exists('day', $data) && !is_null($data['day']) && !is_null($data['month']) && !is_null($data['year']) ) {\n $customer->dob = $data['year'].'-'.$data['month'].'-'.$data['day'];\n $dob = true;\n } else {\n $customer->dob = null;\n }\n $customer->tel = null;\n $json = [];\n $json['loyalty_points'] = 0;\n if( array_key_exists('promo_acceptance', $data) ) {\n $json['promo'] = true;\n } else {\n $json['promo'] = false;\n }\n $json['ean'] = $this->generateEanForCustomer();\n\n $customer->json = $json;\n $customer->save();\n\n $register_coupon = new Coupon;\n $register_coupon->user_id = $user->id;\n $register_coupon->number = $this->generateCouponNumber();\n $register_coupon->status = Coupon::STATUS_AWAITING;\n $json = [];\n $json['reward'] = 'original-donut';\n $register_coupon->json = $json;\n $register_coupon->save();\n\n if($dob) {\n $dob_coupon = new Coupon;\n $dob_coupon->user_id = $user->id;\n $dob_coupon->number = $this->generateCouponNumber();\n $dob_coupon->status = Coupon::STATUS_AWAITING;\n $json = [];\n $json['reward'] = 'original-donut';\n $dob_coupon->json = $json;\n $dob_coupon->save();\n }\n\n return $user;\n }", "public function store(CouponRequest $request)\n {\n try {\n $coupon = new Coupon();\n $coupon->title = $request->title;\n $coupon->code = $request->code;\n $coupon->price = $request->price;\n $coupon->status = $request->status;\n $coupon->save();\n Session::flash('coupon_success', 'کد تخفیف با موفقیت ثبت شد');\n return redirect('/admin/coupons');\n }\n catch (\\Exception $m) {\n Session::flash('coupon_error', 'خطایی در ثب به وجود آمده لطفا مجددا تلاش کنید');\n return redirect('/admin/coupons');\n }\n }", "public function store(CreateCouponAPIRequest $request)\n {\n $input = $request->all();\n\n $brand = $this->brandRepository->find($input['brand_id']);\n if(!$brand)\n abort(404, 'Brand id not found');\n\n $coupon = $this->couponRepository->create($input);\n\n return $this->sendResponse($coupon->toArray(), 'Coupon saved successfully');\n }", "public function create(Request $request)\r\n { \r\n\r\n return view('backend.coupon.create');\r\n }", "public function store(Request $request)\n {\n // if(count(Coupon::where('code', $request->coupon_code)->get()) > 0){\n // flash(translate('Coupon already exist for this coupon code'))->error();\n // return back();\n // }\n // $coupon = new Coupon;\n // if ($request->coupon_type == \"product_base\") {\n // $coupon->type = $request->coupon_type;\n // $coupon->code = $request->coupon_code;\n // $coupon->discount = $request->discount;\n // $coupon->discount_type = $request->discount_type;\n // $date_var = explode(\" - \", $request->date_range);\n // $coupon->start_date = strtotime($date_var[0]);\n // $coupon->end_date = strtotime( $date_var[1]);\n // $cupon_details = array();\n // foreach($request->product_ids as $product_id) {\n // $data['product_id'] = $product_id;\n // array_push($cupon_details, $data);\n // }\n // $coupon->details = json_encode($cupon_details);\n // if ($coupon->save()) {\n // flash(translate('Coupon has been saved successfully'))->success();\n // return redirect()->route('coupon.index');\n // }\n // else{\n // flash(translate('Something went wrong'))->danger();\n // return back();\n // }\n // }\n // elseif ($request->coupon_type == \"cart_base\") {\n // $coupon->type = $request->coupon_type;\n // $coupon->code = $request->coupon_code;\n // $coupon->discount = $request->discount;\n // $coupon->discount_type = $request->discount_type;\n // $date_var = explode(\" - \", $request->date_range);\n // $coupon->start_date = strtotime($date_var[0]);\n // $coupon->end_date = strtotime( $date_var[1]);\n // $data = array();\n // $data['min_buy'] = $request->min_buy;\n // $data['max_discount'] = $request->max_discount;\n // $coupon->details = json_encode($data);\n // if ($coupon->save()) {\n // flash(translate('Coupon has been saved successfully'))->success();\n // return redirect()->route('coupon.index');\n // }\n // else{\n // flash(translate('Something went wrong'))->danger();\n // return back();\n // }\n // }\n }", "public function coupon($id)\n {\n $this->coupon = $id;\n\n return $this;\n }", "public function create(Cupon $cupon)\n {\n $dealers = User::where('level' , 'dealer')->get() ;\n $products = Product::where('active' , 'yes')->where('quantity' , '>' , 0 )->get() ;\n return view(ad.'.cupons.add' , compact('dealers' , 'products'));\n }", "public function create()\n {\n if (Auth::guest())\n {\n return redirect()->guest('admin/login');\n }\n else{\n\t\t\tif(!hasTask('admin/coupons/create')){\n\t\t\t\treturn view('errors.404');\n\t\t\t}\n //Get the category data\n $category_list = getCategoryLists(5);\n //Get the vendors data\n $vendors_list = getVendorLists(5);\n SEOMeta::setTitle('Create Coupon - Election');\n SEOMeta::setDescription('Create Coupon - Election');\n return view('admin.coupons.create')->with('category_list', $category_list)->with('vendors_list', $vendors_list);\n }\n }", "public function store(Request $request)\n {\n $data = $request->all();\n //echo \"<pre>\"; print_r($data);die();\n\n\n $coupon = new Coupon;\n $coupon->coupon_code = $data['coupon_code'];\n $coupon->amount = $data['amount'];\n $coupon->amount_type = $data['amount_type'];\n\n\n if(!empty($data['status'])){\n $coupon->status = $data['status'];\n }\n\n\n\n $coupon->expiry_date = date($data['expiry_date']);\n\n\n\n $couponsCode = DB::table('coupons')->where(['coupon_code' => $data['coupon_code']])->count();\n //print_r($countProducts);\n //die();\n\n if($couponsCode>0){\n Toastr::error('Coupons already exist in Cart!','Errors');\n return redirect()->back();\n }\n\n\n $coupon->save();\n\n //Toastr::success('Coupon code update attributes successfully','Success');\n Toastr::success('Create Coupon code successfully !','Success');\n return redirect()->route('admin.coupons.index');\n\n }", "public function store(CouponRequest $request)\n {\n $request = Coupon::create($request->validated());\n Alert::success('O cupom foi cadastrado com sucesso!');\n return redirect('/coupons');\n }", "public function testCouponGeneration()\n {\n $this->Coupon = new Coupon();\n $this->assertEquals(8, strlen($this->Coupon->generateCouponCode(8)));\n\n }", "public function couponCallback() {\n\n\t\ttry {\n\t\t\t/* * ********* Check input parameters ******************************* */\n\t\t\tif (!isset($_POST['token'], $_POST['coupon_code'], $_POST['coupon_value'], $_POST['coupon_type'])) {\n\t\t\t\tthrow new Exception(SyC::t('sdk','At least one of the parameters is missing. Received: {data}', array('{data}' => print_r($_POST, true))));\n\t\t\t}\n\n\t\t\t//make sure the coupon is valid\n\t\t\t$this->assertCouponIsValid($_POST['token'], $_POST['coupon_code'], $_POST['coupon_value'], $_POST['coupon_type']);\n\n\t\t\t//save the coupon\n\t\t\t$this->saveCoupon($_POST['token'], $_POST['coupon_code'], $_POST['coupon_value'], $_POST['coupon_type'], (isset($_POST['product_unique_ids']) && is_array($_POST['product_unique_ids']) ? $_POST['product_unique_ids'] : array()));\n\n\t\t\t//check if the coupon is intended to be applied to the current cart\n\t\t\tif (empty($_POST['save_only'])) {\n\t\t\t\t$this->applyCoupon($_POST['coupon_code']);\n\t\t\t}\n\t\t} catch (Exception $e) {\n\n\t\t\theader(\"HTTP/1.0 403\");\n\t\t\techo $e->getMessage();\n\t\t\t\n\t\t\tif($this->isDebugMode()){\n\t\t\t\techo $e->getTraceAsString();\n\t\t\t}\n\t\t}\n\t}", "public function store(CouponRequest $request)\n {\n \n //validate data\n $validated = $request->validated();\n\n $coupon = $this -> coupon -> create([\n 'coupon_code' => $request -> coupon_code,\n 'amount' => $request -> amount,\n 'amount_type' => $request -> amount_type,\n 'expiry_date' => date(\"Y-m-d\", strtotime($request-> expiry_date)),\n 'is_active' => $request -> is_active\n ]);\n \n return redirect('khalaadmin/coupons')->with('flash_message', 'Thêm mới mã '. $coupon -> coupon_code.' thành công !');\n }", "protected function createStripeCustomer()\n {\n return BaseCustomer::create([\n 'email' => $this->user->email\n ]);\n }", "public function __construct(Coupon $coupon)\n {\n $this->middleware('admin:index-list_coupon|create_coupon|show-view_coupon|edit-edit_coupon|destroy-delete_coupon', ['except' => ['store', 'update']]);\n $this -> coupon = $coupon;\n }", "public function store(Request $request)\n {\n $this->validateWith([\n 'couponCode' => 'required|alpha_num|unique:tbl_coupons',\n 'type' => 'required',\n 'discountPrice' => 'required',\n 'minPrice' => 'required'\n ]);\n\n $data = new Coupon;\n\n $data->couponCode = $request->couponCode;\n $data->type = $request->type;\n $data->discountPrice = $request->discountPrice;\n $data->minPrice = $request->minPrice;\n\n $data->save();\n\n Session::flash('success', 'Succesfully added.');\n\n return redirect()->route('coupons.index');\n\n }", "public function store(StoreCouponsRequest $request)\n {\n //\n $coupon = new Coupon();\n $coupon->code = $request->code;\n $coupon->expirationdate = $request->expirationdate;\n $coupon->discount = $request->discount;\n $coupon->save();\n\n return redirect()->route('coupons.index')->with('message', 'Coupon aangemaakt');\n }", "public function couponPostAction()\n {\n /** @var Divante_OpenLoyalty_Model_Quote $quote */\n $quote = $this->_getQuote();\n\n $this->resetLoyaltyInUse();\n\n /** @var Mage_Core_Helper_Data $helperCore */\n $helperCore = Mage::helper('core');\n \n /**\n * No reason continue with empty shopping cart\n */\n if (!$quote->getItemsCount()\n || !$this->_validateFormKey()) {\n $this->_goBack();\n\n return;\n }\n\n /** @var string $couponCode */\n $couponCode = (string) $this->getRequest()->getParam('coupon_code');\n \n if ($this->getRequest()->getParam(self::REMOVE_PARAM) == 1) {\n $couponCode = '';\n }\n \n $oldCouponCode = $quote->getCouponCode();\n\n if (!strlen($couponCode) && !strlen($oldCouponCode)) {\n $this->_goBack();\n \n return;\n }\n\n try {\n $quote->getShippingAddress()->setCollectShippingRates(true);\n $quote->setCouponCode(strlen($couponCode) ? $couponCode : '')\n ->unsetLoyaltyDiscount()\n ->collectTotals()\n ->save();\n\n if (strlen($couponCode)) {\n if ($couponCode == $quote->getCouponCode()) {\n $this\n ->_getSession()\n ->addSuccess(\n $this->__(\n 'Coupon code \"%s\" was applied.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n } else {\n $this\n ->_getSession()\n ->addError(\n $this->__(\n 'Coupon code \"%s\" is not valid.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n }\n } else {\n $this\n ->_getSession()\n ->addSuccess($this->__('Coupon code was canceled.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this\n ->_getSession()\n ->addError($e->getMessage());\n } catch (Exception $e) {\n $this\n ->_getSession()\n ->addError($this->__('Cannot apply the coupon code.'));\n Mage::logException($e);\n }\n\n $this->_goBack();\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required',\n 'start_time' => 'required|date',\n 'stop_time' => 'required|date',\n 'shop_id' => 'integer',\n 'match_price' => 'required|numeric',\n 'reduced_price' => 'required|numeric',\n 'amount' => 'integer|numeric'\n ], [\n 'title.required' => '优惠券标题不能为空',\n 'start_time.required' => '有效期开始时间不能为空',\n 'stop_time.required' => '有效期结束时间不能为空',\n ]);\n\n if ($validator->fails()) {\n $error = $validator->errors()->first();\n\n return $this->error($error);\n }\n\n $condition = ['MATCH' => $request->match, 'PRICE' => $request->price];\n\n $result = Coupon::create([\n 'title' => $request->title,\n 'start_time' => $request->start_time,\n 'stop_time' => $request->stop_time,\n 'shop_id' => $request->shop_id,\n 'amount' => $request->amount,\n 'match_price' => $request->match_price,\n 'reduced_price' => $request->reduced_price\n ]);\n\n if($result){\n return $this->success();\n } else {\n return $this->error();\n }\n }", "public function store(Request $request,Cupon $cupon)\n {\n\n $this->validate($request, [\n 'start_date' => 'required',\n 'end_date' => 'required',\n ]);\n\n $cupon->start_date = $request->start_date ;\n $cupon->end_date = $request->end_date ; \n $cupon->user_id = $request->user_id ;\n // $cupon->currencie_id = $request->currencie_id ;\n // $cupon->countrie_id = $request->countrie_id ;\n // $cupon->citie_id = $request->citie_id ;\n //$cupon->region_id = $request->region_id ;\n $cupon->product_id = $request->product_id ;\n $cupon->discount_percentage = $request-> discount_percentage;\n $cupon->discount_monay = $request->discount_monay ;\n $cupon->active = $request->active ;\n $cupon->cupon_code = time() ;\n\n $cupon->save();\n\n $request->session()->flash('alert-success', __('admin.alerts_success_adding'));\n return back();\n }", "public function coupon()\n {\n return $this->belongsTo('App\\Coupon');\n }", "function createJoomshoppingCoupon($coupon_value = 10, $user_id, $day_expire, $coupon_month_expire) {\n $item = new stdClass();\n $item->coupon_type = 0;\n $item->coupon_code = $this->generateNumberCouponCode();\n $item->coupon_value = $coupon_value;\n $item->tax_id = 0;\n $item->used = 0;\n $item->for_user_id = 0;\n $item->coupon_start_date = date('Y-m-d', time());\n $item->coupon_expire_date = date('Y-m-d', $day_expire); // истекает поcле заданного периода\n $item->finished_after_used = 1; // 1 - означает, что купон можно использовать 1 раз\n $item->coupon_publish = 1;\n\n $result = JFactory::getDbo()->insertObject('#__jshopping_coupons', $item);\n\n if ($result) {\n $item_u = new stdClass();\n $item_u->user_id = $user_id;\n $item_u->created = time();\n $item_u->coupon_code = $item->coupon_code;\n $item_u->coupon_value = $item->coupon_value;\n $item_u->coupon_month_expire = $coupon_month_expire;\n JFactory::getDbo()->insertObject('unique_coupons', $item_u);\n }\n }", "public function create()\n {\n $arr['businesses'] = data4Select(BusinessPartner::class);\n $arr['discountTypes'] = data4Select(DiscountType::class);\n return view('admin.coupons.create')->with($arr);\n }", "public static function get_coupon( $coupon_id ) {\n\n\t\twc_deprecated_function( __METHOD__, '5.5.0', 'new WC_Coupon()' );\n\n\t\t$coupon = null;\n\n\t\tif ( $coupon_id instanceof \\WC_Coupon ) {\n\n\t\t\t$coupon = $coupon_id;\n\n\t\t} elseif ( $coupon_id instanceof \\WP_Post ) {\n\n\t\t\t$coupon = new \\WC_Coupon( $coupon_id->ID );\n\n\t\t} elseif ( is_numeric( $coupon_id ) ) {\n\n\t\t\t$post_title = wc_get_coupon_code_by_id( $coupon_id );\n\t\t\t$coupon = new \\WC_Coupon( $post_title );\n\t\t}\n\n\t\treturn $coupon;\n\t}", "public function coupon()\n {\n return $this->belongsTo(Coupons::class);\n }", "public function create($data)\n {\n // create the payment method\n $cpm = CompanyPaymentMethod::create($data);\n return $cpm;\n }", "public function coupon(): BelongsTo\n {\n return $this->belongsTo(Coupon::class);\n }", "public function applyCoupon($coupon)\n {\n $this->assertCustomerExists();\n\n $customer = $this->asStripeCustomer();\n\n $customer->coupon = $coupon;\n\n $customer->save();\n }", "public function __construct($parent, $coupon)\n {\n $this->parent = $parent;\n $this->coupon = $coupon;\n }", "public function actionCoupon(){\n // Redirect away if he has billing setup previously.\n // Not allowed if customer already has used billing\n if(count(Yii::$app->user->identity->billings)>0){\n $this->redirect('index');\n }\n\n // Attempt to post coupon\n if($couponCode = Yii::$app->request->post('coupon')){\n $agentEmail = Yii::$app->user->identity->agent_email;\n $coupon = \\common\\models\\Coupon::find()->where(['coupon_name' => $couponCode])->one();\n if(!$coupon){\n Yii::error(\"[Invalid Coupon Attempted ($couponCode)] Agent: $agentEmail\", __METHOD__);\n Yii::$app->getSession()->setFlash('error', \"[Invalid Coupon Code] This coupon code is not valid.\");\n }else{\n $errors = false;\n\n // Check if its at user limit\n if($coupon->isAtUserLimit() && !$errors){\n $errors = true;\n Yii::$app->getSession()->setFlash('warning', \"[Invalid Coupon] This coupon is no longer valid.\");\n Yii::error(\"[Attempted to redeem coupon thats already reached limit ($couponCode)] Agent: $agentEmail\", __METHOD__);\n }\n\n // Check if coupon expiry date passed\n if($coupon->isExpired() && !$errors){\n $errors = true;\n Yii::$app->getSession()->setFlash('warning', \"[Coupon Expired] This coupon has expired on \".Yii::$app->formatter->asDate($coupon->coupon_expires_at, \"long\").\".\");\n Yii::error(\"[Attempted to redeem expired coupon ($couponCode)] Agent: $agentEmail\", __METHOD__);\n }\n\n //If customer already has used a coupon previously\n if(\\common\\models\\CouponUsed::findOne(['agent_id' => Yii::$app->user->identity->agent_id]) && !$errors){\n $errors = true;\n Yii::$app->getSession()->setFlash('warning', \"[Unable to use coupon] You have already used a coupon\");\n Yii::error(\"[Unable to use coupon ($couponCode)] You've already used a coupon. Agent: $agentEmail\", __METHOD__);\n }\n\n if(!$errors){\n // Redeem coupon for that agent\n $trialDaysToExtend = $coupon->coupon_reward_days;\n\n // Extend Trial for Agent\n $agent = Yii::$app->user->identity;\n $agent->agent_trial_days = $agent->agent_trial_days + $trialDaysToExtend;\n $agent->save(false);\n\n // Enable Agent and his Managed Accounts\n $agent->enableAgentAndManagedAccounts();\n\n // Mark Coupon Usage\n $couponUsage = new \\common\\models\\CouponUsed;\n $couponUsage->agent_id = $agent->agent_id;\n $couponUsage->coupon_id = $coupon->coupon_id;\n $couponUsage->save();\n\n Yii::$app->getSession()->setFlash('success', \"[Coupon Redeemed] Your trial has been extended by $trialDaysToExtend days\");\n Yii::info(\"[Coupon used ($couponCode) by $agentEmail] Trial has been extended by $trialDaysToExtend days.\", __METHOD__);\n }\n\n }\n }\n\n return $this->render('coupon');\n }", "public function __construct(Coop $coop)\n {\n $this->coop = $coop;\n }", "public function store(Request $request)\n {\n $coupon = new Coupon(\n [\n 'name' => $request->get('name'),\n 'code' => $request->get('code'),\n 'percentage' => $request->get('percentage'),\n 'status' => 1\n ]\n );\n\n $coupon->save();\n\n return redirect('/coupons')->with('success', 'Category Added');\n }", "public function store_discount_affiliate_new( $coupon_object ) {\n\n\t\t$coupon_id = $coupon_object->getId();\n\n\t\tif ( empty( $_POST['user_name'] ) ) {\n\t\t\tdelete_post_meta( $coupon_id, 'affwp_discount_affiliate' );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $_POST['user_id'] ) && empty( $_POST['user_name'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$data = affiliate_wp()->utils->process_request_data( $_POST, 'user_name' );\n\n\t\t$affiliate_id = affwp_get_affiliate_id( $data['user_id'] );\n\n\t\tupdate_post_meta( $coupon_id, 'affwp_discount_affiliate', $affiliate_id );\n\n\t}", "public function createCustomer(){\n if($this->paypalCustomer == null)\n $this->paypalCustomer = $this->retrieveCustomer();\n\n return $this;\n }", "public function testCreateCouponStore()\n {\n\n }", "public function create()\n {\n $clients = Client::orderBy('nome')->get();\n $users = User::orderBy('name')->get();\n return view('coupons.create', compact('clients', 'users'));\n }", "public function create()\n {\n\t\t$typecoupons_=TypeCoupons::all();\n\t\t$typecoupons=array(''=>'Select coupon type');\n\t\tforeach ($typecoupons_ as $typecoupon)\n\t\t{\n\t\t\t$typecoupons[$typecoupon->id]=$typecoupon->name;\n\t\t}\n\n\t\t$typerentals_=TypeRentals::all();\n\t\t$typerentals=array(''=>'Select rental type');\n\t\tforeach ($typerentals_ as $typerental)\n\t\t{\n\t\t\t$typerentals[$typerental->id]=$typerental->name;\n\t\t}\n\n\t\t$statuscoupons_=StatusCoupons::all();\n\t\t$statuscoupons=array(''=>'Select coupon status');\n\t\tforeach ($statuscoupons_ as $statuscoupon)\n\t\t{\n\t\t\t$statuscoupons[$statuscoupon->id]=$statuscoupon->name;\n\t\t}\n\n return view('admin.coupons.add')\n\t\t\t->with('statuscoupons', $statuscoupons)\n\t\t\t->with('typecoupons', $typecoupons)\n\t\t\t->with('typerentals', $typerentals);\n }", "public function addCoupon(Request $request)\n {\n return view('commerce-frontend::profile.coupon');\n }", "protected function createDonationEntry()\n {\n $this->donation = new Donation;\n \n $this->donation->set('donor_id', $this->donor->get('id'));\n $this->donation->set('fundraiser_id', $this->fundraiser_profile->get('user_id'));\n $this->donation->set('amount', $this->data['amount']);\n \n $this->donation->create();\n }", "public function create()\n {\n $shops = Shop::all();\n return view('admin.coupons.create', compact('shops'));\n }", "public function generateCoupon()\n {\n $params = $this->getRequest()->getParams();\n if (! isset($params['id']) || !isset($params['code'])) {\n Mage::helper('ddg')->log('Coupon no id or code is set');\n\n return false;\n }\n\n //coupon rule id\n $couponCodeId = $params['id'];\n\n if ($couponCodeId) {\n $rule = Mage::getModel('salesrule/rule')->load($couponCodeId);\n //coupon code id not found\n if (! $rule->getId()) {\n Mage::helper('ddg')->log(\n 'Rule with couponId model not found : ' . $couponCodeId\n );\n\n return false;\n }\n\n $generator = Mage::getModel('salesrule/coupon_massgenerator');\n $generator->setFormat(\n Mage_SalesRule_Helper_Coupon::COUPON_FORMAT_ALPHANUMERIC\n );\n $generator->setRuleId($couponCodeId);\n $generator->setUsesPerCoupon(1);\n $generator->setDash(3);\n $generator->setLength(9);\n $generator->setPrefix('DOT-');\n $generator->setSuffix('');\n //set the generation settings\n $rule->setCouponCodeGenerator($generator);\n $rule->setCouponType(Mage_SalesRule_Model_Rule::COUPON_TYPE_AUTO);\n //generate the coupon\n $coupon = $rule->acquireCoupon();\n $couponCode = $coupon->getCode();\n //save the type of coupon\n $couponModel = Mage::getModel('salesrule/coupon')\n ->loadByCode($couponCode);\n\n $couponModel->setType(Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON)\n ->setGeneratedByDotmailer(1);\n\n if (isset($params['expire_days']) && is_numeric($params['expire_days']) && $params['expire_days'] > 0) {\n $days = (int) $params['expire_days'];\n $locale = Mage::app()->getLocale()->getLocale();\n //@codingStandardsIgnoreStart\n $expirationDate = Zend_Date::now($locale)->addDay($days);\n //@codingStandardsIgnoreEnd\n $couponModel->setExpirationDate($expirationDate->toString('yyyy-MM-dd HH:mm'));\n } elseif ($rule->getToDate()) {\n $couponModel->setExpirationDate($rule->getToDate());\n }\n\n $couponModel->save();\n\n return $couponCode;\n }\n\n return false;\n }", "public function add_couponAction() {\r\n\t\t$couponCode = (string)$this->getRequest()->getPost('coupon_code', '');\r\n\t\t\t\t\r\n\t\t$quote = $this->getOnepage()->getQuote();\r\n\t\tif ($this->getRequest()->getParam('remove') == '1') {\r\n\t\t\t$couponCode = '';\r\n\t\t}\r\n\t\t\r\n\t\t$oldCouponCode = $quote->getCouponCode();\r\n\t\tif (!strlen($couponCode) && !strlen($oldCouponCode)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t$error = false;\r\n\t\t\t$quote->getShippingAddress()->setCollectShippingRates(true);\r\n\t\t\t$quote->setCouponCode(strlen($couponCode) ? $couponCode : '')\r\n ->collectTotals()\r\n ->save();\r\n\t\t\tif ($couponCode) {\r\n\t\t\t\tif ($couponCode == $quote->getCouponCode()) {\r\n\t\t\t\t\t$message = $this->__('Coupon code \"%s\" was applied.', Mage::helper('core')->htmlEscape($couponCode));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\t$message = $this->__('Coupon code \"%s\" is not valid.', Mage::helper('core')->htmlEscape($couponCode));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$message = $this->__('Coupon code was canceled.');\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Mage_Core_Exception $e) {\r\n\t\t\t$error = true;\r\n\t\t\t$message = $e->getMessage();\r\n\t\t}\r\n\t\tcatch (Exception $e) {\r\n\t\t\t$error = true;\r\n\t\t\t$message = $this->__('Cannot apply the coupon code.');\r\n\t\t}\r\n\t\t//reload HTML for review order section\r\n\t\t$reviewHtml = $this->_getReviewTotalHtml();\t\t\r\n\t\t$result = array(\r\n\t\t\t'error' => $error,\r\n\t\t\t'message' => $message,\r\n\t\t\t'review_html' => $reviewHtml\r\n\t\t);\r\n\t\t$this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t}", "public function run()\n {\n $defaultCoupon = [1];\n $coupons = [\n ['discount' => 10, 'description' => 'リリース記念10%Off!'],\n ];\n foreach($coupons as $coupon) {\n \\App\\Coupon::create($coupon);\n }\n }", "public function coupon()\n\t{\n\t\t$session = JFactory::getSession();\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t// Call coupon method of model to apply coupon\n\t\t$valid = $model->coupon();\n\t\t$cart = $session->get('cart');\n\t\t$this->modifyCalculation($cart);\n\t\t$this->_carthelper->cartFinalCalculation(false);\n\n\t\t// Store cart entry in db\n\t\t$this->_carthelper->carttodb();\n\n\t\t// If coupon code is valid than apply to cart else raise error\n\t\tif ($valid)\n\t\t{\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = JText::_('COM_REDSHOP_COUPON_CODE_IS_NOT_VALID');\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link, $msg);\n\t\t}\n\t}", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n \"coupon\" => [\"required\", \"unique:coupons,coupon\"],\n \"coupon_value\" => [\"required\", \"numeric\"],\n \"coupon_product_id\" => [\"nullable\", \"exists:products,id\"],\n \"coupon_howmany_uses\" => [\"nullable\", \"numeric\"],\n \"coupon_min_order_price\" => [\"nullable\", \"numeric\"],\n \"coupon_starts_at\" => [\"nullable\", \"date\"],\n \"coupon_ends_at\" => [\"nullable\", \"date\"],\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();\n }\n\n $starts_at = $request->coupon_starts_at;\n if(!$request->coupon_starts_at)\n $starts_at = now();\n\n $coupon = new Coupon;\n $coupon->coupon = $request->coupon;\n $coupon->value = $request->coupon_value;\n $coupon->product_id = $request->product_id;\n $coupon->creator_id = auth()->user()->id;\n $coupon->howmany_uses = $request->coupon_howmany_uses;\n $coupon->min_order_price = $request->coupon_min_order_price;\n $coupon->starts_at = $starts_at;\n $coupon->ends_at = $request->coupon_ends_at;\n $coupon->save();\n\n return redirect()->back();\n }", "public function create()\n {\n $this->cpAuthorize();\n }", "public function use(\\App\\Http\\Requests\\UseCoupon $request, CouponAction $couponAction){\n return response()->json(['coupon' => $couponAction->useCoupon($request->id, $this->user), 'error' => false], 200);\n }", "protected function createCodes($coupon)\n {\n if (rand(0, 1)) {\n $this->createNormalCode($coupon);\n } else {\n $this->createUniqueCodes($coupon);\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'type_rental_id' => 'required',\n 'type_coupon_id' => 'required',\n 'status_coupon_id' => 'required',\n 'number' => 'required',\n 'amount' => 'required',\n ]);\n\t\t$request['usecoupone']=0;\n Coupons::create($request->all());\n\n // get all the nerds\n $coupons = Coupons::all();\n\n return redirect()->route('admin.coupons.index')\n \t\t\t\t ->with('success','Coupon created successfully');\n }", "public function getCoupon()\n\t {\n\t $discount = $this->carObj->addSeasonDiscount();\n\t $discount = $this->carObj->addStockDiscount();\n\t \n\t return $coupon = \"Get {$discount}% off the price of your new car.\";\n\t }", "protected function create()\n {\n return $this->proxyStripeExceptions(function () {\n return Customer::create([\n 'email' => $this->user->email,\n 'metadata' => [\n 'first_name' => $this->user->first_name,\n 'last_name' => $this->user->last_name,\n ],\n ]);\n });\n }", "public function create()\n {\n return view('admin.discountCobons.add');\n }", "protected function _createCoupons($ruleId,array $couponData)\n\t{\n\t\t$rawCoupons = explode(\",\",$couponData[11]);\n\t\t$coupons = array_filter($rawCoupons);\n\t\t$couponExpiry = date('Y-m-d',strtotime($couponData[8]));\t\t\n\t\tforeach($coupons as $couponCode):\n\t\t\t$couponCode = trim($couponCode);\n\t\t\tif($couponCode!=''):\n\t\t\t\t$coupon = $this->_coupon->create();\n\t\t\t\t$coupon->setId(null);\n\t\t\t\t$coupon->setRuleId($ruleId);\n\t\t\t\t$coupon->setUsageLimit(intval($couponData[6]));\n\t\t\t\t//$coupon->setUsagePerCustomer(1);\n\t\t\t\t//$coupon->setTimesUsed($timesUsed);\n\t\t\t\t$coupon->setExpirationDate($couponExpiry);\n\t\t\t\t$coupon->setCreatedAt(time());\n\t\t\t\t$coupon->setType(\\Magento\\SalesRule\\Helper\\Coupon::COUPON_TYPE_SPECIFIC_AUTOGENERATED);\n\t\t\t\t$coupon->setCode($couponCode);\n\t\t\t\t$coupon->save();\n\t\t\tendif;\n\t\tendforeach;\t\t\n\t}", "public function testSingleCouponRedemption() {\n $coupons = $this->promotion->getCoupons();\n $coupon = reset($coupons);\n\n $this->drupalGet(Url::fromRoute('commerce_cart.page', [], ['query' => ['coupon_cardinality' => 1]]));\n // Empty coupon.\n $this->getSession()->getPage()->pressButton('Apply coupon');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->assertSession()->pageTextContains('Please provide a coupon code');\n\n // Non-existent coupon.\n $this->getSession()->getPage()->fillField('Coupon code', $this->randomString());\n $this->getSession()->getPage()->pressButton('Apply coupon');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->assertSession()->pageTextContains('The provided coupon code is invalid');\n\n // Valid coupon.\n $this->getSession()->getPage()->fillField('Coupon code', $coupon->getCode());\n $this->getSession()->getPage()->pressButton('Apply coupon');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->assertSession()->pageTextContains($coupon->getCode());\n $this->assertSession()->fieldNotExists('Coupon code');\n $this->assertSession()->buttonNotExists('Apply coupon');\n\n // Coupon removal.\n $this->getSession()->getPage()->pressButton('Remove coupon');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->assertSession()->pageTextNotContains($coupon->getCode());\n $this->assertSession()->fieldExists('Coupon code');\n $this->assertSession()->buttonExists('Apply coupon');\n }", "public function store(StoreCouponRequest $request)\n {\n //Input received from the request\n $input = $request->except(['_token']);\n //Create the model using repository create method\n $this->repository->create($input);\n //return with successfull message\n return redirect()->route('admin.coupons.index')->withFlashSuccess(trans('alerts.backend.coupons.created'));\n }", "public function actionCreate()\n {\n $model = new Kupons;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Kupons']))\n {\n $model->attributes = $_POST['Kupons'];\n\n\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id_kupon));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function addCoupon(CouponAbstract $coupon)\n {\n $this->coupons[] = $coupon;\n return $this;\n }", "public function create()\n {\n $lance = new Lance();\n }", "public function coupons()\n {\n return $this->morphMany(Checkout::couponModel(), 'customer');\n }", "public function create()\n {\n return view('company.currencies.create');\n }", "public function storeCoupon(Request $request)\n {\n // validate input of category name..\n $request->validate([\n 'coupon' => 'required|max:55|unique:coupons',\n 'discount' => 'required|numeric',\n ]);\n $data = array();\n $data['coupon'] = $request->coupon;\n $data['discount'] = $request->discount;\n $data['created_at'] = Carbon::now();\n DB::table('coupons')->insert($data);\n // Display a toaster message..\n $notification = array(\n 'message' => 'Coupon Inserted successfully.',\n 'alert-type' => 'success'\n );\n return Redirect()->back()->with($notification);\n }", "protected function createNormalCode($coupon)\n {\n $code = factory(Code::class)->make(['type' => ECodeType::NORMAL]);\n\n $coupon->codes()->create($code->toArray());\n }", "public function actionCreate()\n {\n $model = new ExerciseRuleCoupon();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'exercise_rule_id' => $model->exercise_rule_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(CouponRequest $request)\n {\n $this->model->create($request->validated());\n return redirect()->route($this->route)->withMessage(['type'=>'success','content'=>$this->message]);\n }", "protected function createDonorEntry()\n {\n $this->donor = new Donor;\n \n $this->donor->set('email', $this->data['email']);\n $this->donor->set('first_name', $this->data['first_name']);\n $this->donor->set('last_name', $this->data['last_name']);\n $this->donor->set('anonymity', $this->data['anonymity'] );\n $this->donor->set('hide_amount', $this->data['hide_amount'] );\n $this->donor->set('receipt_key', $this->receipt_key);\n \n $this->donor->create();\n }", "public function run()\n {\n foreach($this->coupons as $coupon){\n Coupon::create([\n 'campaign_id' => $coupon['campaign_id'],\n 'code' => $coupon['code'],\n 'is_activated' => false,\n ]);\n }\n }", "function tx_commercecoupons_lib(&$pObj){\r\n\t\t$this->init($pObj);\r\n\t}", "public function coupon() {\n return $this->belongsTo('Coupon', 'coupon_id');\n }" ]
[ "0.6911831", "0.6741546", "0.65726393", "0.65515625", "0.6523609", "0.64885324", "0.64301455", "0.63662714", "0.6265149", "0.6261297", "0.62600565", "0.6182279", "0.6180253", "0.61760104", "0.6162332", "0.6156909", "0.61242497", "0.6089394", "0.6064047", "0.5988931", "0.5979159", "0.59767777", "0.5962611", "0.59432364", "0.5938185", "0.59109026", "0.59061193", "0.5892152", "0.5887213", "0.5854692", "0.5755948", "0.57482827", "0.57402015", "0.57390857", "0.5733733", "0.5718293", "0.56972694", "0.56950974", "0.56668353", "0.5652239", "0.5587537", "0.5586007", "0.5578684", "0.55722255", "0.5554004", "0.5533642", "0.5533557", "0.551078", "0.54867893", "0.5478675", "0.5472645", "0.5469357", "0.54511803", "0.5447968", "0.54471475", "0.54343563", "0.5430334", "0.53928494", "0.5365154", "0.53544885", "0.5347252", "0.5346304", "0.5345679", "0.5344724", "0.53409016", "0.5337369", "0.5336588", "0.5327479", "0.5324292", "0.5297231", "0.5276056", "0.52678645", "0.52577806", "0.52230245", "0.5220929", "0.52181035", "0.52115154", "0.5191961", "0.5184359", "0.51648694", "0.51543605", "0.51529014", "0.51484823", "0.5144824", "0.5136222", "0.51267344", "0.5121177", "0.51210815", "0.5115622", "0.5113263", "0.51093423", "0.5105767", "0.51007307", "0.5089251", "0.5080363", "0.50796413", "0.50780284", "0.506267", "0.50522393", "0.5048746" ]
0.7282196
0
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "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) { date_default_timezone_set('Asia/Manila'); $user = Auth::user(); $trans_list_of_products = $request->input('trans_list_of_products'); $trans_list_of_products_decoded = json_decode($trans_list_of_products); $customer_details = $request->input('customer_details'); $customer_details_decoded = json_decode($customer_details); $sales_trans_no = $request->input('sales_trans_no'); $invoice_no = $request->input('invoice_no'); $total_quantity = $request->input('total_quantity'); $tax = $request->input('tax'); $accumulated_total = $request->input('accumulated_total'); $amount_tendered = $request->input('amount_tendered'); $change = $request->input('change'); $customer_if = $request->input('customer_if'); // 0 means existing customer, 1 meaning add customer foreach($trans_list_of_products_decoded as $tlpd) { $sales_trans_list = DB::table('tbl_sales_transaction_list')->insert( [ 'sales_transaction_list_id' => NULL, 'invoice_no' => $invoice_no, 'barcode_no' => $tlpd->barcode_no, 'quantity' => $tlpd->quantity, 'selling_price' => $tlpd->selling_price, 'total_amount' => $tlpd->amount, 'created_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))), 'updated_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))) ] ); } $sales_trans = DB::table('tbl_sales_transaction')->insert( [ 'sales_transaction_no' => NULL, 'invoice_no' => $invoice_no, 'admin_id' => $user->id, 'total_quantity' => $total_quantity, 'tax' => $tax, 'accumulated_total' => $accumulated_total, 'amount_tendered' => $amount_tendered, 'change' => $change, 'created_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))), 'updated_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))) ] ); if($customer_if === 0){ $customer_trans = DB::table('tbl_customers_transaction')->insert( [ 'customer_transaction_id' => NULL, 'customer_id' => $customer_details_decoded->customer_id, 'invoice_no' => $invoice_no, 'created_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))), 'updated_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))) ] ); }else{ $customer_add_id = DB::table('tbl_customer')->insertGetId( [ 'customer_id' => NULL, 'customer_name' => $customer_details_decoded->new_customer_name, 'customer_address' => $customer_details_decoded->new_customer_address, 'created_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))), 'updated_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))) ] ); $customer_trans = DB::table('tbl_customers_transaction')->insert( [ 'customer_transaction_id' => NULL, 'customer_id' => $customer_add_id, 'invoice_no' => $invoice_no, 'created_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))), 'updated_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))) ] ); } $res = DB::table('systemlogs')->insert( [ 'id' => NULL, 'users_id' => $user->id, 'from' => 'POINT OF SALE', 'activity' => 'INVOICE NO: '.$sales_trans_no.' RECORDED.', 'created_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))), 'updated_at' => date("Y-m-d H:i:s", strtotime(date("Y/m/d H:i:s"))) ] ); // dd($customer_details_decoded); echo $res; }
{ "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($id) { // }
{ "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($id) { // }
{ "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, $id) { // }
{ "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($id) { // }
{ "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
Lists a bowler with a given id
public function view($id) { $this->layout = false; $bowler = $this->Bowler->findById($id); $bowlerData['bowlers']['bowler'][] = $bowler['Bowler']; $this->set('bowlerData', $bowlerData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list_get($id) {\n\n //$id = $this->get('id');\n\n if (!$id) {\n\n $this->response(\"No item ID specified!\", 400);\n\n exit;\n }\n\n $list = $this->List_model->getListById($id);\n\n if ($list) {\n\n //$list = $this->appendItems($list);\n //Put owner's name instead of user ID\n //$list['owner'] = $this->User_model->getName($list['owner'])['name'];\n unset($list['owner']);\n\n $this->response($list, 200);\n\n exit;\n } else {\n\n $this->response(\"Invalid ID\", 404);\n\n exit;\n }\n }", "public function show($id)\n {\n return $this->send('GET', \"bills/{$id}\");\n }", "public function livre($id){\n\t\t$book = DB::select('select * from book where id = ?', [$id]);\n\t\treturn view('get_list', ['book' => $book]);\n\t}", "public function BooksLS($id){\n\t\t$url = 'http://192.168.1.5:8000/query/bookid/' . $id;\n\t\t$page = file_get_contents($url);\n\t\treturn response()->json(json_decode($page));\n\t}", "public function list_obrolan($id_kelas)\n {\n $response = $this->db->query(\"call group_kelas('list_obrolan','{$id_kelas}','','')\");\n $this->set_response($response, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code\n }", "public function show($id)\n {\n //\n return Brands::find($id);\n }", "public function show_list($p_obj_id)\n {\n $l_sql = 'SELECT isys_catg_relation_list__isys_obj__id__master, isys_catg_relation_list__isys_obj__id__slave, obj.isys_obj__isys_obj_type__id, obj.isys_obj__title AS title\n FROM isys_catg_relation_list\n INNER JOIN isys_obj AS obj ON isys_catg_relation_list__isys_obj__id__slave = obj.isys_obj__id\n INNER JOIN isys_obj AS relObj ON isys_catg_relation_list__isys_obj__id = relObj.isys_obj__id\n WHERE isys_catg_relation_list__isys_obj__id__master = ' . $this->m_dao_rel->convert_sql_id($p_obj_id) . '\n AND obj.isys_obj__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n AND isys_catg_relation_list__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n AND relObj.isys_obj__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n GROUP BY isys_catg_relation_list__isys_obj__id__slave ';\n\n $l_res = $this->m_dao_rel->retrieve($l_sql);\n\n while ($l_row = $l_res->get_row()) {\n if ($l_row[\"isys_catg_relation_list__isys_obj__id__master\"] == $p_obj_id &&\n (is_null($this->m_obj_arr) || !in_array($l_row[\"isys_catg_relation_list__isys_obj__id__slave\"], $this->m_obj_arr))) {\n if ($l_row[\"isys_obj__isys_obj_type__id\"] == defined_or_default('C__OBJTYPE__IT_SERVICE')) {\n $this->m_its_arr[$l_row[\"isys_catg_relation_list__isys_obj__id__slave\"]] = $l_row[\"title\"];\n }\n\n if (in_array($this->m_dao_rel->get_objTypeID($l_row['isys_catg_relation_list__isys_obj__id__slave']), $this->m_software_obj_types)) {\n $l_sql = 'SELECT isys_catg_relation_list__isys_obj__id\n FROM isys_catg_relation_list\n INNER JOIN isys_obj ON isys_obj__id = isys_catg_relation_list__isys_obj__id\n WHERE isys_catg_relation_list__isys_obj__id__master = ' . $this->m_dao_rel->convert_sql_id($p_obj_id) . '\n AND isys_catg_relation_list__isys_obj__id__slave = ' . $this->m_dao_rel->convert_sql_id($l_row['isys_catg_relation_list__isys_obj__id__slave']) . '\n AND isys_obj__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n AND isys_catg_relation_list__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n GROUP BY isys_catg_relation_list__isys_obj__id';\n\n $l_res_app = $this->m_dao_rel->retrieve($l_sql);\n\n while ($l_row_app = $l_res_app->get_row()) {\n $l_its_data = $this->m_dao_its_comp\n ->get_data(null, null, \"AND isys_connection__isys_obj__id = \" . $this->m_dao_rel->convert_sql_id($l_row_app[\"isys_catg_relation_list__isys_obj__id\"]), null, C__RECORD_STATUS__NORMAL)\n ->get_row();\n\n // Check in it service components\n if (isset($l_its_data['isys_obj__id']) &&\n $this->m_dao_rel->get_objTypeID($l_its_data['isys_obj__id']) == defined_or_default('C__OBJTYPE__IT_SERVICE')) {\n if (!array_key_exists($l_its_data['isys_obj__id'], $this->m_its_arr)) {\n $this->m_its_arr[$l_its_data['isys_obj__id']] = $l_its_data['isys_obj__title'];\n }\n }\n }\n }\n\n $this->m_obj_arr[] = $l_row[\"isys_catg_relation_list__isys_obj__id__slave\"];\n $this->new_recurse_relation($l_row[\"isys_catg_relation_list__isys_obj__id__slave\"], $p_obj_id);\n unset($this->m_obj_arr);\n }\n }\n\n return $this;\n }", "function listByID($id) {\n $select = $this->select();\n $select = $this->select()->where('id = ?', $id);\n $rows = $this->fetchAll($select);\n return $rows->toArray();\n }", "public function findById($id) {\n $clientdb = new ClientMoralRepository;\n \n $data['client'] = $clientdb->getClient($id);\n return $this->view->load(\"compte/listeSingle\", $data);\n }", "public function getBooks($id) {\n }", "public function show($id)\n {\n $bids = bids::with(['user','jobs'])->where('jobs_id', $id)->get();\n return json_encode($bids);\n }", "public function listing();", "public function findById($id)\n {\n return $this->bids->find($id);\n }", "public function show($id) {\n return JobsList::find($id);\n }", "public function show($id)\n {\n $debtor = Debtors_listings::find($id);\n if(is_null($debtor)){\n return response()->json(null,404);\n }\n $response = new Debtors_listingsResource(Debtors_listings::find($id), 200); // debtorslisting resource modifies the data being outputted to what you want it to show\n return response()->json($response, 200);\n }", "public function getBillet($id){\n $db = $this -> init();\n \n $request = $db -> prepare('SELECT * from posts where id = ?') or die(print_r($db->errorInfo()));\n $request -> execute(array($id));\n $billet = $request -> fetch();\n return $billet;\n }", "public function get($id)\n {\n return DB::table('bukus')->find($id);\n }", "function my_list()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['list'] = $this->_bid->my_list();\n\t\t\n\t\t$this->load->view('bids/my_list', $data);\n\t}", "public function buscarProdutoLoja($id){\n\n $produtoLojaDAO = new ProdutoLojaDAO();\n\n $list = $produtoLojaDAO::SelectById($id);\n\n return $list;\n }", "public function show($id)\n {\n return $this->commandBus->execute(new \\Sailr\\Item\\GetSingleItemCommand($id));\n }", "public static function getList($id) {\n $list = R::load('list', $id);\n return $list->id ? $list : null;\n }", "public function get($boletoID);", "public function show($id) {\n\treturn Band::find($id);\n }", "function getBreeding($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from breeding_tbl where breeding_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['breeding_id'];\n\n\t}\n\t$crud->disconnect();\n}", "function recuperer_produit_bsm($id){\n global $db;\n $i = array(\n 'id' => $id\n );\n $sql = \"SELECT * FROM bsm WHERE id=:id\";\n $req = $db->prepare($sql);\n $req-> execute($i);\n $results = array();\n while($rows = $req->fetchObject()){\n $results[] = $rows;\n }\n return $results;\n}", "public function index($id = null) {\n if ($id == null) {\n return JobsList::orderBy('id', 'asc')->get();\n } else {\n return $this->show($id);\n }\n }", "public function b_list($id)\n\t{\n\t\t$businesses_taken = $this->business->all();\n\n\n\t\t$businesses_minus = DB::table('businesses')\n ->join('members_businesses', function($join) use($id)\n {\n $join->on('businesses.id', '=', 'members_businesses.business_id')\n ->where('members_businesses.member_id', '=', $id);\n })\n ->get();\n\n $businesses = array();\n\n \techo \"<br>\";\n \t\n foreach ($businesses_taken as $b) {\n\t\t\t$found = false;\n\n\n\n \tforeach($businesses_minus as $bm){\n \t\t//echo \"Compare \" . $b->id . \" with \";\n \t\t//echo $bm->business_id;\n \t\t//found duplicate?\n \t\tif($b->id==$bm->business_id)\n \t\t\t$found=true;\n\n \t}\n \t//echo \"<br>\";\n \tif($found==false)\n \t\t$businesses[$b->id]=$b;\n \t//$businesses[$b->id]->id=$b->id;\n };\n\n \n\t\treturn View::make('businesses.list', compact('businesses'));\n\t}", "function listBillets(){ \n\t\t$billets = array();\n\n\t\t$bdd = new PDO('mysql:host=localhost;dbname=test;charset=utf8','root','',array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));\n\t\t$req = $bdd->query('SELECT * FROM billets ORDER BY date_creation DESC LIMIT 5');\n\t\t\n\t\twhile($billet = $req->fetch(PDO::FETCH_ASSOC)){\n\t\t\t$billets[] = $billet;\n\t\t}\n\t\t\n\t\treturn $billets ;\n\t}", "public function userList($id)\n {\n return app(UserList::class)($id);\n }", "function listar_historial_pedido($id){\n\t\tif (isset($_POST['buscar']))\n\t\t\t$_SESSION['buscar']=$_POST['buscar'];\n\t\t\n\t\t$sql=\"SELECT * FROM historial WHERE pertenece_his='$id' ORDER BY id_his ASC\";\n\t\t\n\t\t$consulta=mysql_query($sql);\n\t\t$num=1;\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['numero']=$num++;\n\t\t\t$resultado['fecha_his']=$this->convertir_fecha($resultado['fecha_his']);\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function bobot($id_bobot){\n\t\t$hasil = $this->db->where('id', $id_bobot)\n\t\t\t\t\t\t ->get('bobot');\n\t\tif($hasil->num_rows() > 0){\n\t\t\treturn $hasil->row();\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t}\n\t}", "public function show($id)\n {\n //\n return book::where('id', '=', $id)->get();\n }", "public function index($id)\n {\n $wishList = WishList::where('user_id',$id)->get();\n if ($wishList) {\n return success($wishList);\n } else {\n return error(400, 'Can not get item');\n }\n }", "public function load($id){\n\t\t$sql = 'SELECT * FROM recibo WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function show($id)\n {\n return Branch::find($id);\n \n\n }", "public function show($id)\n {\n return Lot::find($id);\n }", "public function listidAction() \n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if ($id > 0)\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = New AlbumTable($this->dbAdapter); \n // bucar id de parametro\n $datos = $d->getGeneral1(\"select idTdoc from t_tip_docontrol_i where id=\".$id);// Listado de formularios \n $d->modGeneral(\"delete from t_tip_docontrol_i where id=\".$id);// Listado de formularios \n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'i/'.$datos['idTdoc']);\n } \n }", "public function getList(){\n $bills = DB::table('bills')->select('*')->orderBy('id', 'DESC')->get();\n return view('admin.bill.list', compact('bills'));\n }", "public function book($id)\n {\n return $this->get(\"/books/{$id}\");\n }", "public function bidList(){\n $bids = Bid::orderBy('created_at','asc')->paginate(15);\n foreach ($bids as $b) {\n $username = Customer::find($b->user_id);\n $cash_card_name = CashCard::find($b->cash_card_id);\n if ($username !== null) {\n $username = $username->name;\n }\n if ($cash_card_name !== null) {\n $cash_card_name = $cash_card_name->name;\n }\n $b->username = $username;\n $b->cash_card_name = $cash_card_name;\n $card = ScratchCard::where('bid_id',$b->id)->first();\n if($card == null){\n $b->card_name = null;\n }else {\n $b->card_name = $card->name;\n }\n }\n return view('admin.bids.bid-list',[\n 'bids' => $bids\n ]);\n }", "public function get_blogs_by_id($id)\n { \n parent::con();\n\n $sql=sprintf(\"select * from blogs as b where b.id_blogs = %s;\",parent::comillas_inteligentes($id));\n\n $res=mysql_query($sql);\n while ($reg=mysql_fetch_assoc($res))\n {\n $this->blogi[]=$reg;\n }\n return $this->blogi;\n \n mysql_free_result($reg);\n \n }", "public function show($id)\n {\n $model_blesseur = new Blesseur();\n $blesseur=$model_blesseur->show_blesseur($$id);\n return $blesseur;\n\n }", "public function index($id)\n {\n $page = Page::find($id);\n foreach($page->blocs as $bloc){\n switch ($bloc->type){\n case 'file':\n case 'image':\n case 'video':\n\n\n $bloc->link = 'storage/bloc/'.$page->id.'/'.$bloc->type.'/'.$bloc->content;\n\n break;\n }\n }\n return response()->json($page);\n }", "function getbrands(){\n\t\n\tglobal $connection;\n\t\n\t$get_brands = \"select * from brands\";\n\t$run_brands = mysqli_query($connection, $get_brands);\n\twhile ($row_brands = mysqli_fetch_array($run_brands)){\n\t\t$brands_id = $row_brands['brand_id'];\n\t\t$brands_title = $row_brands['brand_title'];\n\t\t\n\techo \"<li><a href='index.php?brands=$brands_id'>$brands_title</a></li>\";\n\t\t\n\t}\n}", "public function lists($id)\n {\n $person = $this->modelPath::with('lists')->findOrFail($id);\n\n $availableLists = config('models.people_list', \\Bookkeeper\\CRM\\PeopleList::class)::all()\n ->diff($person->lists)\n ->pluck('name', 'id')\n ->toArray();\n\n return $this->compileView('people.lists', compact('person', 'availableLists'), $person->full_name);\n }", "static function show($id)\n {\n $respuestaBLL = new respuestaBLL();\n $objRespuesta = $respuestaBLL->select($id);\n if ($objRespuesta == null) {\n http_response_code(404);\n return;\n }\n echo json_encode($objRespuesta);\n }", "public function get_account_holder_list($id){\n\t\t$this->loadModel('ClientAccountHolder');\n\t\t$ac_holder = $this->ClientAccountHolder->find('all', array('fields' => array('User.id'),\n\t\t'order' => array('User.first_name ASC'), 'conditions' => array('ClientAccountHolder.clients_id' => $id, \n\t\t'User.is_deleted' => 'N')));\n\t\tforeach($ac_holder as $record){\n\t\t\t$users[] = $record['User']['id'];\n\t\t}\n\t\t$this->set('acholderList', $users);\n\t}", "public function getList()\n\t{\n\t\treturn $this->crud->orderby('id DESC')\n\t\t\t\t\t->read(10)\n\t\t;\t\n\t}", "public function allBoons() {\n\n // retrieve all Boons\n $boonModel = new Boon();\n $boonList = $boonModel->findAllBoons(); // array of objects\n\n // Send the datas to the view\n $this->show('boons', [\n 'boonList' => $boonList\n ]);\n }", "function listarPorId($id){\r\n\t\t$sql = 'CALL sp_se_idioma(\"AND u.id = '.$id.'\"); ';\r\n\t\t$arrResultado = $this->getArrayObjs(Conexao::executarSql($sql));\r\n\t\treturn $arrResultado;\r\n\t}", "public function getBillingItem($id)\n {\n// foreach ($table_order as $order) {\n// $arr = Order::where(['OID' => $order->OID, 'is_cancelled' => 0])->get();\n $sql = 'select * from order_descriptions where OID in (select oid from tbl_order where tbl_id=\"' . $id . '\" and is_cancelled=0 and IsBill=0)';\n $bills = DB::select($sql);\n return view('bill.partial_bill_item')->with(['bills' => $bills]);\n }", "public function getList($id=\"\",$pg){\n\t\t $purl = array();\n\t\tif(isset($_GET['url'])){\n\t\t\t\n\t\t\t$purl\t=\t$_GET['url'];\n\t\t\t$purl\t=\trtrim($purl);\n\t\t\t$purl\t=\texplode('/',$_GET['url']);\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\t$purl =null;\t\n\t\t}\n\t\tif(!isset($purl['2'])){\n\t\t\t$pn = 1;\n\t\t}else{\n\t\t$pn = $purl['2'];\n\t\t}\n\t\tglobal $database;\n\t\t$resultEmployee = $database->db_query(\"SELECT * FROM items\");\n\t\t$pagin = new Pagination();//create the pagination object;\n\t\t$pagin->nr = $database->dbNumRows($resultEmployee);\n\t\t$pagin->itemsPerPage = 20;\n\t\t\n\t\t$myitems = Items::find_by_sql(\"SELECT * FROM items \".$pagin->pgLimit($pn));\n\t\t\n\t\t\t$index_array =array( \"items\"=>$myitems,\n\t\t\t\t\t\t\t\"mypagin\"=>$pagin->render($pg));\n\t\t\t\t\t\t\treturn $index_array;\n\t\t\n\t\treturn $index_array;\n\t}", "static function get_word_lists_of_user($id) {\n global $con;\n $sql = \"\n \t\tSELECT `id`, `name`, `creator`, `comment`, `language1`, `language2`, `creation_time`\n \t\tFROM `list`\n \t\tWHERE `creator` = \".$id.\" AND `active` = 1\n ORDER BY `name` ASC;\";\n $query = mysqli_query($con, $sql);\n $result = array();\n while ($row = mysqli_fetch_assoc($query)) {\n array_push($result, self::get_word_list($id, $row['id'], false));\n }\n return $result;\n }", "public function getLivreById($id)\n {\n // En guise de test on passe à cette fonction l'id d'un bouquin qu'on a déjà et si la fonction renvoi rien, c'est qu'elle est bugguée\n $em = $this->getDoctrine()->getManager();\n $livre = $em->getRepository(book::class)->find($id);\n return $livre;\n }", "function get_ban_list($game_id) {\n\t\t//return $this->db->select('player.player_id', 'player.username', 'banned.ban_id_player', 'banned.ban_game', 'banned.ban_reason', 'banned.ban_date')->from('player', 'banned')->where(['player.player_id' => 'banned.ban_id_player'])->get();\n\t\treturn $this->db->select('p.player_id, p.username, b.*')->from('player p')->join('banned b', 'p.player_id = b.ban_id_player', 'LEFT')->where('b.ban_game = '.$game_id)->order_by('ban_date', 'DESC')->get();\n\t}", "public function index($id)\n {\n $data = [\n 'title' => trans('rating.admin.list_page_title'),\n 'sub_title' => '',\n 'icon' => 'fa fa-indent',\n 'url_delete_item' => '',\n ];\n\n $data['dataTr'] = [];\n\n $data['listTh'] = $this->returnListTh();\n $sort_order = request('sort_order') ?? 'id__desc';\n\n $keyword = request('keyword') ?? '';\n\n $arrSort = $this->returnSortArray();\n $reviews = StoreRatingService::getStoreReviews($id, $sort_order);\n\n $dataTmp = $reviews->paginate(20);\n $data['dataTr'] = $this->returnTableTr($dataTmp);\n $data['pagination'] = $dataTmp->appends(request()->except(['_token', '_pjax']))->links('admin.component.pagination');\n $data['result_items'] = trans('offers.admin.result_item', ['item_from' => $dataTmp->firstItem(), 'item_to' => $dataTmp->lastItem(), 'item_total' => $dataTmp->total()]);\n\n $data['menu_left'] = $this->returnLeftMenu();\n\n\n $optionSort = $this->returnSortArrayOptions($sort_order);\n\n $data['menu_sort'] = $this->returnMenuSort($optionSort);\n\n $data['script_sort'] = $this->returnScriptSort($id);\n\n\n return view('admin.screen.list')\n ->with($data);\n }", "public function show($id)\n {\n $list = $this->user->recipeLists()->find($id);\n\n if (!$list) {\n return response()->json([\n 'success' => false,\n 'message' => 'Sorry, list with id ' . $id . ' cannot be found'\n ]);\n }\n return $list;\n }", "public static function find($id) {\n\n $id = intval($id);\n $req = Db::getInstance()->prepare('SELECT * FROM boleto WHERE id = :id');\n // the query was prepared, now we replace :id with our actual $id value\n $req->execute(array('id' => $id));\n\n return BoletoDAO::popular($req->fetch());\n \n }", "public function getList($id)\n {\n $crawler = $this->request('GET', $this->baseUrl.'/list/'.$id);\n $listBy = $crawler->filterXPath('//div[@data-list-id=\"'.$id.'\"]/div[@class=\"byline\"]/a');\n\n $exportFile = $crawler->filterXPath('//div[contains(@class, \"see-more\")]/div[contains(@class, \"create\")]/div[@class=\"export\"]/a')->attr('href');\n $csvExport = file_get_contents($this->baseUrl.$exportFile);\n\n foreach (explode(\"\\n\", $csvExport) as $csvRow) {\n if (!isset($headers)) {\n // first row will ALWAYS be header unless csv is changed\n $headers = str_getcsv($csvRow);\n } elseif ($csvRow) {\n $data = str_getcsv($csvRow);\n foreach ($data as $key => $value) {\n $key = $headers[$key];\n if (in_array($key, $this->listReturnedFields)) {\n $temp[$key] = $value;\n }\n }\n\n if (isset($temp)) {\n $return[] = $temp;\n unset($temp);\n }\n }\n }\n\n return isset($return) ? array(\n 'listby' => $listBy->text(),\n 'list' => $return,\n ) : false;\n }", "public function list($id){\n try{\n $sql = 'select * from user where id_user = ? limit 1';\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n $result = $stm->fetch();\n\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $result = [];\n }\n return $result;\n }", "public function show($id)\n {\n //Nous n'utiliserons pas cette méthode car l'affichage s'executera sur l'index.\n }", "function getBreed($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from pigs_tbl where pig_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['breed'];\n\n\t}\n\t$crud->disconnect();\n}", "public function show($id)\n {\n $banners = Banner::find($id);\n return $banners;\n }", "public function list();", "public function list();", "public function list();", "public function show($id)\n\t{\n $beside = Beside::find($id);\n\t\t$beside->browse = $beside->browse + 1;\n\t\t$beside->save();\n//\t\t$besides = Beside::all();\n $data = compact('beside');\n \n\t\treturn View::make('detail.index', $data);\n\t}", "function __lst($bid){\r\n\t\tif( @$this->params['url']['keyword'] || @$this->params['url']['category'] ){\r\n\t\t\t$this->passedArgs = $this->data['Board'] = $this->params['url'];\r\n\r\n\t\t\tunset($this->data['Board']['url']);\r\n\t\t\tunset($this->passedArgs['url']);\r\n\t\t\t$this->params['named'] = $this->passedArgs;\t\t\r\n\t\t}else{\r\n\t\t\t$this->data['Board'] = $this->passedArgs;\t\t\r\n\t\t}\r\n\t\t$this->passedArgs[0] = $bid;\r\n\t\t\r\n\t\t$conditions = $this->create_conditions($bid);\r\n\t\t\r\n\t\t$rows = $this->paginate('Board',$conditions);\r\n\r\n\t\t\t\r\n\t\tif( ereg(\"L|T|G\",trim(@$this->params['url']['ls'])) ){\r\n\t\t\t$this->setup['list_style'] = trim($this->params['url']['ls']);\r\n\t\t}\r\n\r\n\t\t\r\n\t\t$datas = array();\r\n\t\tforeach($rows as $i=>$row){\r\n\t\t\t$datas[$i] = $row;\r\n\r\n\t\t\t$spacer = '';\r\n\t\t\tfor($depth = 0 ; $depth < $row['Board']['sort_depth']; $depth++){\r\n\t\t\t\t$spacer .= '&nbsp;&nbsp;';\r\n\t\t\t}\r\n\t\t\t$datas[$i]['Board']['spacer'] = $spacer;\r\n\t\t\t$datas[$i]['Board']['subject'] = strcut($row['Board']['subject'],$this->setup['maxlength']);\r\n\t\t\t$datas[$i]['Board']['crypt_userid']='';\r\n\t\t\tif( $row['Board']['userid'] )\r\n\t\t\t{\r\n\t\t\t\t$datas[$i]['Board']['crypt_userid'] = $this->Crypter->encrypt($row['Board']['userid'].'⇋'.time().'⇋'.$row['Board']['no']);\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t$datas[$i]['Fileattach'] = array();\r\n\t\t\t//파일\r\n\t\t\tif( $this->setup['use_file'] || eregi('T|G',$this->setup['list_style']) ){\r\n\r\n\t\t\t\tif( eregi('T|G',$this->setup['list_style']) ){\r\n\t\t\t\t\t$conditions = array(\r\n\t\t\t\t\t\t\t'plugin'=>'board',\r\n\t\t\t\t\t\t\t'parent_id'=>$row['Board']['no'],\r\n\t\t\t\t\t\t\t'deleted'=>null,\r\n\t\t\t\t\t\t\t'type RegExp'=>'^image',\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$limit = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$conditions = array(\r\n\t\t\t\t\t\t\t'plugin'=>'board',\r\n\t\t\t\t\t\t\t'parent_id'=>$row['Board']['no'],\r\n\t\t\t\t\t\t\t'deleted'=>null\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$limit = null;\r\n\t\t\t\t}\r\n\t\t\t\t$files = $this->Fileattach->find('first',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'conditions'=>$conditions,\r\n\t\t\t\t\t\t'fields'=>array('name','fsname'),\r\n\t\t\t\t\t\t'order'=>array('expose'=>'desc'),\r\n\t\t\t\t\t\t'limit'=>$limit\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\tif( @$files['Fileattach']['name'] ){\r\n\t\t\t\t\t$datas[$i]['Fileattach'] = $files['Fileattach'];\r\n\t\t\t\t\t$datas[$i]['Fileattach']['ext'] = $this->Fileattach->getFileExtension($files['Fileattach']['name']);\r\n\r\n\t\t\t\t\t//thumb 경로\r\n\t\t\t\t\t$folder = new Folder();\r\n\t\t\t\t\t$dir_thumb = APP.'webroot/files/board/'.$bid.'/thumb/';\r\n\r\n\r\n\t\t\t\t\t$folder->create($dir_thumb);\r\n\r\n\t\t\t\t\tif( $this->setup['list_style'] == \"T\" ){\r\n\t\t\t\t\t\tlist($w,$h) = explode('x',$this->setup['thumb_size_list']);\t\t\t\t\t\r\n\t\t\t\t\t\t$newImage = $bid.'_'.$w.'x'.$h.'_'.$datas[$i]['Fileattach']['fsname'];\r\n\t\t\t\t\t\tif( !file_exists($dir_thumb.$newImage) ){\r\n\t\t\t\t\t\t\t$this->Image->resizeImage('resizeCrop',APP.'webroot/files/board/'.$bid, $datas[$i]['Fileattach']['fsname'], $dir_thumb , $newImage,$w,$h);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}elseif( $this->setup['list_style'] == \"G\" ){\r\n\r\n\t\t\t\t\t\tlist($w,$h) = explode('x',$this->setup['thumb_size_gallery']);\r\n\t\t\t\t\t\t$newImage = $bid.'_'.$w.'x'.$h.'_'.$datas[$i]['Fileattach']['fsname'];\r\n\t\t\t\t\t\tif( !file_exists($dir_thumb.$newImage) ){\r\n\t\t\t\t\t\t\t$this->Image->resizeImage('resizeCrop',APP.'webroot/files/board/'.$bid, $datas[$i]['Fileattach']['fsname'], $dir_thumb, $newImage,$w,$h);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif( @$newImage ) $datas[$i]['Fileattach']['thumb'] = '/files/board/'.$bid.'/thumb/'.$newImage;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$datas[$i]['Fileattach']['ext'] = 'none';\r\n\t\t\t\t}\r\n\t\t\t}//end of files\r\n\t\t}\r\n\r\n//공지글\r\n\t\t$nrows = array();\r\n\t\tif( @$this->setup['use_notice'] ){\r\n\t\t\t$nrows = $this->Board->find('all',array(\r\n\t\t\t\t'conditions'=>array('Board.opt_notice'=>'1','Board.bid'=>$bid,'Board.deleted'=>null),\r\n\t\t\t\t'fields'=>array('Board.no',\r\n\t\t\t\t\t\t\t\t\t\t'Board.sort_depth',\r\n\t\t\t\t\t\t\t\t\t\t'Board.userid',\r\n\t\t\t\t\t\t\t\t\t\t'Board.email',\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t'Board.category',\r\n\t\t\t\t\t\t\t\t\t\t'Board.name',\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t'Board.subject',\r\n\t\t\t\t\t\t\t\t\t\t'Board.content',\r\n\t\t\t\t\t\t\t\t\t\t'Board.total_comment',\r\n\t\t\t\t\t\t\t\t\t\t'Board.hit',\r\n\t\t\t\t\t\t\t\t\t\t'Board.created',\r\n\t\t\t\t\t\t\t\t\t\t'BoardCategory.name',\r\n\t\t\t\t\t\t\t\t\t\t'User.profile'),\r\n\t\t\t\t'order'=>array('Board.created'=>'DESC')\r\n\t\t\t\t\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\tforeach($nrows as $Tkey=>$noti){\r\n\t\t\t\t$noti['Board']['crtypt_userid']='';\r\n\t\t\t\tif( $noti['Board']['userid'] )\r\n\t\t\t\t{\r\n\t\t\t\t\t$noti['Board']['crtypt_userid'] = $this->Crypter->encrypt($noti['Board']['userid'].'⇋'.time().'⇋'.$noti['Board']['no']);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$noti['Board']['subject'] = strcut($noti['Board']['subject'],$this->setup['maxlength']);\t\r\n\t\t\t\r\n\r\n\t\t\tif( $this->setup['use_file'] ){\r\n\t\t\t\t\t$conditions = array(\r\n\t\t\t\t\t\t\t'plugin'=>'board',\r\n\t\t\t\t\t\t\t'parent_id'=>$noti['Board']['no'],\r\n\t\t\t\t\t\t\t'deleted'=>null\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$limit = null;\r\n\t\t\t\t$files = $this->Fileattach->find('first',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'conditions'=>$conditions,\r\n\t\t\t\t\t\t'fields'=>array('name','fsname'),\r\n\t\t\t\t\t\t'limit'=>$limit\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\tif( @$files['Fileattach']['name'] ){\r\n\t\t\t\t\t$nrows[$Tkey]['Fileattach'] = $files['Fileattach'];\r\n\t\t\t\t\t$nrows[$Tkey]['Fileattach']['ext'] = $this->Fileattach->getFileExtension($files['Fileattach']['name']);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$nrows[$Tkey]['Fileattach']['ext'] = 'none';\r\n\t\t\t\t}\r\n\t\t\t}//end of files\r\n\r\n\t\t}\r\n\t}\r\n\t\t$this->set('nrows',$nrows);\r\n\t\t\t\r\n\t\t//동영상 타입인 경우 최근 게시물 하나 셋\r\n\t\tif( @$this->setup['list_style'] == 'M' ){\r\n\r\n\t\t\tif( empty($this->passedArgs['no']) ){\r\n\t\t\t\t$this->data = $this->Board->find('first',array('conditions'=>array('Board.deleted'=>null,'Board.bid'=>$bid),'order'=>array('Board.sort_no'=>'asc')));\r\n\t\t\t}else{\r\n\t\t\t\t$this->data = $this->Board->find('first',array('conditions'=>array('Board.deleted'=>null,'Board.bid'=>$bid,'Board.no'=>$this->passedArgs['no'])));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->set('rows',$datas);\t\r\n\t}", "function show(int $id);", "public function listidAction() \n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if ($id > 0)\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d=new AlbumTable($this->dbAdapter);\n\n $d->modGeneral(\"delete from a_empleados_rete_d where idEret=\".$id); \n $d->modGeneral(\"delete from a_empleados_rete where id=\".$id); \n //$u=new Retefuente($this->dbAdapter); // ---------------------------------------------------------- 5 FUNCION DENTRO DEL MODELO (C) \n //$u->delRegistro($id);\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n } \n }", "public function showByBanksoal($id)\n {\n $soal = Soal::where(['banksoal_id' => $id]);\n\n if (request()->q != '') {\n $soal = $soal->where('pertanyaan','LIKE', '%'.request()->q.'%');\n } \n\n $soal = $soal->paginate(10);\n return new SoalCollection($soal);\n }", "public function getAction(int $id): Response\n {\n return $this->handleView($this->view($this->blacklistItemManager->find($id)));\n }", "public function viewFinder($id)\n\t{\n\t\t$common_query = $this->controller_obj->get('app.common_queries');\n\t\t$row = $common_query->getRowFromTableWhereColumnValue($this->controller_obj, \"WebManagementBundle:writer\", \"id_writer\", $id);\n\t\t$row_array = array();\n\t\t$row_array[\"content\"] = \"<div>\".\"<strong> Id Writer: </strong>\".$row[0]->getIdWriter().\"</div>\n\t\t\t\t\t\t\t\t<div>\".\"<strong> First Name: </strong> \".$row[0]->getName().\"</div>\n\t\t\t\t\t\t\t\t<div>\".\"<strong> Last Name: </strong> \".$row[0]->getLastName().\"</div>\n\t\t\t\t\t\t\t\t<div>\".\"<strong> Country: </strong> \".$row[0]->getCountry().\"</div>\n\t\t\t\t\t\t\t\t<div>\".'<strong> Url Web: </strong> <a href = \"'.$row[0]->getWebUrl().'\">'.$row[0]->getWebUrl().\"</a></div>\n\t\t\t\t\t\t\t\t<div><strong> Description: </strong></div><div class = 'bg-content'>\".$row[0]->getDescription().\"</div>\";\n\t\t\n\t\treturn $row_array;\n\t}", "function get_by_id($id)\n {\n $this->db->select('*');\n $this->db->from('todolist');\n $this->db->where('id_todolist', $id);\n $data = $this->db->get();\n return $data;\n }", "public function show($id)\n {\n return response()->json(\\Auth::user()->checkLists()->findOrFail($id));\n }", "public function bills($id)\n {\n if(!$this->request->user->is_admin){\n\n if($this->request->user->id != $id) return response()->json([ \"errors\" => [\"permission denied\"] ], 403);\n }\n \n $bills = User::findOrFail($id)->bills();\n foreach ($bills as $bill) {\n $bill->project_id = $bill->project();\n $bill->user_id = $bill->user();\n $bill->payment_id = $bill->payment();\n }\n return $this->response(200,\"User\", $bills );\n\n }", "public function list($id)\n {\n $id = $this->is_digit($id);\n $course = Course::findOrFail($id);\n if ($course->evaluator == Auth::user()->id) {\n return view('courseperioditem.list', ['course' => $course, 'periods' => Courseperiod::where('course', $id)->orderBy('id', 'asc')->get(), 'items' => Courseitem::where('course', $id)->orderBy('scheme', 'asc')->get()]);\n }\n else {\n return redirect()->route('course_managed')->with('warning', 'Whoops! You\\'re unauthorized to access that page!');\n }\n\n }", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n $searchData['kind'] = 1;\n $searchData['login_user'] = $this->login_id;\n\n switch ($id) {\n case 1:\n $header = array(\"序号\", \"账号\", \"姓名\", \"角色\", \"新增时间\", \"操作\");\n $cols = 6;\n\n $contentList = $this->user_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有数据.\" : '';\n break;\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "public function index($id)\n {\n $id=$id;\n return view('admin.company.representative.list2',['id'=>$id]);\n }", "public function item($id)\n {\n return BusinessTrainer::where('id',$id)->with(['user', 'histories'])->first();\n \n }", "public function index($id = 0, $liste = 0)\n {\n $this->liste();\n }", "public function actionlistDescription($id=NULL)\n\t{\n\t\tif(!$this->isLogin()){\n\t\t\t$this->redirect('index');\n\t\t\texit;\n\t\t}\n\t\t$todoListObj\t=\tnew TodoLists();\n\t\t$inviteObj\t=\tnew Invites();\n\t\t$item\t=\t$todoListObj->getListDetails($id);\n\t\t$listMembers\t=\t$inviteObj->getListMembers($id);\n\t\t\n\t\t$this->renderPartial('listdescription', array('data'=>$item,'listMembers'=>$listMembers['users'],'pagination'=>$listMembers['pagination']));\n\t}", "public function show($id)\n\t{\n\t\t$banlist = $this->banlist->findOrFail($id);\n\n\t\treturn View::make('banlists.show', compact('banlist'));\n\t}", "public function getBookById($id) {\n\t\t$book = null;\n\n foreach ($this->db-> query(\"SELECT * FROM book WHERE id=$id\") as $row){\n \n $book = new Book($row['title'], $row['author'], $row['description'], $row['id']);\n }\n\n return $book;\n }", "public function show($id)\n {\n return Book::find($id);\n }", "public function show($id){\n\t\t//\n\t}", "public function show($id){\n\t\t//\n\t}", "public function show($id)\n {\n //\n if ($id === 'all'){\n $_artists = collect();\n Artist::orderBy('nick_name')->chunk(500, function ($artists) use ($_artists){\n foreach ($artists as $artist) {\n $_artists->push($artist);\n }\n });\n return $_artists;\n }\n }", "public function listb()\n\t{\n\t\t$id_usuario_session = $this->session->userdata(\"id\");\n\t\t$data = [\n\t\t 'monedas_mercado_busco' => $this->Mercadom_model->listb($id_usuario_session)\n\t\t];\n\n\t\t$this->layout->view(\"list_busqueda\",$data);\n\n\t}", "public function index($id = null) {\n \t$bands = Band::all();\n\treturn view('bands', ['bands' => $bands]);\n }", "public function show($id){\n //variabel a digunakan untuk menampilkan hasil\n $a = Booking::find($id);\n return $this->responseHasil(200,true,$a);\n \n }", "function get_borrowing_byID($voucher_id) {\r\n $params[0] = array(\"name\" => \":voucher_id\", \"value\" => &$voucher_id);\r\n return $this->DBObject->readCursor(\"product_actions.get_borrowing_byID(:voucher_id)\", $params);\r\n }", "public function listAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n $entities = $em->getRepository('BrasserieBundle:Brassin')->findBy([], ['lot' => 'ASC']);\r\n\r\n //$serializedEntities = $this->container->get('serializer')->serialize($entities, 'json');\r\n $serializer = SerializerBuilder::create()->build();\r\n //$serializedEntities = $serializer->serialize($entities, 'json', SerializationContext::create()->enableMaxDepthChecks());\r\n \r\n $serializedEntities = $serializer->serialize($entities, 'json', SerializationContext::create()->setGroups(array('list')));\r\n\r\n \r\n return new Response($serializedEntities);\r\n }", "public function getById($id) {\r\n $sql = \"SELECT * FROM bestelling inner join bestelregel on bestelregel.betellingid=bestelling.idwhere id=?\";\r\n $args = func_get_args();\r\n $stmt = parent::execPreppedStmt($sql, $args);\r\n $result = $stmt->fetch();\r\n foreach ($resultSet as $result) {\r\n $bestelling = Bestelling:: create($result['id'], $result['userid'], $result['tijdstip']);\r\n $bestelregel = Bestelregel:: create($result['bestelregelid'], $result['bestelregelprijs'], $bestelling);\r\n $arr[] = $bestelregel;\r\n }\r\n return $arr;\r\n }", "protected function getItems($id)\n\t{\n\t\t// SELECT aktualnich vazanych zaznamu\n\t\t$list = ORM::factory($this->orm_model)->where('`'.$this->parentColumn.'`='.$id);\n\t\tif(!empty($this->where)) $list->where($this->where);\n\t\tif(!empty($this->order)) $list->orderby($this->order, $this->order_direction);\n\t\treturn $list->find_all();\n\t}", "public function get($id) {\n $wishList = WishList::where(\"users_id\",$id)->with(\"product\")->get();\n return $wishList;\n }" ]
[ "0.67219615", "0.66445196", "0.66234434", "0.6579122", "0.63811845", "0.63753885", "0.6371353", "0.63317615", "0.62901664", "0.6266477", "0.6220397", "0.62024266", "0.61889267", "0.6181603", "0.6178872", "0.6130129", "0.6082913", "0.608169", "0.6056793", "0.6013368", "0.6011058", "0.59909546", "0.5976623", "0.596871", "0.59645027", "0.5963446", "0.5954213", "0.59536606", "0.59504044", "0.5922316", "0.59220046", "0.5896503", "0.5885698", "0.5884432", "0.586718", "0.586718", "0.586718", "0.586718", "0.5862193", "0.5857544", "0.58571756", "0.5853282", "0.58471954", "0.5836571", "0.58349496", "0.5808264", "0.5794698", "0.5792086", "0.57795674", "0.5776566", "0.57559586", "0.57542396", "0.57510614", "0.57472456", "0.5746169", "0.57395464", "0.5737278", "0.57294184", "0.5728042", "0.57270044", "0.57230335", "0.57191914", "0.57184446", "0.5706036", "0.56965804", "0.56956476", "0.568572", "0.5685349", "0.5685349", "0.5685349", "0.56843585", "0.56795496", "0.5676426", "0.56640905", "0.56632733", "0.56617564", "0.5660133", "0.56595105", "0.5657641", "0.56574774", "0.56572586", "0.5654352", "0.5649873", "0.5649689", "0.56419265", "0.56379294", "0.5637429", "0.56368005", "0.5626552", "0.56236935", "0.56236935", "0.5622573", "0.5614887", "0.5610799", "0.5606322", "0.56020117", "0.5600725", "0.56002945", "0.55973387", "0.5595144" ]
0.6333744
7
run the sql from file
public function run() { $this->runQueriesFromSqlFile('1.3.4.3'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n $filename = __DIR__ . DS . 'other_thirdcode.sql';\n $content = file_get_contents($filename);\n $rows = explode(PHP_EOL,$content);\n foreach($rows as $row){\n\t\t\t$ret1 = preg_match('/^insert/', $row);\n if($ret1>0){\n $ret = db()->execute($row);\n }\n }\n\n }", "function exec_file($src_file) {\n if (file_exists($src_file)) {\n $info = pathinfo($src_file);\n if ($info[\"extension\"] == \"sql\") {\n\t\t\t\t$sqlContent = file_get_contents($src_file);\n\t\t\t\t$parser = new MySqlparser;\n\t\t\t\t$sqls = $parser->getSqlQueries($sqlContent); // individual queries\n\t\t\t\tforeach ($sqls as $sql) {\n\t\t\t\t\t$sql = trim($sql); // skip empty lines\n\t\t\t\t\tif ($sql) {\n\t\t\t\t\t\t$ret = $this->mysqli->query($sql);\n\t\t\t\t\t\tif (!$ret) {\n\t\t\t\t\t\t\techo \"$src_file: Failed query:\\n$sql\\n\";\n\t\t\t\t\t\t\techo $this->mysqli->error . PHP_EOL;\n\t\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn TRUE;\n }\n }\n\t\treturn FALSE;\n }", "public function run()\n {\n $sql_file = public_path('4farh_ecom_world.sql');\n\n $db = [\n 'host' => '127.0.0.1',\n 'database' => '4farh_ecom',\n 'username' => 'root',\n 'password' => null,\n ];\n\n exec(\"mysql --user={$db['username']} --password={$db['password']} --host={$db['host']} --database={$db['database']} < $sql_file \");\n }", "public function runFile($path)\n\t{\n\t\ttry{\n\t\t\tif(!($sql = file_get_contents($path)))\n\t\t\t\tthrow new DatabaseConnectionNotice('SQL file not found at ' . $path);\n\n\t\t\tif($this->multi_query($sql))\n\t\t\t{\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif($result = $this->store_result())\n\t\t\t\t\t\t$result->free();\n\t\t\t\t}while($this->more_results() && $this->next_result());\n\t\t\t}else{\n\t\t\t\t$this->throwError();\n\t\t\t}\n\t\t\treturn true;\n\t\t}catch(Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}", "function importSql($file) {\n // Reading SQL from file\n echo \"Reading SQL from file '\" . $this->importFilename . \"': \";\n if($this->compress) {\n $lines = gzfile($file);\n } else {\n $lines = file($file);\n }\n echo \" DONE!\\n\";\n\n echo \"Importing SQL into database '\" . $this->database . \"': \";\n $x = 0;\n $importSql = \"\";\n $procent = 0;\n foreach($lines as $line) {\n // Print progress\n $x++;\n $numOfLines = count($lines);\n if($x % (int) ($numOfLines / 20) == 0) {\n $procent += 5;\n if($procent % 25 == 0)\n echo \"$procent%\";\n else\n echo \".\";\n }\n\n // Importing SQL\n $importSql .= $line;\n if(substr(trim($line), strlen(trim($line)) - 1) == \";\") {\n $query = @mysql_query($importSql, $this->connection);\n if(!$query)\n return false;\n $importSql = \"\";\n }\n }\n return true;\n }", "public function execute($file){\n\t\t$errorFound = false;\n\n\t\t$log = $this->getLoger();\n\n\t\t$query = current($this->_queries);\n\t\t$queryCount = count($this->_queries);\n\n\t\twhile ($query !== false && $errorFound == false) {\n\t\t\t$log->log($query['comment'], 6);\n\n\t\t\tif ($query['option'] == 'begin_transaction') {\n\t\t\t\t$this->getConnection()->beginTransaction();\n\t\t\t} elseif($query['option'] == 'use_passthru') {\n\t\t\t\t$this->executePassthruQuery($query['sql']);\n\t\t\t} elseif($query['option'] == 'show_results') {\n\t\t\t\t$this->executeQueryShowResults($query['sql']);\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t$this->executeQuery($query['sql']);\n\t\t\t\t} catch (Zend_Db_Statement_Exception $e) {\n\t\t\t\t\t$log->log('Mysql Error Code is: ' . $e->getCode(), 2);\n\t\t\t\t\t$log->log(\"CallStack \" . PHP_EOL . $e->getMessage(), 2);\n\t\t\t\t\tMage::log('Mysql Error Code is: ' . $e->getCode(), 2, 'sqlerrors.log');\n\t\t\t\t\tMage::log(\"CallStack \" . PHP_EOL . $e->getMessage(), 2, 'sqlerrors.log');\n\t\t\t\t\t$errorFound = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$log->log((1 + key($this->_queries)) . '/' . $queryCount . ' queries', 6);\n\t\t\t$log->log('SQL query', 6);\n\t\t\t$query = next($this->_queries);\n\t\t}\n\n\t\tif ($errorFound !== true) {\n\t\t\t$log->log('Import successful. Committing SQL queries...' . PHP_EOL, 6);\n\t\t\t$this->getConnection()->commit();\n\t\t\tTC_Import_Model_Product_Fs::markProcessed($file);\n\t\t\t$this->getConnection()->query('DROP TABLE IF EXISTS ' . $this->_table . ';');\n\t\t} else {\n\t\t\t$log->log('En error has occured. Rolling back SQL queries...' . PHP_EOL, 1);\n\t\t\t$this->getConnection()->rollback();\n\t\t\t$this->getConnection()->query('DROP TABLE IF EXISTS ' . $this->_table . ';');\n\t\t\tTC_Import_Model_Product_Fs::markError($file);\n\t\t\tdie('ERROR');\n\t\t}\n\n\t\treturn !$errorFound;\n\t}", "public function execSqlFile($fileName)\n {\n $filePath = realpath(PATH . '/' . $this->getConfig()->path) . '/' . $fileName;\n\n if (!is_file($filePath)) {\n throw new Exception (\"SQL file '\" . $fileName . \"' not exists\");\n }\n\n $sql = file_get_contents($filePath);\n\n if (empty($sql)) {\n throw new Exception (\"SQL file '\" . $fileName . \"' empty\");\n }\n\n $this->getDBAdapter()->beginTransaction();\n try {\n if (!$this->getDBAdapter()->query($sql)) {\n $errorInfo = $this->getDBAdapter()->errorInfo();\n throw new Exception(\n $errorInfo[0] . ' [' . $errorInfo[1] . '] ' . $errorInfo[2]\n );\n }\n\n $this->getDBAdapter()->commit();\n\n return true;\n } catch (Exception $e) {\n $this->getDBAdapter()->rollback();\n throw new Exception($e->getMessage());\n }\n }", "public function run()\n {\n exec(\"mysql -u \" . config('database.connections.mysql.username') . \" -p\" . config('database.connections.mysql.password') . \" \" . config('database.connections.mysql.database') . \" < \" . getcwd() . \"/database/hadith.sql\");\n }", "abstract public function exec($sql);", "public function run()\n {\n $sql = file_get_contents(database_path() . '/seeders/countries-all.sql');\n\n DB::statement($sql);\n }", "function exec($sql);", "static function parseSQL($ignoreerrors = false, $file = false)\n {\n $dbo = Pommo::$_dbo;\n $logger = Pommo::$_logger;\n\n if (!$file)\n {\n $file = Pommo::$_baseDir.'sql/sql.schema.php';\n }\n\n $file_content = @file($file);\n if (empty($file_content))\n {\n Pommo::kill('Error installing. Could not read '.$file);\n }\n $query = '';\n foreach ($file_content as $sql_line)\n {\n $tsl = trim($sql_line);\n if (($sql_line != \"\")\n && (substr($tsl, 0, 2) != \"--\")\n && (substr($tsl, 0, 1) != \"#\"))\n {\n $query .= $sql_line;\n if (preg_match(\"/;\\s*$/\", $sql_line))\n {\n $matches = array();\n preg_match('/:::(.+):::/', $query, $matches);\n if ($matches[1])\n {\n $query = preg_replace('/:::(.+):::/', $dbo->table[$matches[1]], $query);\n }\n $query = trim($query);\n if (!$dbo->query($query) && !$ignoreerrors)\n {\n $logger->addErr(Pommo::_T('Database Error: ').\n $dbo->getError());\n return false;\n }\n $query = '';\n }\n }\n }\n return true;\n }", "function Import() {\n // Fichier sql\n $filename = 'http://localhost/alumnus/alumnus.sql';\n\n // Connexion\n $bdd = new PDO('mysql:host=localhost; dbname=alumnus', 'root', '');\n // Variable temporaire stockant la requête (ligne par ligne)\n $templine = '';\n // Lecture entière du fichier\n $lines = file($filename);\n // Boucle à travers chaque ligne\n foreach ($lines as $line){\n // Passage à la ligne suivante si c'est un commentaire ('--' et '/* */') ou si la ligne est vide\n if (substr($line, 0, 2) == '--' || substr($line, 0, 2) == '/*' || $line == '')\n continue;\n\n // Ajout ou concaténation de la ligne au segment actuel\n $templine .= $line;\n // Détection de fin de ligne avec le point-virgule\n if (substr(trim($line), -1, 1) == ';') {\n // Exécution de la requête\n $bdd->exec($templine);\n // Réinitialisation de la variable temporaire\n $templine = '';\n }\n }\n\n // Déconnexion\n $bdd = null;\n}", "public function execute()\n {\n $this->readFile();\n\n # Generate the SQL file\n $this->generateSQLFile();\n\n #close the log file\n $this->closeFile();\n }", "public function SQLexecute($fileName, $criteria)\n {\n \n $filePath = $this->queryDirectory.$fileName.'.sql';\n $sql = file_get_contents($filePath);\n foreach ($criteria as $key => $value)\n {\n if(strpbrk($sql, $key))\n {\n $sql = str_replace($key, $value, $sql);\n }\n else \n {\n echo 'error! no key found for replacement';\n\n }\n\n }\n $operation = substr($fileName, 0, 1);\n\n switch ($operation) {\n case 'I':\n $result = $this->Insert($sql);\n break;\n case 'S':\n $result = $this->Select($sql);\n break;\n case 'U':\n $result = $this->Update($sql);\n break;\n case 'R':\n $result = $this->Replace($sql);\n break;\n case 'D':\n $result = $this->Delete($sql);\n break;\n case 'Q':\n $result = $this->Query($sql);\n break;\n\n default://error~~!\n break;\n\n }\n return $result;\n \n }", "public function run()\n {\n City::unguard();\n DB::unprepared(file_get_contents(base_path('cities.sql')));\n }", "public function actionExeSql()\n {\n //$mysql->runSql($sql);\n }", "private static function query($file, $replace, $sanitize = false){\n\t\tif (!self::$connection) {\n\t\t\tself::connect();\n }\n \n if ($sanitize) {\n $replace = self::sanitizeReplace($replace);\n }\n\n $query = file_get_contents(__DIR__.\"/sql/$file\");\n $query = strtr($query, $replace);\n $stm = self::$connection->prepare($query);\n\t\t$stm->execute();\n\t\treturn $stm->fetchAll(PDO::FETCH_ASSOC);\n }", "protected function importSQL($file,$database,$db_prefix) {\n $errors = array();\n $import = file_get_contents($file);\n\n # $import = preg_replace( \"%/\\*(.*)\\*/%Us\", '' , $import );\n # $import = preg_replace( \"%^--(.*)\\n%mU\" , '' , $import );\n # $import = preg_replace( \"%^$\\n%mU\" , '' , $import );\n $import = str_ireplace( \"%prefix%\" , $db_prefix , $import );\n $import = preg_replace( \"%\\r?\\n%\" , '' , $import );\n $import = str_replace ( '\\\\\\\\r\\\\\\\\n' , \"\\n\" , $import );\n $import = str_replace ( '\\\\\\\\n' , \"\\n\" , $import );\n\n // split into chunks\n $sql = preg_split(\n '~(insert\\s+(?:ignore\\s+)into\\s+|replace\\s+into\\s+|create\\s+table|truncate\\s+table|\\/\\*\\!)~i',\n $import,\n -1,\n PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY\n );\n\n if(!count($sql) || !count($sql)%2)\n return false;\n\n // index 1,3,5... is the matched delim, index 2,4,6... the remaining string\n $stmts = array();\n for($i=0;$i<count($sql);$i++)\n $stmts[] = $sql[$i] . $sql[++$i];\n\n foreach ($stmts as $imp){\n if ($imp != '' && $imp != ' ') {\n $fh = fopen(__DIR__.'/sql.log','a');\n fwrite($fh,$imp);\n fwrite($fh,\"\\n----- result: \". implode(\" | \",$database->errorInfo()).\"-----\\n\");\n fwrite($fh,\"\\n----------------------------------------------------------------\\n\");\n fclose($fh);\n $ret = $database->exec($imp);\n }\n }\n return ( count($errors) ? false : true );\n }", "function execute_sql($fileName, $db, $utf8_ok) {\r\n\r\n\t@set_time_limit(120);\r\n\r\n\t// read the data\r\n\t$fd = @fopen ($fileName, 'r');\r\n\tif ($fd === false) {\r\n\t\tshow_error(\"Unable to open SQL file '$fileName'\");\r\n\t}\r\n\t$data = fread($fd, filesize ($fileName));\r\n\tfclose($fd);\r\n\r\n\t// split into separate statements\r\n\t$queries = splitSql($data);\r\n\r\n\t// execute each statement\r\n\tforeach ($queries as $sql) {\r\n\t\t$sql = trim($sql);\r\n\r\n\t\t// skip comments\r\n\t\tif (empty($sql) || $sql[0] == '#' || substr($sql,0,2) == '--') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// set table prefix\r\n\t\t$sql = str_replace('[prefix]', MYSQLPREFIX, $sql);\r\n\r\n\t\t// if database doesn't support utf8, remove the character set declaration\r\n\t\tif (!$utf8_ok) {\r\n\t\t\t$sql = str_replace(' DEFAULT CHARACTER SET utf8', '', $sql);\r\n\t\t}\r\n\r\n\t\t// execute the statement and handle errors\r\n\t\t$result = $db->query($sql);\r\n\t\tif ($db->isError($result)) {\r\n\t\t\tif ($result->code == MDB2_ERROR_ALREADY_EXISTS) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\treturn array('info' => $result->userinfo, 'message'=> $result->message, 'code'=> $result->code );\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "public function run()\n {\n Ward::unguard();\n if(!Ward::find(1)) {\n $path = __DIR__.'/sql-script/ward.sql';\n DB::unprepared(file_get_contents($path));\n //$this->command->info('Country table seeded!');\n }\n }", "function exec_sql_lines($sql_file, $old_string='', $new_string='') {\r\nglobal $php_stats_error;\r\n $error_lev=0;\r\n $sql_query=isset($sql_query) ? $sql_query : \"\";\r\n\r\n if(!empty($sql_file) && $sql_file != \"none\") {\r\n $sql_query=fread(fopen($sql_file, \"r\"), filesize($sql_file));\r\n /* If magic_quotes_runtime is enabled, most functions that return data from any sort of external source\r\n including databases and text files will have quotes escaped with a backslash.\r\n */\r\n if(get_magic_quotes_runtime() == 1) $sql_query=stripslashes($sql_query);\r\n /* replace old_string with new_string if they are set */\r\n if($old_string != '') {\r\n $sql_query=ereg_replace($old_string,$new_string,$sql_query);\r\n }\r\n }\r\n $sql_query=trim($sql_query);\r\n\r\n if($sql_query != \"\") {\r\n $sql_query =remove_remarks($sql_query);\r\n $pieces =split_sql_file($sql_query,\";\");\r\n $cnt_pieces =count($pieces);\r\n /* run multiple queries */\r\n for ($i=0; $i<$cnt_pieces; ++$i) {\r\n $sql=trim($pieces[$i]);\r\n if(!empty($sql) and $sql[0] != \"#\")\r\n {\r\n $result=sql_query($sql);\r\n if($result==false)\r\n {\r\n $php_stats_error.=\"<font color=\\\"#FF0000\\\" size=\\\"1\\\">Error executing: <b>$sql</b><br>Error string: <b>\".mysql_error().\"</b></font><br><br>\";\r\n $error_lev=1;\r\n }\r\n }\r\n }\r\n }\r\n if($error_lev==0)\r\n return true;\r\n else\r\n return false;\r\n}", "public function run()\n {\n if (!DB::table('users')->count()) {\n DB::unprepared(file_get_contents(__DIR__ . '/sql/elms_users.sql'));\n }\n }", "function importFromSQLFile($Path) {\n\t\t$templine = ''; // Temporary variable, used to store current query\n\t\t$lines = file($Path); // Read in entire file\n\t\tforeach ($lines as $line) {\n\t\t\tif (substr($line, 0, 2) == '--' || $line == '') continue; // Skip it if it's a comment\n\t\t\t$templine .= $line; // Add this line to the current segment\n\t\t\tif (substr(trim($line), -1, 1) == ';') { // If it has a semicolon at the end, it's the end of the query\n\t\t\t mysql_query($templine) or print('Error performing query \\'' . $templine . '\\': ' . mysql_error().PHP_EOL); // Perform the query\n\t\t\t $templine = ''; // Reset temp variable to empty\n\t\t\t}\n\t\t}\n\t}", "function serendipity_parse_sql_inserts($filename) {\n $queries = array();\n\n $fp = fopen($filename, 'r', 1);\n if ($fp) {\n while (!@feof($fp)) {\n $line = trim(fgets($fp, 65536));\n if (preg_match('#^insert\\s*into.*;$#i', $line)) {\n array_push($queries, $line);\n }\n }\n }\n fclose($fp);\n\n return $queries;\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 importSql($pathAndFilename) {\n\t\t$sql = file($pathAndFilename, FILE_IGNORE_NEW_LINES & FILE_SKIP_EMPTY_LINES);\n\n\t\t\t// Remove MySQL style key length delimiters (yuck!) if we are not setting up a MySQL db\n\t\tif ($this->pdoDriver !== 'mysql') {\n\t\t\t$sql = preg_replace('/\"\\([0-9]+\\)/', '\"', $sql);\n\t\t}\n\n\t\t$statement = '';\n\t\tforeach ($sql as $line) {\n\t\t\t$statement .= ' ' . trim($line);\n\t\t\tif (substr($statement, -1) === ';') {\n\t\t\t\t$this->databaseHandle->query($statement);\n\t\t\t\t$statement = '';\n\t\t\t}\n\t\t}\n\t}", "abstract public function installSQL();", "function serendipity_parse_sql_tables($filename) {\n $in_table = 0;\n $queries = array();\n\n $fp = fopen($filename, 'r', 1);\n if ($fp) {\n while (!@feof($fp)) {\n $line = trim(fgets($fp, 4096));\n if ($in_table) {\n $def .= $line;\n if (preg_match('/^\\)\\s*(type\\=\\S+|\\{UTF_8\\})?\\s*\\;$/i', $line)) {\n $in_table = 0;\n array_push($queries, $def);\n }\n } else {\n if (preg_match('#^create table \\{PREFIX\\}\\S+\\s*\\(#i', $line)) {\n $in_table = 1;\n $def = $line;\n }\n\n if (preg_match('#^create\\s*(\\{fulltext\\}|unique|\\{fulltext_mysql\\})?\\s*index#i', $line)) {\n array_push($queries, $line);\n }\n }\n }\n fclose($fp);\n }\n\n return $queries;\n}", "function mysql_import_file($filename, $SQL_query) { \r\n\tglobal $errmsg;\r\n // lecture du fichier\r\n\t$SQL_query = array($SQL_query);\r\n\r\n\tif( substr($filename, 0, 7) == 'http://' ) {\r\n\t\t//Important sinon warning avec mod_security sur serveur check - 25-03-2011\r\n\t\t$opts = array(\r\n\t\t\t'http'=> array(\r\n\t\t\t'method'=> \"GET\",\r\n\t\t\t'header'=> 'Accept: text/html',\r\n\t\t\t'user_agent'=> 'allmystats'\r\n\t\t\t\t\t)\r\n\t\t\t\t); \r\n\t\t$ctx = stream_context_create($opts);\r\n\t}\r\n\r\n\tif(!@file($filename, FILE_SKIP_EMPTY_LINES, $ctx)) { //FILE_SKIP_EMPTY_LINES ou 0\r\n\t\t$errmsg = \"Cannot open file $filename\"; \r\n\t\treturn false; \r\n\t} else {\r\n\t\t$lines = file($filename);\r\n\t}\r\n\t$lines = array_merge ($SQL_query, $lines);\r\n\r\n $scriptfile = false; \r\n // Get rid of the comments and form one jumbo line \r\n foreach($lines as $line) {\r\n $line = (trim($line)); \r\n\r\n\t if(substr($line, 0, 2) <> '--') { //if the line does not begin with --\r\n\t\t $scriptfile .= \" \" . $line; \r\n } \r\n } \r\n\r\n if(!$scriptfile) {\r\n $errmsg = \"no text found in\". $filename; \r\n return false; \r\n } \r\n\r\n // Split the jumbo line into smaller lines \r\n $queries = explode(chr(10), $scriptfile); // chr(10) ou \"\\n\"\r\n \r\n // Run each line as a query \r\n foreach($queries as $query) {\r\n $query = trim($query); \r\n \r\n\t if(trim($query) == \"\") { continue; } \r\n\r\n if(!mysql_query($query.';')) { \r\n $errmsg = \"query \".$query.\" failed\"; \r\n return false; \r\n } \r\n } \r\n\r\n //return true;\r\n return $errmsg; \r\n }", "private function importProccess(Request $sqlFile)\n {\n \tset_time_limit(3000);\n\n $sqlFileContent = $this->sqlFileRequest($sqlFile);\n\n $allLines \t= explode(\"\\n\", $sqlFileContent);\n\n $setkey \t\t= DB::statement('SET foreign_key_checks = 0');\n\n preg_match_all(\"/\\nCREATE TABLE(.*?)\\`(.*?)\\`/si\", \"\\n\" . $sqlFileContent, $targetTables);\n\n foreach ($targetTables[2] as $table) {\n\n DB::statement('DROP TABLE IF EXISTS ' . $table);\n }\n\n $setutf \t= DB::statement(\"SET NAMES 'utf8'\");\n\n // Temporary variable, used to store current query\n $templine \t= ''; \n\n // Loop through each line\n foreach ($allLines as $line) {\n\n if (substr($line, 0, 2) != '--' && $line != '') {\n\n \t// (if it is not a comment..) Add this line to the current segment\n $templine .= $line; \n\n if (substr(trim($line), -1, 1) == ';') {\n\n // If it has a semicolon at the end, it's the end of the query\n try {\n\n \tDB::statement($templine);\n\n } catch (\\Exception $e) {\n\n \tdie('Error performing query \\'<strong>' . $templine . '\\': ' . $e . '<br /><br />');\n\n }\n\n $templine = ''; \n }\n }\n }\n\n return back()->withSuccess('Restore Database Berhasil!');\n }", "public function actionRun() {\n exec(\"mysql.exe --protocol=tcp --host=localhost --user=db2774_admin --password=\\\"y?H98D8ML!\\\" --port=3306 --default-character-set=utf8 --comments --database=swiftlp_staging < \\\"C:\\\\Users\\\\laced\\\\Documents\\\\dumps\\\\lastBackup.sql\\\"\");\n\n }", "public static function run($file, $table)\n {\n try\n {\n //==========================================================================================================\n //Attempt to open the text file and, if successful, loop through the entries in the text file and insert the\n //default data into the table\n //==========================================================================================================\n $file = fopen((getcwd() . $file), \"r\") or die(\"Unable to open file \" . $file);\n if(!feof($file)) {\n $header = trim(fgets($file));\n while(strpos($header, \"#\") !== false){\n $header = trim(fgets($file));\n }\n $header = explode(\"|\", $header);\n }\n\n while (!feof($file))\n {\n $data = trim(fgets($file));\n\n //======================================================================================================\n //Ignore comments (#) and process the file.\n //======================================================================================================\n if (strlen($data) > 0)\n {\n $data = explode(\"|\", $data);\n if (count($header)==2)\n {\n DB::table($table)->insert([trim($header[0]) => trim($data[0]),\n trim($header[1]) => trim($data[1])]);\n }elseif(count($header)==3){\n DB::table($table)->insert([trim($header[0]) => trim($data[0]),\n trim($header[1]) => trim($data[1]),\n trim($header[2]) => trim($data[2])]);\n }\n }\n }\n }\n finally\n {\n fclose($file);\n }\n }", "function restoreDB($sqlfile)\n {\n $this->error = \"\";\n $this->_connect();\n \n if(!is_file($sqlfile))\n {\n $this->error=\"Error : Not a valid file.\";\n return false;\n }\n \n $lines=@file($sqlfile);\n if(!is_array($lines))\n $uploadMsg= \"Sql File is empty.\";\n else\n {\n foreach($lines as $line)\n {\n $sql.=trim($line);\n if(empty($sql))\n {\n $sql=\"\";\n continue;\n }\n elseif(preg_match(\"/^[#-].*+\\r?\\n?/i\",trim($line)))\n {\n $sql=\"\";\n continue;\n }\n elseif(!preg_match(\"/;[\\r\\n]+/\",$line))\n continue;\n \n @mysql_query($sql);\n if(mysql_error()!=\"\")\n {\n $this->error.=\"<br>\".mysql_error();\n }\n \n $sql=\"\";\n }\n if(!empty($this->error))\n return false;\n return true;\n }\n }", "public function run()\n {\n \\DB::statement(\" INSERT INTO solicitudes.estados(id, descripcion, css)\n\t(\n\t\tSELECT *\n\t\tFROM dblink('dbname=sirge3 host=192.6.0.118 user=postgres password=LatinoSandwich007',\n\t\t 'SELECT id, descripcion, css\n\t\t\t FROM solicitudes.estados')\n\t\t AS migracion( id integer,\n\t\t\t\t\t\t descripcion character varying(50),\n\t\t\t\t\t\t css character varying(20) )\t\t\t\n\t); \");\n }", "function runDump($fileName, $skipErrors = false)\n{\n\tif (!is_file($fileName))\n\t\tthrow new FileNotFoundException(\"File '$fileName' not found.\");\n\n\tset_time_limit(0);\n\t$sql = '';\n\t$err = $n = 0;\n\t$f = fopen($fileName, 'r');\n\twhile (($line = fgets($f, 4096)) !== false) {\n\t\tif (strpos($line, '--') === 0) continue;\n\t\t$sql .= $line;\n\t\tif (preg_match('/;\\s*$/iS', $line)) {\n\t\t\ttry { $this->query($sql); }\n\t\t\tcatch (Exception $e) {\n\t\t\t\t$err++;\n\t\t\t\tif (!$skipErrors) throw $e;\n\t\t\t}\n\t\t\t$n++;\n\t\t\t$sql = '';\n\t\t}\n\t}\n\tfclose($f);\n\tif ($err) throw new DatabaseException(\"Dump '$fileName': $err of $n queries failed.\");\n\treturn $n;\n}", "function importDB($filename) {\n global $DB;\n // Temporary variable, used to store current query\n $templine = '';\n // Read in entire file\n $lines = file($filename);\n // Loop through each line\n foreach ($lines as $line) {\n // Skip it if it's a comment\n if (substr($line, 0, 2) == '--' || $line == '')\n continue;\n\n // Add this line to the current segment\n $templine .= $line;\n // If it has a semicolon at the end, it's the end of the query\n if (substr(trim($line), -1, 1) == ';') {\n // Perform the query\n mysqli_query($DB,$templine) or print($msg[\"BACKUPRESTORE\"][\"SQLQueryNOK\"][$Lang].' \\'<strong>' . $templine . '\\': ' . mysqli_error($DB) . '<br /><br />');\n // Reset temp variable to empty\n $templine = '';\n } // ENDIF\n } // END FOREACH\n mysqli_query($DB,\"FLUSH PRIVILEGES\");\n echo \"Table imported (\".$filename.\") successfully\"; \n}", "private function createMainDatabaseRecords()\n {\n // get the .sql file\n $sql = (string) @file_get_contents( $this->plugin->getPath() . \"/Setup/install.sql\" );\n\n // insert it\n $this->db->exec( $sql );\n }", "public function toSQL($target_file)\n {\n $limit = $this->cli->getSwitch(['l', 'limit']);\n\n $fh = fopen($this->data_file, 'r');\n if (!file_exists(dirname($target_file))) {\n mkdir(dirname($target_file), 0777, true);\n }\n $tfh = fopen($target_file, 'w');\n\n $file_start = \"\nSET NAMES UTF8;\n\nTRUNCATE TABLE `{$this->table_name}`;\n \";\n\n $column_names = array_map(function($column) {\n return $column['name'];\n }, $this->columns);\n\n $query_start = \"\nINSERT INTO `{$this->table_name}`\n(`\".join(\"`, `\", $column_names).\"`)\nVALUES\";\n\n $query_end = \";\\n\\n\";\n\n fwrite($tfh, $file_start);\n fwrite($tfh, $query_start);\n\n $total = 0;\n $batch = 0;\n \n while ($line = fgets($fh)) {\n $row = explode(\"\\t\", trim($line));\n $total++;\n if ($total == 1) { // radek s nazvy sloupcu\n continue;\n }\n $batch++;\n\n $row = array_map('trim', $row);\n\n $row = array_slice(array_pad($row, count($this->columns), null), 0, count($this->columns));\n\n $values = [];\n foreach (array_values($this->columns) as $col_nr => $column) {\n $values[] = $this->columnValue($col_nr, $row[$col_nr]);\n }\n // $values = [\n // static::string($row[0]),\n // static::string($row[1]),\n // static::string($row[2]),\n // static::string($row[3]),\n // $row[4] ? 1 : 0,\n // intval($row[5]) ?: 'NULL',\n // intval($row[6]) ?: 'NULL',\n // intval($row[7]) ?: 'NULL',\n // static::string($row[8])\n // ];\n\n fwrite($tfh, ($batch > 1 ? \",\" : \"\").\"\\n(\".join(\", \", $values).\")\");\n\n if ($total % 100000 == 0) {\n $this->cli->output($total . \" rows written\");\n }\n\n if ($limit && $total >= $limit) {\n break;\n }\n\n if ($batch >= 5000) {\n fwrite($tfh, $query_end);\n fwrite($tfh, $query_start);\n $batch = 0;\n }\n }\n\n fwrite($tfh, $query_end);\n }", "public function pathToSQLFile();", "public function importDb($db){\n // mysql db_name < backup-file.sql\n //echo \"c:/wamp/mysql/bin/mysql --host=$_POST[host] --user=$_POST[username] --password=$_POST[password] $db < ../globalinc/datab.sql\";\n $mysqlImportFilename ='../globalinc/datab.sql';\n //passthru(\"mysql --host=$_POST[host] --user=$_POST[username] --password=$_POST[password] $db < ../globalinc/datab.sql\", $r);\n\t\t echo $command='mysql -h' .$_POST[host] .' -u' .$_POST[username] .' -p' .$_POST[password] .' ' .$db .' < ' .$mysqlImportFilename;\n\t\t\texec($command,$output=array(),$worked);\n var_dump($worked);\n switch($worked){\n case 0:\n echo 'Import file <b>' .$mysqlImportFilename .'</b> successfully imported to database <b>' .$mysqlDatabaseName .'</b>';\n break;\n case 1:\n echo 'There was an error during import. Please make sure the import file is saved in the same folder as this script and check your values:<br/><br/><table><tr><td>MySQL Database Name:</td><td><b>' .$db .'</b></td></tr><tr><td>MySQL User Name:</td><td><b>' .$_POST[username] .'</b></td></tr><tr><td>MySQL Password:</td><td><b>NOTSHOWN</b></td></tr><tr><td>MySQL Host Name:</td><td><b>' .$_POST[host] .'</b></td></tr><tr><td>MySQL Import Filename:</td><td><b>' .$mysqlImportFilename .'</b></td></tr></table>';\n break;\n}\n \n }", "protected function loadData(string $file) {\r\n $fn = sprintf(\"%s/%s.sql\", dirname($file), pathinfo($file, PATHINFO_FILENAME));\r\n\r\n if ($file = realpath($fn)) {\r\n return $this->importMysqlDump(file_get_contents($fn));\r\n }\r\n\r\n throw new Exception(\"File not found: $fn\");\r\n }", "public function dataFromSQLFiles(): void\n {\n if (file_exists($this->resourceDir . '/epsg/epsg.sqlite')) {\n unlink($this->resourceDir . '/epsg/epsg.sqlite');\n }\n\n $sqlite = new SQLite3(\n $this->resourceDir . '/epsg/epsg.sqlite',\n SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE\n );\n\n $sqlite->enableExceptions(true);\n $sqlite->exec('PRAGMA journal_mode=WAL'); // WAL is faster\n\n $tableSchema = file_get_contents($this->resourceDir . '/epsg/PostgreSQL_Table_Script.sql');\n if (str_starts_with($tableSchema, self::BOM)) {\n $tableSchema = substr($tableSchema, 3);\n }\n $sqlite->exec($tableSchema);\n\n $tableData = file_get_contents($this->resourceDir . '/epsg/PostgreSQL_Data_Script.sql');\n if (str_starts_with($tableData, self::BOM)) {\n $tableData = substr($tableData, 3);\n }\n $sqlite->exec($tableData);\n\n // Custom alias/no-op method\n $sqlite->exec(\"INSERT INTO epsg_coordoperationmethod (coord_op_method_code, coord_op_method_name, reverse_op, data_source, revision_date, deprecated, remarks) VALUES (32768, 'Alias', 1, 'PHPCoord', '2021-10-28', 0, '')\");\n\n // Corrections\n $sqlite->exec(\"UPDATE epsg_coordoperationparamvalue SET param_value_file_ref = NULL WHERE param_value_file_ref = ''\");\n $sqlite->exec('UPDATE epsg_coordinateaxis SET uom_code = 9102 WHERE uom_code = 9122'); // supplier-defined degrees to regular degrees\n $sqlite->exec('UPDATE epsg_coordoperation SET deprecated = 1 WHERE coord_op_code IN (1851, 9235, 15933)');\n $sqlite->exec('DELETE FROM epsg_coordinatereferencesystem WHERE coord_ref_sys_code = 9912;'); // erroneous test entry\n\n /*\n * AusGeoidv2 abuses the NTv2 file format to have very large files, and a confusing implementation (latitude shifts are actually height offsets),\n * so use a GTX conversion of those files instead...\n */\n $sqlite->exec('UPDATE epsg_coordoperation SET coord_op_method_code = 1088 WHERE coord_op_code IN (9465, 9466, 9467, 9693)');\n $sqlite->exec('UPDATE epsg_coordoperation SET coord_op_method_code = 9665 WHERE coord_op_code IN (5656, 5657, 8451, 9461, 9692)');\n\n $sqlite->exec(\"UPDATE epsg_coordoperationparamvalue SET param_value_file_ref = REPLACE(param_value_file_ref, '.gsb', '.gtx') WHERE coord_op_code IN (9465, 9466, 9467, 9693) OR coord_op_code IN (5656, 5657, 8451, 9692)\");\n $sqlite->exec('UPDATE epsg_coordoperationparamvalue SET coord_op_method_code = 1088 WHERE coord_op_code IN (9465, 9466, 9467, 9693)');\n $sqlite->exec('UPDATE epsg_coordoperationparamvalue SET coord_op_method_code = 9665 WHERE coord_op_code IN (5656, 5657, 8451, 9692)');\n\n /*\n * VERTCON files/extents described in EPSG are the old VERTCON1/2 .94 file format, not the VERTCON3 .b files\n * which cover geographically different extents. Therefore we use the official NOAA VDatum GTX conversions of the\n * older files instead to avoid yet-another-grid-format implementation.\n */\n $sqlite->exec('UPDATE epsg_coordoperation SET coord_op_method_code = 1084 WHERE coord_op_code IN (7969, 7970, 7971)');\n $sqlite->exec(\"UPDATE epsg_coordoperationparamvalue SET param_value_file_ref = REPLACE(param_value_file_ref, '.94', '.gtx') WHERE coord_op_code IN (7969, 7970, 7971)\");\n $sqlite->exec('UPDATE epsg_coordoperationparamvalue SET coord_op_method_code = 1084 WHERE coord_op_code IN (7969, 7970, 7971)');\n\n /*\n * Transformation from S-JTSK [JTSK03] to S-JTSK is listed as NADCON even though there's an official NTv2 file.\n * EPSG have declined to add it as an alternate to the DB, so override that here.\n */\n $sqlite->exec('UPDATE epsg_coordoperation SET coord_op_method_code = 9615 WHERE coord_op_code = 8364');\n $sqlite->exec('DELETE FROM epsg_coordoperationparamvalue WHERE coord_op_code = 8364');\n $sqlite->exec(\"INSERT INTO epsg_coordoperationparamvalue (coord_op_code, coord_op_method_code, parameter_code, param_value_file_ref) VALUES (8364, 9615, 8656, 'Slovakia_JTSK03_to_JTSK.gsb')\");\n\n /*\n * Time-dependent transformations from/to WGS84 are only present in transforms involving specific realisations\n * so add transforms to/from the generic ensemble codes to the most recent version.\n * XXX technically, the ensemble accuracy is 2m not 0, but we're actively assuming the latest realisation\n */\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32768, 'WGS 84 to WGS 84 (G2139) (geocen)', 'transformation', 4978, 9753, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32768, 1262, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32769, 'WGS 84 to WGS 84 (G2139) (geog2D)', 'transformation', 4326, 9755, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32769, 1262, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32770, 'WGS 84 to WGS 84 (G2139) (geog3D)', 'transformation', 4979, 9754, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32770, 1262, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32771, 'WGS 84 to WGS 84 (G2139) (geog2D to geocen)', 'transformation', 4326, 9753, 9602, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32771, 1262, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32772, 'WGS 84 to WGS 84 (G2139) (geog3D to geocen)', 'transformation', 4979, 9753, 9602, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32772, 1262, 1203)\");\n\n /*\n * Time-dependent transformations from/to ETRS89 are only present in transforms involving specific realisations\n * so add transforms to/from the generic ensemble codes to ETRF2000 (ETRF2014 is technically better, ETRF2000\n * is still recommended by EUREF for georeferencing)\n * XXX technically, the ensemble accuracy is 0.1m not 0, but we're actively assuming the relevant realisation\n */\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32773, 'ETRS89 to ETRF2000 (geocen)', 'transformation', 4936, 7930, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32773, 1298, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32774, 'ETRS89 to ETRF2000 (geog2D)', 'transformation', 4258, 9067, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32774, 1298, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32775, 'ETRS89 to ETRF2000 (geog3D)', 'transformation', 4937, 7931, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32775, 1298, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32776, 'ETRS89 to ETRF2000 (geog2D to geocen)', 'transformation', 4258, 7930, 9602, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32776, 1298, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32777, 'ETRS89 to ETRF2000 (geog3D to geocen)', 'transformation', 4937, 7930, 9602, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32777, 1298, 1203)\");\n\n /*\n * EPSG has a transform listed from generic ETRS89 (2D) to generic WGS84 (2D) but not the 3D for some reason\n */\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32778, 'ETRS89 to WGS 84 (geocen)', 'transformation', 4936, 4978, 32768, 1, 'PHPCoord', '2023-02-19', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32778, 1262, 1298)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32779, 'ETRS89 to WGS 84 (geog3D)', 'transformation', 4937, 4979, 32768, 1, 'PHPCoord', '2023-02-19', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32779, 1262, 1298)\");\n\n /*\n * Too many \"world\" extents with confusing descriptions, unify\n */\n $sqlite->exec('UPDATE epsg_usage SET extent_code = 1262 WHERE extent_code IN (1263, 2346, 2830, 4393, 4520, 4523)');\n\n $sqlite->close();\n }", "public function executeScript($file, $database)\n {\n if($database != 'simpledb')\n return;\n\n $status = include $file;\n return $status;\n }", "public static function import()\n {\n $dump = new Import(self::getDatabaseInstance());\n $dump->setIsPipeViewerAvailable(true);\n $dump->setFilename(getenv('DUMP_FILE_NAME') ?? 'sql/master.sql');\n\n foreach ($dump->createExec()->getCommands() as $command) {\n echo $command . PHP_EOL;\n shell_exec($command);\n }\n }", "abstract protected function parseSql();", "public function execSql(){\n\t\t$cant=func_num_args();\n\t\t$instSql=\"\";\n\t\t$instSql=$this->reemplazaParametro(func_get_args());\n//\t\techo \"<br>\".$instSql.\"<br>\";\n//\t\techo $this->tipodb.\"<br>\";\n//\t\t$this->registroLog($instSql,$_SESSION['PERMISO'][0],$_SESSION['PERMISO'][1]);\n\t\tswitch ($this->tipodb) {\n\t\t\tcase \"my\":\n\t\t\t\t$resultado=mysql_query($instSql,$this->conn);\n//echo mysql_errno().\"<br>\";\n\t\t\t\tbreak;\n\t\t\tcase \"pg\":\n\t\t\t\t$resultado=pg_query($this->conn,$instSql);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $resultado;\n\t}", "static private function createTables($file)\n\t{\n\t\t$config = Config::instance();\n\t\tforeach($config->sqlite_table AS $t)\n\t\t{\n\t\t\tself::$instance[$file]->exec($t);\n\t\t}\n\t}", "public function execute($sql);", "public function execute($sql);", "public function run() {\n\t\t\\DB::statement(\"INSERT INTO pss.codigos_mujer(codigo_prestacion,id_linea_cuidado,id_grupo_etario,embarazo_riesgo,embarazo_normal)\n\t(\n\t\tSELECT *\n\t\tFROM dblink('dbname=sirge host=192.6.0.118 user=postgres password=PN2012\\$',\n\t\t 'SELECT codigo_prestacion,id_linea_cuidado,id_grupo_etario,embarazo_riesgo,embarazo_normal\n\t\t\t FROM pss.codigos_mujer')\n\t\t AS migracion(codigo_prestacion character varying(11),\n\t\t\t\t id_linea_cuidado smallint,\n\t\t\t\t id_grupo_etario smallint,\n\t\t\t\t embarazo_riesgo character varying(1),\n\t\t\t\t embarazo_normal character varying(1))\n\t);\");\n\t}", "public function run()\n {\n $path = 'database/seeds/SQLFiles/Products.sql';\n DB::unprepared(file_get_contents($path));\n $this->command->info('Products table seeded!');\n }", "public function run()\n {\n $this->execute('SET FOREIGN_KEY_CHECKS = 0');\n $this->execute('TRUNCATE TABLE tbl_fact_departments');\n\n $sql = file_get_contents(__DIR__ . '/../sql/011_add_it_department.sql');\n $this->execute($sql);\n $sql = file_get_contents(__DIR__ . '/../sql/012_add_departments.sql');\n $this->execute($sql);\n }", "public function run()\n {\n for ($i = 1; $i <= 5; $i++) {\n $path = 'database/sql/simc' . $i . '.sql';\n DB::unprepared(file_get_contents($path));\n $this->command->info($path . ' seeded!');\n } \n }", "protected function SQL_forStockStatus_byLine() {\n\t$fs = __DIR__.'/qryStockStatus_byLine.sql';\n\t$sql = file_get_contents($fs);\n\treturn $sql;\n }", "public function main()\n {\n $options = array(\n 'server' => $this->host,\n 'database' => $this->name,\n 'username' => $this->user,\n 'password' => $this->password\n );\n\n ORM_Connection_Manager::add(new ORM_Adapter_Mysql($options));\n\n $gen = new ORM_Generator_Models();\n $gen->generateFromDb(ORM_Connection_Manager::getConnection(), $this->out, $this->table);\n\n $this->log('SQL write into file \"' . $this->out . '\"');\n //print($this->message);\n }", "public function run() {\n\t\t\\DB::statement(\"INSERT INTO pss.codigos_sumar_nacer(codigo_prestacion,id_grupo_etario,codigo_prestacion_nacer,codigo_prestacion_rural)\n\t(\n\t\tSELECT *\n\t\tFROM dblink('dbname=sirge host=192.6.0.118 user=postgres password=PN2012\\$',\n\t\t 'SELECT codigo_prestacion,id_grupo_etario,codigo_prestacion_nacer,codigo_prestacion_rural\n\t\t\t FROM pss.codigos_sumar_nacer')\n\t\t AS migracion(codigo_prestacion character varying(11),\n\t\t\t\t id_grupo_etario smallint,\n\t\t\t\t codigo_prestacion_nacer character varying(6),\n\t\t\t\t codigo_prestacion_rural character varying(11))\n\t);\");\n\t}", "public function execute($sql) {\n\t\tquery_db2($sql, true);\n\t}", "public function run() {\n\t\t\\DB::statement(\" INSERT INTO efectores.tipo_efector(id_tipo_efector,sigla,descripcion)\n(\n\tSELECT *\n\tFROM dblink('dbname=sirge host=192.6.0.118 user=postgres password=PN2012\\$',\n\t 'SELECT id_tipo_efector,sigla,descripcion\n\t\t FROM efectores.tipo_efector')\n\t AS migracion(id_tipo_efector integer,\n sigla character varying(4),\n descripcion character varying(50))\n);\");\n\t}", "public function sqlData($sql, $options = array()) {\n // Load the block from the file\n $db = $this->db;\n $xml ='';\n // Load the types array based on data\n $this->types = isset($options['type']) ? $options['type'] : array();\n\n if ($sql && $db) {\n $sql = $this->te->replace($sql);\n try {\n $rs = $db->query($sql);\n\n }\n catch (PDOException $e) {\n watchdog_exception('error',$e);\n $line = $e->getLine();\n $text = $e->getMessage();\n drupal_set_message($short, 'error', FALSE);\n return;\n\n }\n if (@$options['return_type'] == 'raw') {\n return $rs;\n }\n $xml = new SimpleXMLElement('<table/>');\n $e = $db->errorCode();\n\n if ($e != '00000') {\n $i = $db->errorInfo();\n $text = $i[0] . ':' . $i[2];\n //if (user_access('build forena sql blocks')) {\n if (!$this->block_name) {\n $short = t('%e', array('%e' => $text));\n } else {\n $short = t('SQL Error in %b.sql', array('%b' => $this->block_name));\n }\n $this->error($short, $text);\n\n }\n else if ($rs && $rs->columnCount()) {\n if (@$options['return_type'] == 'raw') return $rs;\n $rownum = 0;\n foreach ($rs as $data) {\n $rownum++;\n $row_node = $xml->addChild('row');\n $row_node['num'] = $rownum;\n foreach ($data as $key => $value) {\n $row_node->addChild($key, htmlspecialchars($value));\n }\n }\n }\n\n if ($this->debug) {\n $d = '';\n if ($xml) {\n $d = htmlspecialchars($xml->asXML());\n }\n $this->debug('SQL: ' . $sql, '<pre> SQL:' . $sql . \"\\n XML: \" . $d . \"/n</pre>\");\n }\n return $xml;\n }\n\n }", "public function dbAnalysisStoreExec() {}", "public function run()\n {\n\t DB::table('cities')->delete();\n\t $file = database_path() . \"/seeds/cities.sql\";\n\t /*\n\t\t * First method with DB::unprepared\n\t\t * */\n\t DB::unprepared(file_get_contents($file));\n }", "function getSqlFile (string $file): string {\n\t$filePath = _ROOT_PATH.'sql/'.$file.'.sql';\n\tif (is_file($filePath)) {\n\t\treturn file_get_contents($filePath);\n\t}\n\treturn '';\n}", "public function db_exec($sql)\n {\n $req = $this->db_open()->exec($sql);\n }", "private function generateTables()\n\t\t{\n\t\t\tif ($this->connectFail == False)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tdatabase schema access\n\t\t\t\t*/\n\n\t\t\t\t$content = file_get_contents('dbase.sql');\n\t\t\t\t$queries = explode(\";\\n\\n\", $content);\n\n\t\t\t\tforeach ($queries as $key => $query)\n\t\t\t\t{\n\t\t\t\t\t$er = False;\n\t\t\t\t\t$df = $this->execQuery($query);\n\n\t\t\t\t\t#print $df.\"\\n\".$er.PHP_EOL;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function correctSQL($file){\n\t/*\n\t**WRITING SQL\n\t*/\t\n\t$sql=file_get_contents($file);\n\t// $sql=preg_quote($sql)\n\t$sql=preg_replace(\"/\\(1, 'siteurl', '(.*?)', 'yes'\\)/\", \"(1, 'siteurl', 'http://www.mingo.loc', 'yes')\", $sql);\n\t$sql=preg_replace(\"/\\(2, 'home', '(.*?)', 'yes'\\)/\", \"(2, 'home', 'http://www.mingo.loc', 'yes')\", $sql);\n\t$sql=preg_replace(\"/\\(3, 'blogname', '(.*?)', 'yes'\\)/\", \"(3, 'blogname', 'Site Title', 'yes')\", $sql);\n\t$sql=preg_replace(\"/\\(4, 'blogdescription', '(.*?)', 'yes'\\)/\", \"(4, 'blogdescription', 'Just another WordPress site', 'yes')\", $sql);\n\t$sql=preg_replace(\"/\\(6, 'admin_email', '(.*?)', 'yes'\\)/\", \"(6, 'admin_email', '[email protected]', 'yes')\", $sql);\n\t$newSQL=fopen($file, 'w');\n\tfwrite($newSQL, $sql);\n\tfclose($newSQL);\t\n\t$sqlfile=file($file);\t\n\tforeach ($sqlfile as $key => $value) {\n\t\tif(substr($value, 0, 22)==\"INSERT INTO `wp_users`\"){\n\t\t\t$sqlfile[$key+1]=\"(1, 'Username', 'password', 'username', '[email protected]', '', '2015-11-19 10:46:54', '', 0, 'Username');\";\t\t\n\t\t}\n\t\tif(substr($value, 0, 25)==\"INSERT INTO `wp_usermeta`\"){\n\t\t\t$sqlfile[$key+1]=\"(1, 1, 'nickname', 'Username'),\";\t\n\t\t}\n\t}\t\n\t$newSQL=fopen($file, 'w');\n\tfwrite($newSQL, implode($sqlfile));\n\tfclose($newSQL);\n\t$sql=file_get_contents($file);\n}", "public function run()\n {\n\n\n //sm_bcd_categories\n DB::table('sm_bcd_categories')->truncate();\n $file = new SplFileObject('database/csv/sm_bcd_categories.csv');\n $file->setFlags(\n \\SplFileObject::READ_CSV |\n \\SplFileObject::READ_AHEAD |\n \\SplFileObject::SKIP_EMPTY |\n \\SplFileObject::DROP_NEW_LINE\n );\n $list = [];\n foreach($file as $line) {\n $list[] = [\n \"id\" => $line[0],\n \"name\" => $line[1],\n ];\n }\n DB::table(\"sm_bcd_categories\")->insert($list);\n\n //sm_bcds\n DB::table('sm_bcds')->truncate();\n $file = new SplFileObject('database/csv/sm_bcds.csv');\n $file->setFlags(\n \\SplFileObject::READ_CSV |\n \\SplFileObject::READ_AHEAD |\n \\SplFileObject::SKIP_EMPTY |\n \\SplFileObject::DROP_NEW_LINE\n );\n $list = [];\n foreach($file as $line) {\n $list[] = [\n \"id\" => $line[0],\n \"sm_bcd_category_id\" => $line[1],\n \"name\" => $line[2],\n ];\n }\n DB::table(\"sm_bcds\")->insert($list);\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n District::truncate();\n Area::truncate();\n Province::truncate();\n Geography::truncate();\n\n $query = file_get_contents(base_path('database/seeds/thailand.sql'));\n DB::unprepared($query);\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$ipsPath = storage_path('ips.csv');\n $pdo = \\DB::connection()->getPdo();\n $pdo->exec(\"\n\t\t\tLOAD DATA LOCAL\n\t\t\t\tINFILE '\" . $ipsPath . \"'\n\t\t\tINTO TABLE\n\t\t\t\t`ip_addresses`\n\t\t\tFIELDS TERMINATED BY ','\n\t\t\tENCLOSED BY '\\\"'\n\t\t\tLINES TERMINATED BY '\\r\\n'\n\t\t\tIGNORE 0 LINES;\n \");\n }", "function exeSql($sql, $pars, $isLimit = 1){ \n $ini = parse_ini_file('config.ini');\n $servername = $ini['db_name'];\n $username = $ini['db_user'];\n $password = $ini['db_password'];\n\n // Create connection\n $conn = new mysqli($servername, $username, $password);\n \n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n \n for ($i=0; $i < count($pars); $i++)\n $sql = str_replace(\"{\".$i.\"}\", $pars[$i], $sql); \n\n if($isLimit)\n $sql .= \" LIMIT 30 \";\n\n \n\n $data = mysqli_query($conn, $sql); \n\n return $data; \n }", "public function run()\n {\n \tEloquent::unguard();\n //\n\n $this->command->info('Seeding districts table');\n\n DB::unprepared(file_get_contents(__DIR__ . '/districts.sql'));\n\n $this->command->info('Seeding districts done successfully');\n }", "public function run()\n {\n \\DB::statement(\" INSERT INTO indec.poblacion_departamentos(id_provincia, id_departamento, habitantes, habitantes_sumar)\n\t(\n\t\tSELECT *\n\t\tFROM dblink('dbname=sirge2 host=192.6.0.66 user=postgres password=110678',\n\t\t 'SELECT id_provincia, id_departamento, habitantes, coalesce(habitantes_sumar,0)\n\t\t\tFROM\n\t\t\t\tindec.poblacion_departamentos;')\n\t\t AS migracion(id_provincia char(2),\n\t\t\t\t id_departamento char(3),\n\t\t\t\t habitantes integer,\n\t\t\t\t habitantes_sumar integer\n\t\t\t\t)\n\t); \");\n }", "function inputSourceCTL($ctlfilename, $queryfilename, $dbh) {\n\n\tif (!file_exists($ctlfilename)) {\n\t\techo $ctlfilename . ' does not exist!\\r\\n';\n\t\treturn false;\n\t}\n\n\tif (!file_exists($queryfilename)) {\n\t\techo 'query ' . $queryfilename . ' does not exist!\\r\\n';\n\t\treturn false;\n\t}\n\n\t$stmt = null;\n\n\tif (!$dbh) {\n\t\techo \"Database not opened!\\r\\n\";\n\t\treturn false;\n\t} else {\n\t\t// build statement\n\t\ttry {\n\t\t\t$stmt = $dbh->prepare(file_get_contents($queryfilename));\n\t\t\techo \"Insert statement prepared.\\r\\n\";\t\n\t\t} catch (PDOException $e) {\n\t\t\techo \"Error preparing statement: \" . $e->getMessage() . \"\\r\\n\";\t\n\t\t\treturn false;\n\t\t}\n\t}\n\n\techo \"opening file: \" . $ctlfilename . \"\\r\\n\";\n\n\t$fp = fopen($ctlfilename, \"r\");\n\n\t// initial status\n\t$status = array(\n\t\t'STARTED' => false,\n\t\t'ROWCOUNT' => 0,\n\t\t'ERRORCOUNT' => 0,\n\t\t'LASTERROR' => '',\n\t\t'ATTEMPTED' => 0\n\t\t);\n\n\n\t// must skip until begin data\n\twhile ($row = fgetcsv($fp, 2048, \";\", '\"')) {\n\t\t// update start flag\n\t\tif (count($row) >= 1 && !$status['STARTED']) {\n\t\t\t// found the string BEGINDATA\n\t\t\tif ($row[0] == 'BEGINDATA') {\n\t\t\t\t$status['STARTED'] = true;\n\t\t\t\t$status['ROWCOUNT'] = 0;\n\t\t\t\t$status['ATTEMPTED'] = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t$maxLen = 80;\n\t\t// now, do something if we're started\n\t\tif ($status['STARTED'] && count($row) >= 12) {\n\t\t\t// insert into database\n\t\t\ttry {\n\t\t\t\t$res = $stmt->execute($row);\n\n\t\t\t\t// $poop = implode(' | ', $row);\n\t\t\t\techo \"\\r>inserted row(s)... {$status['ROWCOUNT']}\";\n\t\t\t\t// $poopTrimmed = substr($poop, 0, $maxLen) . '...';\n\n\t\t\t\t// echo \"[\" .$status['ROWCOUNT'] . \"]-> \" . $poopTrimmed . \"\\r\\n\";\n\t\t\t\t// increase rowcount (actual inserted row)\n\t\t\t\t$status['ROWCOUNT'] += $stmt->rowCount();\n\t\t\t\t$status['ATTEMPTED'] ++;\n\t\t\t} catch (PDOException $e) {\n\t\t\t\techo \"Error insert: \" . $e->getMessage() . \"\\r\\n\";\n\n\t\t\t\t$status['ERRORCOUNT']++;\n\t\t\t\t$status['LASTERROR'] = $e->getMessage();\n\t\t\t}\n\n\t\t\t// sleep every 100000 rows\n\t\t\t$sleepCounter = 100000;\n\t\t\t$sleepDurationMS = 1300;\n\n\t\t\tif ( $status['ROWCOUNT'] % $sleepCounter == 0 ) {\n\t\t\t\tsleep($sleepDurationMS/1000.0);\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t// echo \"IGNORING THIS LINE...\\r\\n\";\n\t\t}\n\t}\n\n\t// close the file handle\n\tfclose($fp);\n\n\t// log status\n\techo \"\\rINSERTED: {$status['ROWCOUNT']} rows of {$status['ATTEMPTED']}, ERROR: {$status['ERRORCOUNT']} \\r\\n\";\n\n\treturn $status['ROWCOUNT'];\n}", "abstract public function execute($sql);", "public function _restore_db_from_file($file, $settings) {\n // Must be overridden.\n }", "function executeSqlStatements($sqlStatements) {\n\t\t\n\t\tprint\"SQL View STATEMENTS:\\n</br>\";\n\t\tforeach ($sqlStatements as $sqlStatement) {\n\t\t\tprint \"$sqlStatement\\n</br>\";\n\t\t}\n\t\t// create a connection to mysql\n\t\tif (! ($connection = @ mysql_connect(\"ec2-184-169-207-10.us-west-1.compute.amazonaws.com\",\"pearson\",\"pearson2\")))\n\t\t\tdie (\"could not connect to mysql localhost\");\n\t\t\n\t\t// select the stumbleupon database\n\t\tif (! (@mysql_select_db(\"stumbleupon\",$connection)))\n\t\t\tshowError(\"Could not select the stumbleupon database, make sure it exists\");\n\t\t\t\n\t\tforeach ($sqlStatements as $sqlStatement) {\n\t\t\tif (EXECUTE_SQL_STATEMENTS) {\n\t\t\t\tif (!($result = @ mysql_query(\"$sqlStatement\",$connection)))\n\t\t\t\t\tshowError(\"mysql_query: $sqlStatement\\n<br />\" );\n\t\t\t\tprint \"result: $result\\n\";\n\t\t\t}\n\t\t} \n\t}", "public function toSql() // {{{\n {\n $out = \"\";\n $out .= \"-- This file was autogenerated by a Script With No Name\\n\";\n $out .= \"-- on \".date(\"Y-m-d\").\". It represents a set of BibTeX entries.\\n\\n\";\n $schema = $this->getParameterSet();\n $out .= \"-- Table schema\\n\";\n $out .= \"CREATE TABLE `\".Bibliography::$db_name.\"` (\\n\";\n $out .= \" `identifier` varchar(128) NOT NULL,\\n\";\n foreach ($schema as $p_name)\n {\n $type = Bibliography::guessType($p_name);\n $out .= \" `$p_name` $type DEFAULT NULL,\\n\";\n }\n $out .= \" PRIMARY KEY (`identifier`)\\n\";\n $out .= \") ENGINE=MyISAM DEFAULT CHARSET=utf8;\\n\\n\";\n $out .= \"-- Entry data\\n\";\n foreach ($this->m_entries as $bibtex_name => $bibtex_entry)\n {\n $first = true;\n $out .= \"INSERT INTO `\".Bibliography::$db_name.\"` SET `identifier` = '\".Bibliography::escapeSql($bibtex_name).\"'\";\n foreach ($bibtex_entry as $k => $v)\n {\n $out .= \", `$k` = '\".Bibliography::escapeSql($v).\"'\";\n }\n $out .= \";\\n\";\n }\n return $out;\n }", "abstract protected function executeSql($sql);", "function install_sql()\n\t{\n\t\t//-----------------------------------------\n\t\t// Write config\n\t\t//-----------------------------------------\n\t\t\t\n\t\t$this->install->write_configuration();\n\t\t\n\t\t//--------------------------------------------------\n\t\t// Any \"extra\" configs required for this driver?\n\t\t//--------------------------------------------------\n\n\t\tif ( file_exists( INS_ROOT_PATH.'sql/'.$this->install->saved_data['sql_driver'].'_install.php' ) )\n\t\t{\n\t\t\trequire_once( INS_ROOT_PATH.'sql/'.$this->install->saved_data['sql_driver'].'_install.php' );\n\n\t\t\t$extra_install = new install_extra();\n\t\t\t$extra_install->ipsclass =& $this->install->ipsclass;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Run SQL commands\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\t\t\t\t\t\t\t\t\t\t\t );\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t$this->install->ipsclass->converge = new class_converge( $this->install->ipsclass->DB );\n\t\t\t\t\n\t\tinclude( INS_ROOT_PATH . 'sql/' . $this->install->saved_data['sql_driver'] . '_tables.php' );\n\t\t$output[] = \"Создание таблиц в Базе Данных...\";\n\t\t\n\t\t\n\t\t\n\t\tforeach( $TABLE as $q )\n\t\t{\n\t\t\tpreg_match(\"/CREATE TABLE (\\S+) \\(/\", $q, $match);\n\n\t\t\tif ( $match[1] AND $this->install->saved_data['_drop_tables'] )\n\t\t\t{\n\t\t\t\t$this->install->ipsclass->DB->sql_drop_table( str_replace( 'ibf_', '', $match[1] ) );\n\t\t\t}\n\t\t\t\t\n\t\t\t$q = preg_replace(\"/ibf_(\\S+?)([\\s\\.,]|$)/\", $this->install->saved_data['db_pre'].\"\\\\1\\\\2\", $q);\n\t\t\t\n\t\t\t//-----------------------------------\n\t\t\t// Pass to handler\n\t\t\t//-----------------------------------\n\n\t\t\tif ( $extra_install AND method_exists( $extra_install, 'process_query_create' ) )\n\t\t\t{\n\t\t\t\t $q = $extra_install->process_query_create( $q );\n\t\t\t}\n\t\t\t\n\t\t\t$this->install->ipsclass->DB->allow_sub_select=1;\n\t\t\t$this->install->ipsclass->DB->query( $q );\n\t\t}\n\n\t\t//-----------------------------------\n\t\t// Create the fulltext index...\n\t\t//-----------------------------------\n\n\t\tif ( $this->install->ipsclass->DB->sql_can_fulltext() )\n\t\t{\n\t\t\tinclude( INS_ROOT_PATH . 'sql/' . $this->install->saved_data['sql_driver'] . '_fulltext.php' );\n\t\t\t$output[] = \"Создание индексов таблиц...\";\t\t\n\t\t\t\n\t\t\t foreach( $INDEX as $q )\n\t\t\t {\n\t\t\t \t$q = preg_replace(\"/ibf_(\\S+?)([\\s\\.,]|$)/\", $this->install->saved_data['db_pre'].\"\\\\1\\\\2\", $q);\n\n\t\t //-----------------------------------\n\t\t\t\t// Pass to handler\n\t\t\t\t//-----------------------------------\n\n\t\t\t\tif ( $extra_install AND method_exists( $extra_install, 'process_query_index' ) )\n\t\t\t\t{\n\t\t\t\t\t $q = $extra_install->process_query_index( $q );\n\t\t\t\t}\n\n\t\t\t\t//-----------------------------------\n\t\t\t\t// Pass query\n\t\t\t\t//-----------------------------------\n\n\t\t if ( ! $this->install->ipsclass->DB->query($q) )\n\t\t {\n\t\t \t$this->install->template->warning($q.\"<br /><br />\".$this->install->ipsclass->DB->error);\n\t\t }\n\t\t\t}\n\t\t}\n\t\t\n\t\tinclude( INS_ROOT_PATH . 'sql/' . $this->install->saved_data['sql_driver'] . '_inserts.php' );\n\t\t$output[] = \"Заполнение таблиц данными...\";\t\t\n\t\t\n\t\tforeach( $INSERT as $q )\n\t\t{\n\t\t\t$q = preg_replace(\"/ibf_(\\S+?)([\\s\\.,]|$)/\", $this->install->saved_data['db_pre'].\"\\\\1\\\\2\", $q);\n\t\t\t$q = str_replace( \"<%time%>\" , time(), $q );\n\t\t\t\n\t\t\t# Admin's name\n\t\t\t$q = str_replace( \"<%admin_name%>\", $this->install->saved_data['admin_user'], $q );\n\t\t\t\n\t\t\t//-----------------------------------\n\t\t\t// Pass to handler\n\t\t \t//-----------------------------------\n\n\t\t \tif ( $extra_install AND method_exists( $extra_install, 'process_query_insert' ) )\n\t\t \t{\n\t\t\t\t$q = $extra_install->process_query_insert( $q );\n\t\t\t}\n\t\t\t\n\t\t\t$this->install->ipsclass->DB->query( $q );\n\t\t}\n\t\t\n\t\t\n\t\t//-----------------------------------------\n\t\t// Create Admin account\n\t\t//-----------------------------------------\n\t\t\n\t\t$output[] = \"Создание учетной записи администратора...\";\n\t\t\n\t\t$this->install->create_admin_account();\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=settings';\n\t\t$this->install->template->hide_next = 1;\n\t}", "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}", "function PreprocessSql($sql);", "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 }", "static function split_execute ($sql,$splitter=';'){\n $statements = explode($splitter,$sql);\n foreach($statements as $statement){\n $statement = trim($statement);\n if($statement) {\n db()->execute($statement);\n }\n } \n }", "public function run() {\n ini_set('memory_limit', '-1');\n DB::unprepared(File::get(__DIR__ . '/don_vi_hanh_chinh.sql'));\n\n $this->call(CompaniesTableSeeder::class);\n $this->call(CommoditiesTableSeeder::class);\n // $this->call(CustomerTableSeeder::class);\n $this->call(RolesTableSeeder::class);\n $this->call(PermsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n \\App\\Sql::truncate(); //清空資料庫\n\n \\App\\Sql::create([\n 'name'=>'2019-03-06_init.sql',\n 'install'=>'1',\n ]);\n }", "public function query($file, $line, $sql, $param = array()) {\n\t\tPK_debug(__FUNCTION__, \"File: $file\\nLine:$line\\n\\n$sql\\nparam: \".print_r($param, true));\n\t\t\n\t\tif (is_array($param) && count($param) > 0) {\n\t\t\t$q = pg_query_params($this->_instance, $sql, $param);\n\t\t} else {\n\t\t\t$q = pg_query($this->_instance, $sql);\n\t\t}\n\t\t\n\t\treturn $q;\n\t}", "public function handle()\n {\n DB::unprepared(file_get_contents('database/migrations/cars.sql'));\n }", "public function run()\n {\n //定义数据填充数据\n $path = database_path();\n $data = split_sql($path . '/sql/admin_user_insert.sql');\n //执行数据迁移\n $user = new User();\n execute_sql($user, $data, 'admin_user');\n }", "function runSQL($host, $user, $pass, $db) {\n\t\t$this->errno = 0;\n\t\t$this->errinfo = \"\";\n\t\tif ( !$this->flagSql )\n\t\t\treturn true;\n\t\t$h = mysql_connect( $host, $user, $pass );\n\t\tif( !$h ) {\n\t\t\t$this->errno = -7;\n\t\t\t$this->errinfo = \"MySQL error(\".mysql_errno($h).\"): \".mysql_error( $h ).\". Could not connect to database\";\n\t\t}\n\t\tif( !mysql_select_db( $db, $h ) ) {\n\t\t\t$this->errno = -7;\n\t\t\t$this->errinfo = \"MySQL error(\".mysql_errno($h).\"): \".mysql_error( $h ).\". Could not connect to database\";\n\t\t}\n\t\t\n\t\tforeach ( $this->sql as $sql ){\n\t\t\tif( !mysql_query( $sql, $h ) ) {\n\t\t\t\t$this->errinfo .= \"MySQL error(\".mysql_errno($h).\"): \".mysql_error( $h ).\"; Query:\\n\".trim($sql).\"\\n\\n\";\n\t\t\t\t$this->errno = -7;\n\t\t\t}\n\t\t}\n\t\tmysql_close($h);\n\t\treturn true;\n\t}", "private function runSql(String $query)\n {\n try {\n\n $this->driver->exec($query);\n\n } catch (\\PDOException $e) {\n\n if ($e->getCode() === 1062) {\n //not sure what to do here\n return;\n } else {\n throw $e;\n }\n }\n\n }", "public function run()\n {\n $this->call(mGeneralTableSeeder::class);\n $this->call(mRoleTableSeeder::class);\n $this->call(AnggotaTableSeeder::class);\n\n $lokasi = base_path().'/../setup/data_lokasi.sql';\n DB::unprepared(file_get_contents($lokasi));\n $anggota_permata = base_path().'/../setup/anggota_permata.sql';\n DB::unprepared(file_get_contents($anggota_permata));\n $this->command->info('Country table seeded!');\n }", "public function run()\n {\n $SQL_FILES = [\n 'resources/developer_docs/tags.sql',\n 'resources/developer_docs/photo_tag.sql'\n ];\n \n Eloquent::unguard();\n for ($i=0; $i < count($SQL_FILES); $i++) { \n DB::unprepared(file_get_contents($SQL_FILES[$i]));\n }\n $this->command->info('tags data seeded!');\n }", "function runInstallSQL()\r\n \t{\r\n\t\t $return = null;\r\n\r\n \t\t$db = JFactory::getDBO();\r\n \t\t$sqlfile = JPATH_ADMINISTRATOR . '/components/' . $this->thisextension . '/install/install.sql';\r\n \t\tif (!file_exists($sqlfile)) { return; }\r\n \t\t\r\n \t\t$buffer = file_get_contents($sqlfile);\r\n \t\tif ($buffer !== false) {\r\n \t\t\tjimport('joomla.installer.helper');\r\n \t\t\t$queries = JInstallerHelper::splitSql($buffer);\r\n \t\t\tif (count($queries) != 0) {\r\n \t\t\t\tforeach ($queries as $query)\r\n \t\t\t\t{\r\n \t\t\t\t\t$query = trim($query);\r\n \t\t\t\t\tif ($query != '' && $query{0} != '#') {\r\n \t\t\t\t\t\t$db->setQuery($query);\r\n \t\t\t\t\t\tif (!$db->query()) {\r\n \t\t\t\t\t\t\tJError::raiseWarning(1, JText::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true)));\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\t}\r\n \t}", "public abstract function execute($sql);", "public function run()\n {\n //\n Eloquent::unguard();\n $this->command->info('Sembrando entidades...');\n $path = 'app/developer_docs/entidad.sql';\n try{\n DB::unprepared(file_get_contents($path));\n }catch(Exception $e){\n if ($e->getCode()==23505){\n $this->command->error('Entidades NO fueron plantadas!');\n return 0;\n }\n }\n $this->command->info('Entidades plantadas!');\n }", "public function runUp($file)\r\n\t{\r\n\t\t$data = $this->requireMigrationFiles($file);\r\n\t\t$mode = $data['mode'];\r\n\t\t$schemas = \"\";\r\n\t\tif ($mode != null) {\r\n\t\t\t$schemas .= $this->repository->schemaScaffold($mode, $data['table'], $data['up'], $data['primary_key'], \"UP\");\r\n\t\t}\r\n\r\n\t\treturn $schemas;\r\n\t}", "function restoreDatabaseTables($dbHost, $dbUsername, $dbPassword, $dbName, $filePath){\n $db = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName); \n\n // Temporary variable, used to store current query\n $templine = '';\n \n // Read in entire file\n $lines = file($filePath);\n \n $error = '';\n \n // Loop through each line\n foreach ($lines as $line){\n // Skip it if it's a comment\n if(substr($line, 0, 2) == '--' || $line == ''){\n continue;\n }\n \n // Add this line to the current segment\n $templine .= $line;\n \n // If it has a semicolon at the end, it's the end of the query\n if (substr(trim($line), -1, 1) == ';'){\n // Perform the query\n if(!$db->query($templine)){\n $error .= 'Error performing query \"<b>' . $templine . '</b>\": ' . $db->error . '<br /><br />';\n }\n \n // Reset temp variable to empty\n $templine = '';\n }\n }\n return !empty($error)?$error:true;\n}", "public function run()\n {\n $list = file(__DIR__ . '/xorder-list.txt');\n\n $insertArray = [];\n $inserKeys = [\n 'id',\n 'user_name',\n 'user_contact',\n 'user_info',\n 'ip',\n 'status',\n 'created_at',\n ];\n\n foreach ($list as $item) {\n $arr = explode(\"\\t\", $item);\n\n $insertArray[] = array_combine($inserKeys, $arr);\n }\n\n DB::table('xorders')->insert($insertArray);\n }", "public function exec( $sql )\r\n\t{\r\n\t\t$this->debugInfo($sql);\r\n\t\treturn db2_exec($this->conn, $sql);\r\n\t}", "public function run() {\n\n // SETUP ENVIRONMENT\n if (!$this->schemaTableExists()) {\n self::errln(\"Schema table does not exist...creating\");\n $this->runFile('00000_schema.sql');\n }\n\n // TEMPORARY TABLE PRIVILEGE?\n if (!$this->root_connection_setup) {\n if (!$this->hasCreateTemporaryTablePrivilege()) {\n self::errln(sprintf(\"\nUser `%s` has no 'CREATE TEMPORARY TABLE' privilege. It is\nstrongly recommended that privilege is granted.\n\",\n Conf::$SQL_USER));\n $this->setupRootDbConnection();\n }\n }\n\n $this->createTemporaryTable();\n\n $PROTO = new TSSchema();\n $TEMPP = new TSNewSchema();\n\n // FILL TEMPORARY TABLE\n $vat = new BatchedDirListing($this->getUpDir());\n $vat->filterByRegexp('/^[0-9]{5}_.+\\.sql$/');\n\n while (($batch = $vat->nextBatch()) !== false) {\n $objs = array();\n foreach ($batch as $name) {\n $obj = new TSNewSchema();\n $obj->id = $name;\n $objs[] = $obj;\n }\n DB::insertAll($objs);\n }\n\n // DOWNGRADE FIRST\n $res = DB::getAll(\n $PROTO,\n new DBCondIn('id', DB::prepGetAll($TEMPP, null, array('id')), DBCondIn::NOT_IN)\n );\n foreach ($res as $version) {\n $this->runDowngrade($version);\n }\n\n // UPGRADE NEXT\n $res = DB::getAll(\n $TEMPP,\n new DBCondIn('id', DB::prepGetAll($PROTO, null, array('id')), DBCondIn::NOT_IN)\n );\n foreach ($res as $version) {\n $this->runFile($version->id);\n }\n }" ]
[ "0.7253043", "0.7172986", "0.69777167", "0.6808357", "0.6736685", "0.65802383", "0.65547025", "0.65397286", "0.646412", "0.6410348", "0.6311992", "0.6251648", "0.6251156", "0.61900336", "0.6159083", "0.6131143", "0.60709876", "0.6053908", "0.60528064", "0.60421795", "0.6027569", "0.6025376", "0.6014352", "0.60080343", "0.5996109", "0.5944127", "0.5937848", "0.5906941", "0.5904743", "0.5894322", "0.5886711", "0.58837986", "0.58687854", "0.58580834", "0.5843249", "0.5836897", "0.5814213", "0.5760298", "0.57454216", "0.57447493", "0.57273066", "0.57199764", "0.5701934", "0.5699308", "0.56839913", "0.5681329", "0.566676", "0.5657188", "0.5646834", "0.5646834", "0.5638849", "0.56274354", "0.56145525", "0.55928135", "0.55887467", "0.55836385", "0.5567949", "0.5530121", "0.5519504", "0.55024177", "0.54592884", "0.5450201", "0.5440879", "0.54374087", "0.5425911", "0.5422343", "0.5405142", "0.5393062", "0.53908837", "0.53886586", "0.53852445", "0.538386", "0.5356905", "0.533883", "0.5338644", "0.53329104", "0.5330098", "0.53288615", "0.53073025", "0.52991146", "0.52967125", "0.5293624", "0.5290615", "0.5289044", "0.52887785", "0.52885956", "0.52880347", "0.5274115", "0.52692676", "0.52659094", "0.52531797", "0.5252833", "0.5248556", "0.5246046", "0.5237126", "0.5235228", "0.5217536", "0.5215972", "0.52089244", "0.52054715" ]
0.7114437
2
CHECK CART FOR ITEMS
function getPartner() { $table = $this->get_table(); $query = $this->db->get($table); return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkStock()\n {\n DB::beginTransaction();\n try{\n foreach ($this->cart as $item){\n $unit = Itens::find($item->id);\n $qtd = !empty($unit->quantity) ? $unit->quantity : $unit->weight;\n\n if($qtd >= $item->qty){\n if(!empty($unit->quantity)){\n $unit->quantity = $unit->quantity - $item->qty;\n }else{\n $unit->weight = $unit->weight - $item->qty;\n }\n $unit->save();\n }\n }\n DB::commit();\n $this->addItensToOrder();\n Session::flash('error', 'INfelizmente não foi possível processar sua compra devido a falta de estoque para um de nossos itens em cotação');\n }catch (Exception $e){\n DB::rollback();\n DebugBar::addException($e);\n }\n\n }", "function check_cart_items() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$result = $this->check_cart_item_stock();\n\t\t\tif (is_wp_error($result)) $cmdeals->add_error( $result->get_error_message() );\n\t\t}", "function check_cart_item_stock() {\n\t\t\t$error = new WP_Error();\n\t\t\tforeach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\tif ($_deals->managing_stock()) :\n\t\t\t\t\tif ($_deals->is_in_stock() && $_deals->has_enough_stock( $values['quantity'] )) :\n\t\t\t\t\t\t// :)\n\t\t\t\t\telse :\n\t\t\t\t\t\t$error->add( 'out-of-stock', sprintf(__('Sorry, we do not have enough \"%s\" in stock to fulfill your order (%s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'cmdeals'), $_deals->get_title(), $_deals->_stock ) );\n\t\t\t\t\t\treturn $error;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn true;\n\t\t}", "private function validate_sale_items() {\n\t\tif ( 'yes' === $this->exclude_sale_items && $this->is_type( wc_get_product_coupon_types() ) ) {\n\t\t\t$valid_for_cart = false;\n\t\t\t$product_ids_on_sale = wc_get_product_ids_on_sale();\n\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\tif ( ! empty( $cart_item['variation_id'] ) ) {\n\t\t\t\t\t\tif ( ! in_array( $cart_item['variation_id'], $product_ids_on_sale, true ) ) {\n\t\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ( ! in_array( $cart_item['product_id'], $product_ids_on_sale, true ) ) {\n\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_VALID_SALE_ITEMS );\n\t\t\t}\n\t\t}\n\t}", "function checkCart($TmpCart){\n\t\t$result = array();\n\t\tforeach ($this->Cart as $k => $v){ if($v[\"id\"] == $TmpCart[\"id\"]) $result[] = $k; } // Find Elements with the same product Id\n\t\t$unigue = true;\n\t\tif(count($result)>0){\n\t\t\tforeach ($result as $v){ // Check to see if all the data is the same. Messages and Engravins will always add a new item\n\t\t\t\tif($this->Cart[$v][\"spec\"] == $TmpCart[\"spec\"] && \n\t\t\t\t\t $this->Cart[$v][\"special\"] == $TmpCart[\"special\"] && \n\t\t\t\t\t $this->Cart[$v][\"selections\"] == $TmpCart[\"selections\"] && \n\t\t\t\t\t intval($this->Cart[$v][\"msgs\"]) == 0){ $newattnd=true;\n\t\t\t\t\t\t// Lets check our attendee list and make sure we have any new Attendees: this check is for NITA\n\t\t\t\t\t\tif(isset($this->Cart[$v][\"attnd\"]) && count($this->Cart[$v]['attnd']) > 0 && count($TmpCart['attnd']) > 0){\n\t\t\t\t\t\t\tforeach($this->Cart[$v][\"attnd\"] as $attnd){\n\t\t\t\t\t\t\t\tif($TmpCart['attnd'][0]==$attnd) { $newattnd=false; $unigue = false; break; }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($newattnd && count($TmpCart['attnd'])>0) $this->Cart[$v][\"attnd\"][]=$TmpCart['attnd'][0]; // Add our new Attendee\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($this->Cart[$v]['attnd']) && count($this->Cart[$v]['attnd'])>0 && $this->Cart[$v]['attnd']!==0){\n\t\t\t\t\t\t\t$FoundNull=true;\n\t\t\t\t\t\t\twhile($FoundNull){ $FoundNull=false;\n\t\t\t\t\t\t\t\tforeach($this->Cart[$v]['attnd'] as $KeyAttnd => $ValAttnd){\n\t\t\t\t\t\t\t\t\tif( (is_int($ValAttnd) && intval($ValAttnd)==0) || is_null($ValAttnd) ){\n\t\t\t\t\t\t\t\t\t\tunset( $this->Cart[$v]['attnd'][$KeyAttnd] ); $FoundNull=true; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!isset($this->Cart[$v]['attnd']) || $this->Cart[$v]['attnd']===0) $this->Cart[$v]['attnd']=array();\n\t\t\t\t\t\t$this->Cart[$v]['name'] = $TmpCart['name']; // Going to store the name here so we don't have to query the web service for every item in the cart\n\t\t\t\t\t\t$this->Cart[$v][\"type\"] = $TmpCart['type']; // Type 1 = program, Type 2 = product\n\t\t\t\t\t\t//if($TmpCart['type']==1 && count($this->Cart[$v]['attnd'])>0) $this->Cart[$v][\"qty\"]= count($this->Cart[$v]['attnd']); // If product is program quantity equals the number of attendees have a check for zero to allow for item to placed in cart without any attendee's selected\n\t\t\t\t\t\t//else\n\t\t\t\t\t\t$this->Cart[$v][\"qty\"] += $TmpCart[\"qty\"]; $unigue = false; break; // Updates our cart quantitee\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($unigue) $this->Cart[] = $TmpCart; // If we have a unigue item add it to the cart.\n\t}", "public function testManyDisciplinesDiffAmt()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course2);\n $course3 = new Course();\n $course3->set(\"department\",\"MUSI\");\n $course3->set(\"courseTitle\",\"CPSC\");\n $student->set(\"courses\",$course3);\n $course4 = new Course();\n $course4->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course4);\n $course5 = new Course();\n $course5->set(\"department\",\"CPSC\");\n $course5->set(\"courseTitle\",\"MUSI\");\n $student->set(\"courses\",$course5);\n $course6 = new Course();\n $course6->set(\"department\",\"CPSC\");\n $course6->set(\"courseTitle\",\"CPSC\");\n $student->set(\"courses\",$course6);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 3 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }", "private function validate_product_ids() {\n\t\tif ( sizeof( $this->product_ids ) > 0 ) {\n\t\t\t$valid_for_cart = false;\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\tif ( in_array( $cart_item['product_id'], $this->product_ids ) || in_array( $cart_item['variation_id'], $this->product_ids ) || in_array( $cart_item['data']->get_parent(), $this->product_ids ) ) {\n\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_APPLICABLE );\n\t\t\t}\n\t\t}\n\t}", "public function check_cart_items() {\n\t\t$return = true;\n\t\t$result = $this->check_cart_item_validity();\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\twc_add_notice( $result->get_error_message(), 'error' );\n\t\t\t$return = false;\n\t\t}\n\n\t\t$result = $this->check_cart_item_stock();\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\twc_add_notice( $result->get_error_message(), 'error' );\n\t\t\t$return = false;\n\t\t}\n\n\t\treturn $return;\n\n\t}", "public function testCorrectIsStock(){\n\t\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$c= new Trader($a, $b);\n\t\t\tfor($x=0; $x<count($this->validStockList); $x++){\t\t\t\n\t\t\t\t//ACT\n\t\t\t\t$d=$c->isStock($this->validStockList[$x]);\n\t\t\t\t//ASSERT\n\t\t\t\t$this->assertEquals(True,$d);\n\t\t\t}\n\t\t}", "public function test_it_resolves_correct_free_item_qtys()\n {\n $adType = AdType::inRandomOrder()->first();\n\n //3 for the price of 2\n $rule = new XForThePriceOfYRule;\n $rule->setThresholdQty(3);\n $rule->setCalculatedQty(2);\n $rule->setAdType($adType);\n\n //3 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 3, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //4 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 4, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //5 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 5, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //6 eligible items in checkout, should return 2\n $checkoutItems = $this->generateCheckoutItems($adType, 6, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(2, $rule->totalBonusQty($checkoutItems->all()));\n\n //5 for the price of 4\n $rule = new XForThePriceOfYRule;\n $rule->setThresholdQty(5);\n $rule->setCalculatedQty(4);\n $rule->setAdType($adType);\n\n //3 eligible items in checkout, should return 0\n $checkoutItems = $this->generateCheckoutItems($adType, 3, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(0, $rule->totalBonusQty($checkoutItems->all()));\n\n //5 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 5, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //6 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 6, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //10 eligible items in checkout, should return 2\n $checkoutItems = $this->generateCheckoutItems($adType, 10, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(2, $rule->totalBonusQty($checkoutItems->all()));\n }", "public function testOneDiscipline25Courses()\n {\n $result = false;\n $student = new StudentProfile();\n for($i = 0; $i < 25; ++$i)\n {\n $course = new Course();\n $course->set(\"department\",\"MATH\");\n $course->set(\"courseNumber\",$i);\n $student->set(\"courses\",$course);\n }\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 25 && $status[\"result\"] == false)\n $result = true;\n $this->assertEquals(true, $result);\n }", "public function testQuarantineCount()\n {\n\n }", "function validMeal($meal)\r\n {\r\n return in_array($meal, getMeals());\r\n }", "function Step1_IntegrityHard() { return( $this->stepTest( 'integ_') ); }", "function VariationIsInCart() {\r\n\t\t$variations = $this->owner->Variations();\r\n\t\tif($variations) {\r\n\t\t\tforeach($variations as $variation) {\r\n\t\t\t\tif($variation->OrderItem() && $variation->OrderItem()->Quantity > 0) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function testIncorrectIsStock(){\n\t\t\t//Arrange\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$c= new Trader($a, $b);\n\t\t\tfor($x=0; $x<count($this->invalidStockList); $x++){\t\t\t\t\n\t\t\t\t//ACT\n\t\t\t\t$d=$c->isStock($this->invalidStockList[$x]);\n\t\t\t\t//ASSERT\n\t\t\t\t$this->assertEquals(False,$d);\n\t\t\t}\n\n\t\t}", "private function validate_cart_excluded_sale_items() {\n\t\tif ( $this->exclude_sale_items == 'yes' ) {\n\t\t\t$valid_for_cart = true;\n\t\t\t$product_ids_on_sale = wc_get_product_ids_on_sale();\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\tif ( ! empty( $cart_item['variation_id'] ) ) {\n\t\t\t\t\t\tif ( in_array( $cart_item['variation_id'], $product_ids_on_sale, true ) ) {\n\t\t\t\t\t\t\t$valid_for_cart = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ( in_array( $cart_item['product_id'], $product_ids_on_sale, true ) ) {\n\t\t\t\t\t\t$valid_for_cart = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_VALID_SALE_ITEMS );\n\t\t\t}\n\t\t}\n\t}", "public function TieneCobranzasVigentes()\n\t{\n\t\t$q = Doctrine_Query::create()\n\t\t->from('CobranzaLiquidacion cl')\n\t\t->innerJoin('cl.Factura f')\n\t\t->andWhere('f.FechaAnulacion IS NULL')\n\t\t->where('cl.FacturaId = ?', $this->Id);\n\t\t \n\t\t$liquidaciones\t=\t $q->execute();\n\t\t\n\t\tif(count($liquidaciones) > 0)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public function validateHasAppartements() {\n return $this->cart->items()->where( 'class', Appartement::class )->count() > 0;\n }", "public function testTresCeldasIndividuales(CartonInterface $carton) {\n\t$cantcolunacelda = 0;\t\n\t$flag = false;\n\tforeach($carton->columnas() as $col){\n\t\t$cant = 0;\n\t\tforeach($col as $num){\n\t\t\tif($num != 0){\n\t\t\t\t$cant++;\t\t\n\t\t\t}\n\t\t}\n\t\tif($cant == 1){\t\n\t\t\t$cantcolunacelda++;\t\t\n\t\t}\n\t}\n\tif($cantcolunacelda == 3){\n\t\t\t$flag = true;\n\t}\n $this->assertTrue($flag);\n }", "function validMet($selectedMet){\n// $validMetOptions = array(\"1\", \"2\", \"3\", \"4\");\n//\n// //Check each topping and return false if its not valid\n// foreach($validMetOptions as $validMetOption){\n// if(!in_array($validMetOption, $selectedMet)){\n// return false;\n// }\n// }\n//\n// //Option is valid\n// return true;\n if($selectedMet != \"choose\"){\n return true;\n }\n}", "private function validate_cart_excluded_items() {\n\t\tif ( ! $this->is_type( wc_get_product_coupon_types() ) ) {\n\t\t\t$this->validate_cart_excluded_product_ids();\n\t\t\t$this->validate_cart_excluded_product_categories();\n\t\t\t$this->validate_cart_excluded_sale_items();\n\t\t}\n\t}", "function checkHowLongWithDiabetes($checkMe){\n\t// an ugly if statement , there may be return characters (\\n) in this code !!!!!!!!!!!!!!!!!!!!! check.\n\tif($checkMe==\"0-5 years\" || $checkMe==\">5-10 years\" || $checkMe==\">10-15 years\"|| $checkMe==\">10-15 years\"||$checkMe==\">15-20 years\"||$checkMe==\">20 years\"){\n\t\t// if any of the correct answers exists return true for good check\n\t\treturn true;\n\t}else{\n\t\treturn false; // incorrect data here, consider throwing an exception relating to data was modified before a parse ie: fat finger change\n\n\t}\n\n}", "public function testAllOneSectionNoRepeat() {\n\n $this->setFinished($this->section, 8);\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->assertTrue(!isset($practices[2]));\n }", "public function cart_checkFoodItemAvailability($cart_id){\n $food_items_and_qty = $this->model->getQtywithItemCount_cart($cart_id);\n //print_r($food_items_and_qty['data']);\n if($food_items_and_qty['status'] === \"success\"){\n\n foreach($food_items_and_qty['data'] as $item){\n if($item->Quantity > $item->Current_count){\n return ['status'=>'unavail', 'data'=>$item->FoodName];\n }\n }\n return ['status'=>'avail'];\n }\n }", "public function testQuarantineExistsHeadQuarantinesid()\n {\n\n }", "public function inListForItemNotContainedReturnsFalseDataProvider() {}", "public function rules()\n {\n $cart = Auth::user()->cart();\n if (! $cart->count()) {\n $this->merge(['cart' => 0]);\n\n return ['cart' => 'required|min:1'];\n }\n\n $check = $cart->with('variation')->get()->every(function ($item) {\n return $item->quantity <= $item->variation->quantity;\n });\n if (! $check) {\n $this->merge(['check' => $check]);\n\n return ['check' => 'accepted'];\n }\n\n return [];\n }", "public function valid()\n {\n return $this->key() < $this->getTotalItemCount();\n }", "protected function CheckBasketContents()\n {\n if ('basket' !== $this->fieldSystemname) {\n $oBasket = $this->getShopService()->getActiveBasket();\n if ($oBasket->dTotalNumberOfArticles <= 0) {\n $oBasketStep = TdbShopOrderStep::GetStep('basket');\n $this->JumpToStep($oBasketStep);\n }\n }\n }", "function client_have_transactions($id)\n{\n $total_transactions = 0;\n $total_transactions += total_rows('tblinvoices', array(\n 'clientid' => $id\n ));\n $total_transactions += total_rows('tblestimates', array(\n 'clientid' => $id\n ));\n $total_transactions += total_rows('tblexpenses', array(\n 'clientid' => $id,\n 'billable' => 1\n ));\n $total_transactions += total_rows('tblproposals', array(\n 'rel_id' => $id,\n 'rel_type' => 'client'\n ));\n\n if ($total_transactions > 0) {\n return true;\n }\n\n return false;\n}", "public function valid(){\n return $this->index < count($this->ids);\n }", "public function testCheftCantViewHisCarts()\n {\n \t$chef = factory(User::class)->create(['role_id' => 3]);\n \t$cart = factory(Cart::class)->create(['user_id' => $chef->id]);\n \tPassport::actingAs($chef);\n \t$this->json('GET', '/api/cart')->assertStatus(403);\n }", "public function test_filler_candidates()\n {\n $stock = $this->generateStock();\n $order = \\App\\Order::find(1);\n\n $candidates = $this->orders_service->getFillerCandidates($order, $stock);\n\n $this->assertCount(7, $candidates);\n }", "public function belongsToMealWithMinimumSideItems()\n {\n $minimum_required_sideitems = 2;\n $grouped_side_items = DB::table('meal_mealitems')\n ->where('is_main', 0)\n ->get()\n ->groupBy('meal_id');\n\n foreach ($grouped_side_items as $side_items){\n if ($side_items->where('meal_item_id', $this->id)->count() > 0\n && count($side_items) <= $minimum_required_sideitems\n ){\n return true;\n }\n }\n\n return false;\n }", "public function refactorBasedonItems()\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if ($cabinet->wood_xml)\n {\n $woods = self::returnWoodArray($cabinet);\n foreach ($woods AS $wood)\n {\n $this->cabItems += $wood['qty'];\n $this->instItems += $wood['qty'];\n }\n }\n }\n\n /*\n if ($this->cabItems < 30)\n {\n $this->cabItems = 30;\n }\n\n if ($this->instItems < 30 && $this->quote->type != 'Cabinet Small Job')\n {\n $this->instItems = 30;\n }\n\n\n if ($this->instItems > 35 && $this->instItems < 40)\n {\n $this->instItems = 40;\n }\n\n // Start Staging Price Blocks.\n if ($this->cabItems > 30 && $this->cabItems < 40)\n {\n $this->cabItems = 40;\n }\n */\n\n // For Designer\n if ($this->quote->type == 'Full Kitchen' || $this->quote->type == 'Cabinet and Install')\n {\n if ($this->cabItems <= 35)\n {\n $this->forDesigner = $this->getSetting('dL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forDesigner = $this->getSetting('dG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forDesigner = $this->getSetting('dG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forDesigner = $this->getSetting('dG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forDesigner = $this->getSetting('dG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forDesigner = $this->getSetting('dG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forDesigner = $this->getSetting('dG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forDesigner = $this->getSetting('dG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n }\n else\n {\n if ($this->quote->type == 'Cabinet Small Job' || $this->quote->type == 'Builder')\n {\n $this->forDesigner = 250;\n }\n }\n\n // ----------------------- Quote Type Specific values\n\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet Only')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if (!$cabinet->cabinet || !$cabinet->cabinet->vendor)\n {\n echo \\BS::alert(\"danger\", \"Unable To Determine Cabinets\",\n \"Cabinet type has not been selected! Unable to figure multiplier.\");\n return;\n }\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n $amt = ($cabinet->measure) ? 500 : 250;\n $this->forDesigner += $amt;\n $this->setDebug(\"Field Measure for Designer (Y=500/N=250)\", $amt);\n $this->forFrugal += 250; // for cabinet buildup.\n $this->setDebug(\"Frugal got $250 for Buildup\", 250);\n switch ($cabinet->location)\n {\n case 'North':\n $this->forFrugal += 300;\n $this->setDebug(\"Delivery North\", 300);\n break;\n case 'South':\n $this->forFrugal += 200;\n $this->setDebug(\"Delivery South\", 200);\n break;\n default:\n $this->forFrugal += 500;\n $this->setDebug(\"Further than 50m\", 500);\n break;\n }\n } // fe\n }\n else\n {\n if ($this->quote->type == 'Granite Only')\n {\n $this->forInstaller = 0;\n $this->forPlumber = 350;\n $this->forElectrician = 0;\n //$this->appElectrician = 0 ;\n //$this->forDesigner = 0;\n }\n else\n {\n if ($this->quote->type == \"Cabinet and Install\" || $this->quote->type == 'Builder')\n {\n if ($this->quote->type == 'Cabinet and Install')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n }\n\n $this->forInstaller += $this->instItems * 20; // get 20 per installable item not attach\n $this->forFrugal += 250; // For delivery\n $this->forFrugal += 250; // for cabinet buildup.\n $this->forFrugal += $this->instItems * 10; // Cabinet + Install gets $10 for frugal.\n $this->forFrugal += $this->attCount * 30; // Attachment Count.\n } // If it's cabinet install\n else\n {\n if ($this->instItems < 40)\n {\n $this->forInstaller += 500;\n }\n else\n {\n $remainder = $this->instItems - 40;\n $this->forInstaller += 500;\n $this->forInstaller += $remainder * 10;\n } // more than 40\n } // If builder\n } // if cabinet and install or builder\n else\n {\n if ($this->cabItems <= 35)\n {\n $this->forFrugal += $this->getSetting('fL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forFrugal += $this->getSetting('fG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forFrugal += $this->getSetting('fG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forFrugal += $this->getSetting('fG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forFrugal += $this->getSetting('fG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forFrugal += $this->getSetting('fG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forFrugal += $this->getSetting('fG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forFrugal += $this->getSetting('fG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n $this->forFrugal += ($this->attCount * 20);\n $this->setDebug(\"Frugal gets Attachment count * 20\", $this->attCount * 20);\n $this->forInstaller += ($this->instItems * 20);\n $this->setDebug(\"Installer gets Cabinet Installable ($this->instItems * 20)\",\n $this->instItems * 20);\n }\n }\n }\n\n $this->forElectrician += $this->appElectrician;\n $this->forPlumber += $this->appPlumber;\n $this->forInstaller += $this->accInstaller;\n $this->forFrugal += $this->accFrugal;\n // Additional - LED Lighting let's add this.\n $this->forDesigner += $this->designerLED;\n $this->forFrugal += $this->frugalLED;\n $this->forElectrician += $this->electricianLED;\n\n // No electrician or plumber if cabinet + install\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet and Install' || $this->quote->type == 'Cabinet Only')\n {\n $this->forPlumber = 0;\n $this->forElectrician = 0;\n }\n if ($this->quote->type == 'Cabinet Only')\n {\n $this->forInstaller = 0;\n }\n\n if ($this->quote->type == 'Granite Only')\n {\n $this->forElectrician = 0;\n }\n /*\n if ($this->quote->type == 'Cabinet Small Job')\n {\n if (!isset($this->gPrice))\n {\n $this->gPrice = 0;\n }\n\n $gMarkup = $this->gPrice * .2;\n $this->forFrugal += $gMarkup;\n\n $this->setDebug(\"Small Job Marks up Granite 20%\", $gMarkup);\n $sTotal = 0;\n if (isset($this->meta['sinks']))\n {\n foreach ($this->meta['sinks'] AS $sink)\n {\n if (!$sink)\n {\n continue;\n }\n $sink = Sink::find($sink);\n $sTotal += $sink->price;\n }\n $sMarkup = $sTotal * .2;\n $this->setDebug(\"Small Job Marks up Sink Costs 20%\", $sMarkup);\n $this->forFrugal += $sMarkup;\n }\n }\n */\n if ($this->quote->type == 'Cabinet Small Job')\n {\n $markup = $this->total * .4;\n $this->setDebug(\"Applying 40% Markup to Frugal for Cabinet Small Job\", $markup);\n $this->forFrugal = $markup;\n }\n\n // Add for installer to total\n $this->total += $this->forInstaller;\n $this->setDebug(\"Applying Installer Payouts to Quote\", $this->forInstaller);\n $this->total += $this->forElectrician;\n $this->setDebug(\"Applying Electrician Payouts to Quote\", $this->forElectrician);\n $this->total += $this->forPlumber;\n $this->setDebug(\"Applying Plumber Payouts to Quote\", $this->forPlumber);\n if ($this->quote->type != 'Builder')\n {\n $this->total += $this->forFrugal;\n $this->setDebug(\"Applying Frugal Payouts to Quote\", $this->forFrugal);\n }\n $this->total += $this->forDesigner;\n $this->setDebug(\"Applying Designer Payouts to Quote\", $this->forDesigner);\n if ($this->quote->type == 'Builder')\n {\n if ($this->quote->markup == 0)\n {\n $this->quote->markup = 30;\n $this->quote->save();\n }\n\n $perc = $this->quote->markup / 100;\n $markup = $this->total * $perc;\n $this->total += $markup;\n $this->setDebug(\"Applying {$this->quote->markup}% to Total For Builder Markup\", $markup);\n $this->forFrugal = $markup;\n }\n\n }", "public function validateEntries() \n {\n //verify if first entry is a START entry\n $this->firstItemIsStartEntry();\n\n //Detect the right order of entries\n $this->detectRightEntryOrder();\n\n //check if last entry is pause or end when the record is not current\n $this->obligePauseWhenNotCurrent();\n }", "public function CheckLBAndLLMeasures_Present_AllCoreAndElective_OnChecklistPreview(AcceptanceTester $I) {\n $I->amOnPage(Page\\ChecklistPreview::URL($this->id_checklist, $this->id_audSubgroup1_Energy));\n $I->wait(3);\n $I->waitForElement(\\Page\\ChecklistPreview::$ExtensionSelect);\n $I->selectOption(\\Page\\ChecklistPreview::$ExtensionSelect, \"Lg Building + Lg Landscape\");\n $I->wait(2);\n $I->canSee(\"0 Tier 2 measures completed. A minimum of 3 Tier 2 measures are required.\", \\Page\\ChecklistPreview::$TotalMeasuresInfo_ProgressBar);\n $I->canSee(\"0 of 2 required measures completed\", \\Page\\ChecklistPreview::$CoreProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$ElectiveProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$InfoAboutCountToCompleteElectiveMeasures);\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure1Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure2Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure4Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure5Desc));\n $I->canSee(\"$this->pointsMeas1 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure1Desc));\n $I->canSee(\"$this->pointsMeas2 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure2Desc));\n $I->canSee(\"$this->pointsMeas4 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure4Desc));\n $I->canSee(\"$this->pointsMeas5 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure5Desc));\n $I->wait(1);\n $I->click(\\Page\\ChecklistPreview::$LeftMenu_SolidWasteGroupButton);\n $I->wait(2);\n $I->click(\\Page\\ChecklistPreview::LeftMenu_Subgroup_ByName($this->audSubgroup1_SolidWaste));\n $I->wait(2);\n $I->canSee(\"0 Tier 2 measures completed. A minimum of 3 Tier 2 measures are required.\", \\Page\\ChecklistPreview::$TotalMeasuresInfo_ProgressBar);\n $I->canSee(\"0 of 1 required measures completed\", \\Page\\ChecklistPreview::$CoreProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$ElectiveProgressBarInfo);\n $I->cantSeeElement(\\Page\\ChecklistPreview::$InfoAboutCountToCompleteElectiveMeasures);\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure7Desc));\n $I->canSeeElement(\\Page\\ChecklistPreview::MeasureDescription_ByDesc($this->measure8Desc));\n $I->canSee(\"$this->pointsMeas7 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure7Desc));\n $I->canSee(\"$this->pointsMeas8 Points\", \\Page\\ChecklistPreview::MeasurePoints_ByDesc($this->measure8Desc));\n }", "public function testDeclined(){ \n\n $unBuyableProduct = Product::where('price', '>', 75)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($unBuyableProduct, $this->testVisaPan);\n $response->assertSee(\"Declined\");\n\n\n //test card 2\n $response = $this->checkoutAction($unBuyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Declined\"); \n \n }", "function checkQuantity($userid, $recipeid, $ingredient){\n\t if(($recipeid != NULL) && ($userid != NULL) && ($ingredient != NULL)){\n\t\t if($this->checkInventory($userid,$ingredient))\n\t\t\t {\n\t\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Ingredients WHERE (Recipe = '$recipeid' AND IngredientName = '$ingredient')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0)\n\t\t return false;\n\t\t\t\t\t $tmp = @mysql_query(\"SELECT * FROM Inventory WHERE (UserID = '$userid' AND IngredientName='$ingredient')\");\n\t\t\t $tmp1 = mysql_fetch_assoc($tmp);\n\t\t\t\t\t $qty1 = $tmp1['Quantity'];\n\t\t\n\t\t\t\t\t $tmpx = @mysql_query(\"SELECT * FROM Ingredients WHERE (Recipe = '$recipeid' AND IngredientName='$ingredient')\");\n\t\t\t $tmp2 = mysql_fetch_assoc($tmpx);\n\t\t\t\t\t $qty2 = $tmp2['Quantity'];\n\t\t\t\t\n\t\t\t\t\t if ($qty1 >= $qty2)\n\t\t\t\t\t return true;\n\t\t\t\t else \n\t\t\t\t\t return false;\n\t\t\t }\n\t\t\t else\n\t\t\t return false;\n\t\t }\n\t\t else\n\t\t return false;\n\t}", "public function testHasItemInBox()\n {\n $box = new Box(['cat', 'toy', 'torch']);\n //Se espera que para esta entrada se regrese un True como respuesta,\n //puesto que el elemento toy existe.\n $this->assertTrue($box->has('toy'));\n //Se espera que para esta entrada se regrese un False como respuesta,\n //puesto que el elemento ball no existe.\n $this->assertFalse($box->has('ball'));\n }", "public function hasActdiscount(){\n return $this->_has(34);\n }", "private function checkCartStatus()\n {\n if ($this->quote->getIsActive()=='0') {\n $this->getMagentoOrderId();\n throw new \\Exception(self::CMOS_ALREADY_PROCESSED);\n }\n }", "function assert_is_workflow_net($petrinet) {\n if (count($petrinet[\"source_places\"]) == 0) {\n terminate(\"The petri net has no source places and therefore is no workflow net\");\n }\n if (count($petrinet[\"source_places\"]) > 1) {\n terminate(\"The petri net has more than one source place and therefore is no workflow net\");\n }\n if (count($petrinet[\"sink_places\"]) == 0) {\n terminate(\"The petri net has no sink places and therefore is no workflow net\");\n }\n if (count($petrinet[\"sink_places\"]) > 1) {\n terminate(\"The petri net has more than one sink place and therefore is no workflow net\");\n }\n if (count($petrinet[\"markings\"]) == 0) {\n terminate(\"The petri net has zero initial markings and therefore is no workflow net\");\n }\n if (count($petrinet[\"markings\"]) > 1) {\n terminate(\"The petri net has more than one initial marking and therefore is no workflow net\");\n }\n }", "public function hasQuantity(): bool;", "public function testOneDiscipline24Courses()\n {\n $result = false;\n $student = new StudentProfile();\n for($i = 0; $i < 24; ++$i)\n {\n $course = new Course();\n $course->set(\"department\",\"MATH\");\n $course->set(\"courseNumber\",$i);\n $student->set(\"courses\",$course);\n }\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 24 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }", "public function valid()\n\t{\n\t\treturn $this->key() < $this->_totalItemCount;\n\t}", "public function check()\n {\n foreach ($this->options as $id => $option) {\n $option->check();\n }\n }", "function validsubcat($subcatid, $cats)\n{\n $i = 0;\n if ((is_countable($cats) ? count($cats) : 0) > 0) {\n }\n foreach ($cats as $cat) {\n $subcats = $cat['subcategory'];\n if ((is_countable($subcats) ? count($subcats) : 0) > 0) {\n foreach ($subcats as $subcat) {\n if ($subcat['id'] == $subcatid) {\n return true;\n }\n }\n }\n }\n return false;\n}", "public function testTwoDisciplinesDiffAmtCourses()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course2);\n $course3 = new Course();\n $course3->set(\"department\",\"CPSC\");\n $course3->set(\"courseTitle\",\"CPSC\");\n $student->set(\"courses\",$course3);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 2 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }", "function check_item_main_valid() {\n\t\t$item_main = $this->data['item_main'];\n\t\t$call_list_id = $this->ESession->getCallListId($this);\n\t\t$t13_list_item = $this->T13InboundListItem->getColumnListByItemName($call_list_id, $item_main);\n\t\t$item_main_col = $t13_list_item['T13InboundListItem']['column'];\n\n\t\t$arr_item_main = $this->T17InboundTelList->getDataItemMainByIdAndItemMain($call_list_id, $item_main_col);\n\t\t$arr_item_main_diff = array_diff($arr_item_main, array(''));\n\t\t$arr_item_main_unique = array_unique($arr_item_main_diff);\n\t\tif (count($arr_item_main) == count($arr_item_main_unique)) {\n\t\t\techo 'true';\n\t\t\texit;\n\t\t}\n\t\techo 'false';\n\t\texit;\n\t}", "public function checkOrganisasiBeforeDelete($kec_id);", "public function valid() {\n return $this->pointer < count($this->items);\n }", "public function validateStock()\n {\n $valid = true;\n $id_user = $this->session->userdata('id_user');\n $cart = $this->where('id_user', $id_user)->get();\n \n foreach ($cart as $row) {\n $this->table = 'barang';\n $barang = $this->where('id', $row->id_barang)->first(); \n \n if (($barang->qty - $row->qty) < 0) {\n $this->session->set_flashdata(\"qty_cartout_$row->id\", \"Stock hanya ada $barang->qty\");\n $valid = false;\n }\n\n $this->table = 'keranjang_keluar';\n }\n\n return $valid;\n }", "public function hasTips(){\n return $this->_has(19);\n }", "private function validate_product_categories() {\n\t\tif ( sizeof( $this->product_categories ) > 0 ) {\n\t\t\t$valid_for_cart = false;\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\t$product_cats = wc_get_product_cat_ids( $cart_item['product_id'] );\n\n\t\t\t\t\t// If we find an item with a cat in our allowed cat list, the coupon is valid\n\t\t\t\t\tif ( sizeof( array_intersect( $product_cats, $this->product_categories ) ) > 0 ) {\n\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_APPLICABLE );\n\t\t\t}\n\t\t}\n\t}", "public function test_validate_deposit_count()\n {\n $deposit = $this->obj->validate_count(1);\n $resp = $this->obj->validate_deposit_count();\n if($deposit < 4){\n $this->assertTrue($resp);\n }else{\n $this->assertFalse($resp);\n }\n }", "public function testGetTechnologies_CheckItems(): void\n {\n $expectTotalTechnology = 1;\n $expectTotalTechnologyItems = 2;\n $service = $this->app->get(TechnologyService::class);\n TechnologyModelFactory::new()\n ->has(TechnologyItemsModelFactory::new()->count(2), 'items')\n ->has(TechnologyItemsModelFactory::new()->inactive()->count(2), 'items')\n ->count(1)\n ->create();\n\n $results = $service->getTechnologies();\n\n $this->assertIsArray($results);\n $this->assertCount($expectTotalTechnology, $results);\n }", "public function validateCart($cart = null)\n {\n\n $check = true;\n $messages = [];\n\n if(!$cart) {\n $cart = $this->getCart(['cartItems.product']);\n }\n\n // Check we actually have items\n if(count($cart->cartItems) <= 0) {\n $check = false;\n \\Notification::warning('There are no items in your cart.');\n }\n\n\n // Check the validity of all cart items\n $cart->cartItems->each(function($item){\n if (!$item->valid){\n $check = false;\n \\Notification::warning('An item in your cart is invalid. Please either remove or replace it.');\n }\n\n });\n\n foreach($cart->cartItems->groupBy('product_id') as $itemGroup) {\n\n $cartQuantity = 0;\n\n foreach($itemGroup as $item) {\n $cartQuantity += $item->quantity;\n }\n\n $product = $itemGroup->first()->product;\n\n // Check product stock\n if (!$product->checkStock($cartQuantity)) {\n $check = false;\n \\Notification::warning('We don\\'t have enough of this product in stock.');\n }\n\n // Check product extras stock\n// foreach($product->extras as $extra) {\n// if (!$extra->checkStock($cartQuantity)) {\n// $check = false;\n// \\Notification::warning('We don\\'t have enough of this product extra in stock.');\n// }\n// };\n\n };\n\n return [\n 'check' => $check,\n 'messages' => $messages\n ];\n\n\n // Check that item products exist\n\n // Check that item options exist\n\n // Check that item extras exist\n\n\n // Check that item product has stock\n\n\n // Check that item extras have stock\n\n\n\n\n }", "public function hayCesta(){\r\n\t\t\treturn (count($this->listArticulos)>0)?1:0;\r\n\t\t}", "public function testGetItems()\n {\n $this->addItem();\n $this->addItem();\n\n $items = $this->laracart->getItems();\n\n $this->assertInternalType('array', $items);\n\n $this->assertCount(1, $items);\n\n $this->containsOnlyInstancesOf(LukePOLO\\LaraCart\\CartItem::class, $items);\n }", "public function checkAllTicketsAndCarts(){\n date_default_timezone_set(\"Europe/Amsterdam\");\n\n $tickets = Ticket::all();\n $now = date(\"Y-m-d H:i:s\");\n $now = strtotime($now);\n\n foreach($tickets as $key => $ticket) {\n if(isset($ticket->reservation) && $ticket->reservation->status == 'R') {\n $reservationExpiration = strtotime($ticket->reservation->created_at->toDateTimeString() . ' +10 seconds');\n if ($now >= $reservationExpiration ) {\n $reservation = Reservation::where('ticket_id', $ticket->id)->first();\n\n $cartContent = Cart::restoreFromDB($reservation->buyer_id);\n\n if($cartContent) {\n foreach($cartContent as $cartItem) {\n if($cartItem->id == $ticket->id) {\n $cartContent->pull($cartItem->rowId); \n }\n }\n $cartContent = serialize($cartContent);\n\n DB::table('shoppingcart')\n ->where('identifier', $reservation->buyer_id)\n ->update(['content' => $cartContent]);\n }\n }\n }\n }\n }", "public function check() : bool\n { \n foreach($this->caller->numbersCalled as $key => $number)\n {\n \n foreach ($this->card->numbers as $key => $cardLine) \n {\n \n if(in_array($number, $cardLine)){\n $this->confirmations++;\n continue 2;\n }\n\n }\n }\n\n if($this->confirmations<24)\n {\n return false;\n }\n\n return true;\n }", "function checkInventory($userid, $ingredient){\n\t\n\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Inventory WHERE (UserID = '$userid' \n\t\t AND IngredientName = '$ingredient')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0)\n\t\t return false;\n\t\t else return true;\n\t}", "abstract public function check();", "private function validateFlowPrime($items) {\n $valid = true;\n\n foreach ($items as $item) {\n if (!isset($item['type']) || !class_exists($item['type'])) {\n continue;\n }\n if (is_subclass_of($item['type'], 'MultiChildNode')) {\n $nodeClass = $item['type'];\n if (isset($item['type'][$nodeClass::getLeftChildName()])) {\n if (!$this->validateFlowPrime($item[$nodeClass::getLeftChildName()])) {\n $valid = false;\n break;\n }\n }\n if (isset($item['type'][$nodeClass::getRightChildName()])) {\n if (!$this->validateFlowPrime($item[$nodeClass::getRightChildName()])) {\n $valid = false;\n break;\n }\n }\n } else {\n $valid = $this->validateFlowItem($item);\n if (!$valid) {\n break;\n }\n }\n }\n return $valid;\n }", "private static function canAllParticipate($exercise) {\n\t\treturn \tempty($exercise['limited_space'])\n\t\t\t\t&& empty($exercise['expert']);\n\t}", "public function checkStock()\n {\n if ($this->qty > ($this->beer->stock - $this->beer->requested_stock)){\n return false;\n }\n\n return true;\n }", "function testAppreciatingNonperishableItem() {\n $items = array(new Item('Aged Brie', 2, 0));\n $gildedRose = new GildedRose($items);\n \n // check that item increases quality as expected\n $gildedRose->update_quality();\n $this->assertEquals(1, $items[0]->sell_in);\n $this->assertEquals(1, $items[0]->quality);\n\n // second iteration for assurance \n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(2, $items[0]->quality);\n\n // ensure item does not degrade below a quality of 0\n $gildedRose->update_quality();\n $this->assertEquals(0, $items[0]->sell_in);\n $this->assertEquals(3, $items[0]->quality);\n }", "function validMeal($meal)\n{\n global $f3;\n return in_array($meal, $f3->get('meals'));\n}", "abstract function check();", "public function testGetPriceChildren()\n {\n $value = Yaml::parseFile(__DIR__.'/../../config/contraints/config.yaml');\n $expectedResult = $value['TicketPrice']['prices']['children'];\n\n $reduced = false;\n $halfday = false;\n $birthdate = new DateTime('2015-01-01');\n\n $ticket = new TicketPrice();\n $result = $ticket->getPrice($birthdate, $reduced, $halfday);\n \n $this->assertEquals($expectedResult, $result);\n }", "public function hasPrecost(){\n return $this->_has(25);\n }", "public function test_validate_withdraw_count()\n {\n $withdraw = $this->obj->validate_count(2);\n $resp = $this->obj->validate_withdraw_count();\n if($withdraw < 3){\n $this->assertTrue($resp);\n }else{\n $this->assertFalse($resp);\n }\n }", "function scheckAusdruck()\r\n {\r\n foreach ($this->belegschaft as $schluessel=>$wert)\r\n $this->belegschaft[$schluessel]->scheckAusdruck();\r\n }", "public static function checkProductArrayValidity($articleInfo) {\n\t\t// Rework params\n\t\t$articleInfo = (array) $articleInfo;\n\n\t\t// Create some new arrays for Checking\n\t\t$productIds = array();\n\t\t$condimentIds = array();\n\t\t$productCount = ['count' => 0];\n\t\t$condimentCount = ['count' => 0];\n\n\t\tforeach ($articleInfo as $articleRow) {\n\t\t\tif (!in_array($articleRow['id'], $productIds)) {\n\t\t\t\t$productIds[] = $articleRow['id'];\n\t\t\t}\n\n\t\t\tif ($articleRow['sauceId'] !== 0 && !in_array($articleRow['sauceId'], $condimentIds)) {\n\t\t\t\t$condimentIds[] = $articleRow['sauceId'];\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t$db = new OneArchyDB(F2T_DB_HOST, F2T_DB_NAME, F2T_DB_USER, F2T_DB_PASS);\n\t\t\t$db->connect();\n\n\t\t\tif (count($productIds) > 0) {\n\t\t\t\t$parameterLine = '(' . implode(',', array_fill(0, count($productIds), '?')) . ')';\n\t\t\t\t$query = 'SELECT COUNT(*) AS count FROM Products WHERE id IN ' . $parameterLine;\n\t\t\t\t$productCount = $db->queryOne($query, $productIds);\n\t\t\t}\n\n\t\t\tif (count($condimentIds) > 0) {\n\t\t\t\t$parameterLine = '(' . implode(',', array_fill(0, count($condimentIds), '?')) . ')';\n\t\t\t\t$query = 'SELECT COUNT(*) AS count FROM Condiments WHERE id IN ' . $parameterLine;\n\t\t\t\t$condimentCount = $db->queryOne($query, $condimentIds);\n\t\t\t}\n\n\t\t\tif (count($productIds) === $productCount['count'] && count($condimentIds) === $condimentCount['count']) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n $errorMessage = 'Er is een fout opgelopen bij het tellen van producten en sauzen.';\n\n if ($db !== null) {\n\t\t\t\t$debugInfo = [\n\t\t\t\t\t'exception' => $e->getMessage(),\n\t\t\t\t\t'articleInfo' => $articleInfo,\n\t\t\t\t\t'productIds' => $productIds,\n\t\t\t\t\t'condimentIds' => $condimentIds,\n\t\t\t\t\t'productCount' => $productCount,\n\t\t\t\t\t'condimentCount' => $condimentCount,\n\t\t\t\t\t'parameterLine' => $parameterLine,\n\t\t\t\t\t'query' => $query,\n\t\t\t\t\t'site' => 'checkout'\n\t\t\t\t];\n\n $db->logError($errorMessage, $debugInfo);\n }\n\n\t\t\tthrow new Exception($errorMessage);\n\t\t}\n\n\t\treturn false;\n\t}", "public function checkTransaction()\n {\n $model = $this->hasMany(LogWarehouse::className(),['parts_accessories_id'=>'_id'])->count();\n if($model>0){\n return true;\n } else {\n return false;\n }\n }", "function validMeal($meal)\n {\n global $meals; //This is defined in the controller\n return in_array($meal, $meals);\n }", "private function checkCdata()\n {\n $ymlFile = new \\DOMDocument();\n $ymlFile->loadXML(\\file_get_contents($this->settings->getOutputFile()));\n\n $xpath = new \\DOMXPath($ymlFile);\n $descriptionNodes = $xpath->query('//yml_catalog/shop/offers/offer/description');\n self::assertNotFalse($descriptionNodes);\n\n // One description per offer is expected\n self::assertEquals(self::OFFER_COUNT, $descriptionNodes->length);\n\n foreach ($descriptionNodes as $descriptionNode) {\n $description = $descriptionNode->nodeValue;\n\n self::assertSame(self::CDATA_TEST_STRING, $description);\n }\n }", "function wp_category_checklist($post_id = 0, $descendants_and_self = 0, $selected_cats = \\false, $popular_cats = \\false, $walker = \\null, $checked_ontop = \\true)\n {\n }", "public function testGetDuplicateItemSubCategoryById()\n {\n }", "function fail_arrangement_discount($parameters) \n\t{\n\t\t$discounts = array();\n\t\t//get_log('scheduling')->Write(print_r($parameters->schedule, true));\n\t\tforeach ($parameters->schedule as $e) \n\t\t{\n\t\t\tif (($e->context == 'arrangement' || $e->context == 'partial') && \n\t\t\t (in_array($e->type, array('adjustment_internal', 'adjustment_internal_fees', 'adjustment_internal_princ')))) {\n\t\t\t \tif ($e->status == 'scheduled') \n\t\t\t\t{\n\t\t\t \t\tRecord_Scheduled_Event_To_Register_Pending($e->date_event, $parameters->application_id, $e->event_schedule_id);\n\t\t\t \t\tRecord_Event_Failure($parameters->application_id, $e->event_schedule_id);\n\t\t\t \t} \n\t\t\t\telseif ($e->status != 'failed') \n\t\t\t\t{\n\t\t\t\t\tRecord_Transaction_Failure($parameters->application_id, $e->transaction_register_id);\n\t\t\t \t}\n\t\t\t}\n\t\t}\n\t}", "public function testIncorrectCanBuyWithOneShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(99);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$c->buyStock(NULL, 0);\n\t\t\t$c->sellStock(NULL, 0);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "public function inListForItemContainedReturnsTrueDataProvider() {}", "protected function _fcpoCheckTxid()\n {\n $blAppointedError = false;\n $sTxid = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoTxid');\n\n $sTestOxid = '';\n if ($sTxid) {\n $sQuery = \"SELECT oxid FROM fcpotransactionstatus WHERE FCPO_TXACTION = 'appointed' AND fcpo_txid = '\" . $sTxid . \"'\";\n $sTestOxid = $this->_oFcpoDb->getOne($sQuery);\n }\n\n if (!$sTestOxid) {\n $blAppointedError = true;\n $this->oxorder__oxfolder = new oxField('ORDERFOLDER_PROBLEMS', oxField::T_RAW);\n $oLang = $this->_oFcpoHelper->fcpoGetLang();\n $sCurrentRemark = $this->oxorder__oxremark->value;\n $sAddErrorRemark = $oLang->translateString('FCPO_REMARK_APPOINTED_MISSING');\n $sNewRemark = $sCurrentRemark.\" \".$sAddErrorRemark;\n $this->oxorder__oxremark = new oxField($sNewRemark, oxField::T_RAW);\n }\n $this->_fcpoSetAppointedError($blAppointedError);\n\n return $blAppointedError;\n }", "public function testGetItemEligibilityPreview()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testFlagRetrieval()\n {\n /*$narratives = Narrative::all();\n\n $this->assertNotEmpty($narratives);*/\n\n }", "function testConjuredItems() {\n $items = array(\n new Item('Conjured Mana Cake', 3, 8)\n , new Item('Conjured Mana Cake', 1, 8)\n , new Item('Conjured Mana Cake', 0, 3)\n );\n $gildedRose = new GildedRose($items);\n \n // test assertions\n $gildedRose->update_quality();\n // Conjured items degrade 2 in a normal day\n $this->assertEquals(2, $items[0]->sell_in);\n $this->assertEquals(6, $items[0]->quality);\n\n // check for a degrade of 2 that will increase to 4 upon expiration \n $this->assertEquals(0, $items[1]->sell_in);\n $this->assertEquals(6, $items[1]->quality);\n\n // ensure can't return negative sell_in values, and non-negative qualities\n $this->assertEquals(0, $items[2]->sell_in);\n $this->assertEquals(0, $items[2]->quality);\n \n // second iteration to test progressions\n $gildedRose->update_quality();\n // Conjured items degrade 2 in a normal day\n $this->assertEquals(1, $items[0]->sell_in);\n $this->assertEquals(4, $items[0]->quality);\n\n // check for a degrade of 2 that will increase to 4 upon expiration \n $this->assertEquals(0, $items[1]->sell_in);\n $this->assertEquals(2, $items[1]->quality);\n\n // ensure can't return negative sell_in values, and non-negative qualities\n $this->assertEquals(0, $items[2]->sell_in);\n $this->assertEquals(0, $items[2]->quality);\n\n }", "function item_quantities_none() {\r\n //if( isset($edd_options['coopshares_fair_checkout_info']) ) {\r\n // return true;\r\n //} else {\r\n return false;\r\n //}\r\n}", "public function isCorrect()\n\t{\n\t\treturn ($this->m_items) || ($this->m_item);\n\t}", "function validToppings($toppings)\n {\n $validToppings = array(\"pepperoni\", \"sausage\",\n \"olives\", \"artichokes\", \"anchovies\");\n\n\t\t// heck each selected topping, and return false\n\t\t// f it's not valid\n \t\tforeach ($toppings as $topping)\n {\n\t\t\tif (!in_array($topping, $validToppings))\n {\n \t\t\treturn false;\n\t\t\t}\n\t\t}\n \n \n\t\t// If we made it this far, all our toppings are valid\n\t\treturn true;\n }", "function order_contains_equal_plates_and_engravings($order) {\n if (!empty($order->commerce_line_items)) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n $plates = 0;\n $engravings = 0;\n\n foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {\n if (!empty($line_item_wrapper->value()->commerce_product) && $line_item_wrapper->commerce_product->value()->type == 'plates') {\n $plates++;\n }\n\n if ($line_item_wrapper->value()->type == 'engraving') {\n $engravings++;\n }\n }\n\n // If there is an equal number\n if (($engravings + $plates == 0) || ($engravings == $plates)) {\n return TRUE;\n }\n }\n\n return FALSE;\n}", "public function isApplicable() : bool{\r\n $items = $this->order->getOrderItems();\r\n foreach($items as $item){\r\n // checks every item for order if the quantity is >= $products_nr\r\n if($item[\"quantity\"] >= $this->products_nr){\r\n $tmp_item = $this->order->getProductById($item[\"product-id\"]);\r\n\r\n // checks if product category equals $category_id \r\n if((int)$tmp_item[\"category\"] === $this->category_id){\r\n $tmp_item[\"qty\"] = $item[\"quantity\"];\r\n\r\n // saves the discounted items in a temporary array\r\n $this->items_matching[] = $tmp_item;\r\n\r\n // stores the total cost of the discount\r\n $this->discounted_value += $tmp_item[\"price\"] * floor($item[\"quantity\"] / $this->products_nr);\r\n }\r\n }\r\n }\r\n\r\n if($this->discounted_value > 0){\r\n $this->is_applicable = true;\r\n $this->calculateDiscount();\r\n return true; \r\n }\r\n return false;\r\n }", "public function testGetAllParents() {\n // Declare\n $name = 'Pricing Tools (Child)';\n\n // Create\n $ph_kb_category = $this->phactory->create('kb_category');\n $ph_kb_category_child = $this->phactory->create( 'kb_category', array( 'parent_id' => $ph_kb_category->id, 'name' => $name ) );\n\n // Get all categories\n $categories = $this->kb_category->get_all_parents( $ph_kb_category_child->id );\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( self::NAME, $category->name );\n }", "function testPerishableItems() {\n $items = array(\n new Item('Backstage passes to a TAFKAL80ETC concert', 11, 20)\n , new Item('Backstage passes to a TAFKAL80ETC concert', 6, 30)\n , new Item('Backstage passes to a TAFKAL80ETC concert', 2, 40)\n , new Item('Backstage passes to a TAFKAL80ETC concert', 20, 50)\n );\n $gildedRose = new GildedRose($items);\n \n // test assertions\n $gildedRose->update_quality();\n // over 10 days remaining should increase quality by 1\n $this->assertEquals(10, $items[0]->sell_in);\n $this->assertEquals(21, $items[0]->quality);\n\n // 6-10 days remaining should increase quality by 2\n $this->assertEquals(5, $items[1]->sell_in);\n $this->assertEquals(32, $items[1]->quality);\n\n // 1-5 days remaining should increase quality by 3\n $this->assertEquals(1, $items[2]->sell_in);\n $this->assertEquals(43, $items[2]->quality);\n\n // quality should never increase beyond 50\n $this->assertEquals(19, $items[3]->sell_in);\n $this->assertEquals(50, $items[3]->quality);\n\n // second iteration to test progressions\n $gildedRose->update_quality();\n // 6-10 days remaining should increase quality by 2\n $this->assertEquals(9, $items[0]->sell_in);\n $this->assertEquals(23, $items[0]->quality);\n\n // 1-5 days remaining should increase quality by 3\n $this->assertEquals(4, $items[1]->sell_in);\n $this->assertEquals(35, $items[1]->quality);\n\n // once product expires, the quality should fall to 0\n $this->assertEquals(0, $items[2]->sell_in);\n $this->assertEquals(0, $items[2]->quality);\n\n // quality should never increase beyond 50\n $this->assertEquals(18, $items[3]->sell_in);\n $this->assertEquals(50, $items[3]->quality);\n }", "public function testCategoryCanNotBeItsOwnParent(): void\n {\n $items = Category::factory()->count(1)->create();\n\n Livewire::actingAs(User::factory()->admin()->create())\n ->test(CategoriesTable::class, ['items' => $items])\n ->emit('edit', $items[0]->id)\n ->set('editValues.parent_id', $items[0]->id)\n ->emit('save')\n ->assertHasErrors(['editValues.parent_id'])\n ->assertDispatchedBrowserEvent('notify', function ($name, $data) {\n return data_get($data, 'level') === 'error';\n });\n\n $this->assertEquals(0, $items[0]->fresh()->parent()->count());\n }", "public function testIncorrectCanBuyWithOneALotShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(9);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock, 10);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "public function testTwoDisciplines()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course2);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 1 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }", "private function _checkQty($items)\n {\n if (!is_numeric($items['qty']) or $items['qty'] == 0)\n {\n throw new \\Exception('The parameter qty must be in numeric and different from zero.');\n return FALSE;\n }\n }", "public function _assertStoreCartHasProductsWithMinimalQuantity()\n {\n }", "public function testManyDisciplineNameReturn()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course2);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 1 && $status[\"result\"] == true && $status[\"dept\"] == (\"MUSI,CPSC\"))\n $result = true;\n $this->assertEquals(true, $result);\n }" ]
[ "0.56047094", "0.53368104", "0.53189075", "0.5258508", "0.52559185", "0.5225007", "0.512455", "0.5117181", "0.5106038", "0.51001006", "0.50958437", "0.5092517", "0.5081725", "0.50704736", "0.5058316", "0.5018543", "0.5010633", "0.50097203", "0.4986379", "0.49745286", "0.49733815", "0.4972272", "0.49619216", "0.49597603", "0.49479887", "0.49474654", "0.49436378", "0.4936643", "0.49275637", "0.49263522", "0.49263132", "0.4926124", "0.4916147", "0.49133965", "0.48985863", "0.4891573", "0.4883306", "0.48713034", "0.48670232", "0.48604473", "0.4858921", "0.48477486", "0.48370212", "0.48245573", "0.48239034", "0.4818232", "0.48125133", "0.48052925", "0.48030934", "0.4790722", "0.4789057", "0.47835776", "0.47694805", "0.47656953", "0.47617835", "0.4749481", "0.47494757", "0.4745767", "0.47450835", "0.4745049", "0.47426525", "0.4738055", "0.47164914", "0.47158265", "0.47156522", "0.4714588", "0.47114375", "0.4708517", "0.47070444", "0.4705892", "0.47031763", "0.46995994", "0.4691466", "0.46905604", "0.46835032", "0.46796966", "0.46729505", "0.4663583", "0.46623638", "0.46597034", "0.4657018", "0.46495682", "0.4646993", "0.46464378", "0.4645094", "0.46413335", "0.46385306", "0.46374068", "0.46354908", "0.46316424", "0.46258545", "0.46229514", "0.4611215", "0.46065333", "0.4601666", "0.45985785", "0.45966813", "0.4596546", "0.45959744", "0.45942995", "0.45898023" ]
0.0
-1
Run the database seeds.
public function run() { foreach (json_decode(Storage::get('provinsi.json')) as $row){ Provinsi::create([ 'no_prov' => $row->no_prov, 'nama' => $row->nama ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
/$idventa = $idventa_reg; $alm=$this>Empresa_model>leerAlmacenIdentificadorEmpresa($this>session>sucursal>idempresa); $emp=$this>Empresa_model>leerEmpresaPorIdentificador($alm>rel_empresa); Informacion del registro de venta $registro_venta = $this>Venta_model>leerRegistroVenta($idventa); Detalle de venta $detalle_venta = $this>Venta_model>leerDetalleVenta($idventa); La factura que corresponde al registro de venta $id_factura = $this>Factura_model>leerFacturaPorRegistro($idventa); $factura = $this>Factura_model>leerFacturaPorID($id_factura); Datos de facturacion $datos_facturacion = $this>Venta_model>leerDatosFacturacion($this>session>sucursal>idempresa); $dts['almacen']=$alm>nombre_almacen; $dts['empresa']=$emp; $dts['registro_venta'] = $registro_venta; $dts['detalle_venta'] = $detalle_venta; $dts['contador']=count($detalle_venta); $dts['factura'] = $factura; $dts['datos_facturacion'] = $datos_facturacion; $descuento_calculado = round(($registro_venta>descuento_total / 100) $registro_venta>total, 0, PHP_ROUND_HALF_DOWN); $total=$registro_venta>total $descuento_calculado; $numero=floor($total); $dts['literal']=strtoupper($this>numeroliteral>literal($numero)); $dts['centavos']=round(($total$numero)100); $this>load>view('facturacion/vfacturacion_imprimirgrande.php',$dts);
public function imprimirFacturaGrande($idventa_reg) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onDevolucion() {\n try {\n if ($this->input->post('Venta') !== '' && $this->input->post('Venta') > 0) {\n $Datos = $this->ventas_model->onCrearFolio($this->input->post('TP'));\n $vta = $this->dvm->getVentabyID($this->input->post('Venta'));\n /* GENERAR VENTA */\n $Folio = $Datos[0]->FolioTienda;\n if (empty($Folio)) {\n $Folio = 1;\n } else {\n $Folio = $Folio + 1;\n }\n $diff = $this->input->post('DiferenciaACobrar');\n $supago = str_replace(\",\", \"\", $this->input->post('SuPago'));\n $data = array(\n 'TipoDoc' => $vta[0]->TipoDoc,\n 'Tienda' => $this->session->userdata('TIENDA'),\n 'FolioTienda' => $Folio,\n 'Cliente' => $vta[0]->Cliente,\n 'Vendedor' => $this->session->userdata('ID'),\n 'FechaCreacion' => Date('d/m/Y h:i:s a'),\n 'FechaMov' => Date('d/m/Y h:i:s a'),\n 'MetodoPago' => $this->input->post('MetodoDePago'),\n 'Estatus' => 'CERRADA',\n 'Importe' => ($diff > 0) ? $diff : 0,\n 'Usuario' => $this->session->userdata('ID'),\n 'SuPago' => $supago,\n 'ImporteEnLetra' => $this->input->post('ImporteEnLetra'),\n 'Tipo' => 'D'\n );\n $ID = $this->dvm->onAgregar($data);\n print '{ \"ID\":' . $ID . '}'; /* ID REQUERIDO PARA EL TICKET */\n $data = array(\n 'Venta' => $this->input->post('Venta'),\n 'TipoDoc' => $vta[0]->TipoDoc,\n 'Tienda' => $this->session->userdata('TIENDA'),\n 'FolioTienda' => $Folio,\n 'Cliente' => $vta[0]->Cliente,\n 'Vendedor' => $this->session->userdata('ID'),\n 'FechaCreacion' => Date('d/m/Y h:i:s a'),\n 'FechaMov' => Date('d/m/Y h:i:s a'),\n 'MetodoPago' => $this->input->post('MetodoDePago'),\n 'Estatus' => 'CERRADA',\n 'Importe' => ($diff > 0) ? $diff : 0,\n 'Usuario' => $this->session->userdata('ID'),\n 'SuPago' => $this->input->post('SuPago'),\n 'ImporteEnLetra' => $this->input->post('ImporteEnLetra'),\n 'Tipo' => 'D'\n );\n $IDD = $this->dvm->onAgregarDevolucion($data);\n\n /* DETALLE DE LA VENTA DEVUELTO */\n $DetalleDevuelto = json_decode($this->input->post(\"DetalleDevuelto\"));\n foreach ($DetalleDevuelto as $key => $v) {\n /* AGREGAR LOS PRODUCTOS DEVUELTOS (SUMAR) */\n\n /* OBTENER SERIE X ESTILO */\n $serie = $this->dvm->getSerieXEstilo($v->Estilo);\n\n /* ACTUALIZA LAS EXISTENCIAS DE LA TIENDA DESTINO */\n $existencia = 0;\n for ($index = 1; $index <= 22; $index++) {\n /* CONSULTAR EXISTENCIAS DE LA TIENDA DESTINO */\n $existencias = $this->dvm->getExistenciasXTiendaXEstiloXColor($this->session->userdata('TIENDA'), $v->Estilo, $v->Color);\n /* COMPROBAR EXISTENCIAS EN LA TIENDA ORIGEN TENGA DISPONIBLES DE LA TALLA SOLICITADA */\n $existencias_disponibles = $this->dvm->getExistenciasXTiendaXEstiloXColor($this->session->userdata('TIENDA'), $v->Estilo, $v->Color);\n // print \"Talla : \" . $v->Talla . \"-\" . $v->Cantidad . \", EXDES: \" . $existencias_disponibles[0]->{\"Ex$index\"} . \"\\n\";\n if ($serie[0]->{\"T$index\"} == $v->Talla) {\n /* SUMAR LA CANTIDAD EN LA TALLA DE LA TIENDA DESTINO */\n $existencia = ($existencias[0]->{\"Ex$index\"} + $v->Cantidad);\n /* AGREGAR EXISTENCIAS DE LA TIENDA DESTINO */\n $this->dvm->onModificarExistencias($this->session->userdata('TIENDA'), $v->Estilo, $v->Color, $existencia, $index);\n $data = array(\n 'Devolucion' => $IDD,\n 'Estilo' => $v->Estilo,\n 'Color' => $v->Color,\n 'Talla' => $v->Talla,\n 'Cantidad' => $v->Cantidad,\n 'Subtotal' => $v->SubTotal,\n 'Descuento' => 0,\n 'Precio' => $v->Precio,\n 'PorcentajeDesc' => 0,\n 'Registro' => Date('d/m/Y h:i:s a')\n );\n $this->dvm->onAgregarDevolucionDetalle($data);\n }\n }/* FIN AGREGAR LOS PRODUCTOS DEVUELTOS */\n }\n\n /* DETALLE DE LA VENTA (DEVOLUCION) */\n $Detalle = json_decode($this->input->post(\"Detalle\"));\n foreach ($Detalle as $key => $v) {\n /* ENTREGAR LOS PRODUCTOS SELECCIONADOS (RESTAR) */\n /* OBTENER SERIE X ESTILO */\n $serie = $this->dvm->getSerieXEstilo($v->Estilo);\n\n /* ACTUALIZA LAS EXISTENCIAS DE LA TIENDA DESTINO */\n $existencia = 0;\n for ($index = 1; $index <= 22; $index++) {\n /* CONSULTAR EXISTENCIAS DE LA TIENDA DESTINO */\n $existencias = $this->dvm->getExistenciasXTiendaXEstiloXColor($this->session->userdata('TIENDA'), $v->Estilo, $v->Color);\n /* COMPROBAR EXISTENCIAS EN LA TIENDA ORIGEN TENGA DISPONIBLES DE LA TALLA SOLICITADA */\n $existencias_disponibles = $this->dvm->getExistenciasXTiendaXEstiloXColor($this->session->userdata('TIENDA'), $v->Estilo, $v->Color);\n\n if ($serie[0]->{\"T$index\"} > 0 && $serie[0]->{\"T$index\"} == $v->Talla && $existencias_disponibles[0]->{\"Ex$index\"} > 0) {\n /* RESTAR LA CANTIDAD EN LA TALLA DE LA TIENDA ORIGEN */\n $existencia = ($existencias_disponibles[0]->{\"Ex$index\"} - $v->Cantidad);\n /* REMOVER EXISTENCIAS DE LA TIENDA ACTUAL/ORIGEN */\n $this->dvm->onModificarExistencias($this->session->userdata('TIENDA'), $v->Estilo, $v->Color, $existencia, $index);\n /* FIN RESTAR LA CANTIDAD EN LA TALLA DE LA TIENDA ORIGEN */\n /* AGREGAR UN REGISTRO EN EL DETALLE DE LA DEVOLUCIÓN */\n $data = array(\n 'Venta' => $ID,\n 'Estilo' => $v->Estilo,\n 'Color' => $v->Color,\n 'Talla' => $v->Talla,\n 'Cantidad' => $v->Cantidad,\n 'Subtotal' => $v->SubTotal,\n 'Descuento' => 0,\n 'Precio' => $v->Precio,\n 'PorcentajeDesc' => 0\n );\n $this->dvm->onAgregarDetalle($data);\n break;\n }\n }\n /* FIN ENTREGAR LOS PRODUCTOS SELECCIONADOS */\n }\n }\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n }", "public function guardar_datos_factura()\n\t{\n\t\t$id_cliente =$this->security->xss_clean(strip_tags($this->input->post('id_cliente')));\n\t\t$conexion_id=$this->security->xss_clean(strip_tags($this->input->post('id_conexion')));\n\t\t$subtotal=$this->security->xss_clean(strip_tags($this->input->post('subtotal')));\n\t\t$total=$this->security->xss_clean(strip_tags($this->input->post('total')));\n\t\t//buscar plan_pago_id\n\t\t$existe_planpago = $this->Crud_model->get_data_row_sin_borrado_en_array(\"planpago\",\"PlanPago_Conexion_Id\",\"PlanPago_Borrado\",$conexion_id);\n\t\tif($existe_planpago == false )\n\t\t{\n\t\t\t$existe_planpago[\"PlanPago_Id\"] = 0;\n\t\t\t$existe_planpago[\"PlanPago_MontoCuota\"] = 0;\n\t\t\t$existe_planpago[\"PlanPago_MontoTotal\"] = 0;\n\t\t\t$existe_planpago[\"PlanPago_MontoPagado\"] = 0;\n\t\t\t$existe_planpago[\"PlanPago_Coutas\"] = 0;\n\t\t\t$existe_planpago[\"PlanPago_CoutaActual\"] = 0;\n\t\t}\n\t\t$existe_medicion = $this->Crud_model->get_data_row_sin_borrado_en_array(\"medicion\",\"Medicion_Conexion_Id\",\"Medicion_Borrado\",$conexion_id);\n\t\tif($existe_planpago == false )\n\t\t{\n\t\t\t$existe_medicion[\"Medicion_Id\"] = 0;\n\t\t\t$existe_medicion[\"Medicion_Importe\"] = 0;\n\t\t}\n\t\t$existe_planmedidor = $this->Crud_model->get_data_row_sin_borrado_en_array(\"planmedidor\",\"PlanMedidor_Conexion_Id\",\"PlanMedidor_Borrado\",$conexion_id);\n\t\tif($existe_planmedidor == false )\n\t\t{\n\t\t\t$existe_planmedidor[\"PlanMedidor_Id\"] = 0;\n\t\t\t$existe_planmedidor[\"PlanMedidor_MontoCuota\"] = 0;\n\t\t\t$existe_planmedidor[\"PlanMedidor_MontoTotal\"] = 0;\n\t\t\t$existe_planmedidor[\"PlanMedidor_MontoPagado\"] = 0;\n\t\t\t$existe_planmedidor[\"PlanMedidor_Coutas\"] = 0;\n\t\t\t$existe_planmedidor[\"PlanMedidor_CoutaActual\"] = 0;\n\t\t\t\n\t\t}\n\t\t$data_para_insertar_en_factura = array(\n\t\t\t'id'=> null,\t\n\t\t\t'id_factura'=> \"111111111111\",\n\t\t\t'id_cliente'=> $id_cliente,\n\t\t\t'Factura_PlanPago_Id'=>$existe_planpago[\"PlanPago_Id\"],\n\t\t\t'Factura_Conexion_Id'=> $conexion_id,\n\t\t\t'Factura_Medicion_Id'=> $existe_medicion[\"Medicion_Id\"],\n\t\t\t'Factura_PlanMedidor_Id\t'=> $existe_planmedidor[\"PlanMedidor_Id\"],\n\t\t\t'tipo_documento'=> 1,\n\t\t\t'serie'\t=> 1,\n\t\t\t'correlativo'=> 1,\n\t\t\t'moneda'=> \"pesos\",\n\t\t\t'monto'\t=> $total,\n\t\t\t'fecha_emision'\t=> date(\"Y-m-d H:i:s\"),\n\t\t\t'fecha_cancelacion'\t=> null,\n\t\t\t'tipo_pago'\t=> \"contado\",\n\t\t\t'estado'=> \"1\",\n\t\t\t'igv'=> 0,\n\t\t\t'Factura_Periodo' => date(\"Y-m-d\"),\n\t\t\t'Factura_SubTotal'=> $subtotal,\n\t\t\t'Factura_Total'\t=> $total,\n\t\t\t'Factura_Codigo'=> 1, \n\t\t\t'Factura_Vigencia'=> date(\"Y-m-21\"), \n\t\t\t'Factura_Vencimiento1'=> date(\"Y-m-14\"),\n\t\t\t'Factura_Vencimiento2'=> date(\"Y-m-21\"),\n\t\t\t'Factura_Observacion'=> null,\n\t\t\t'Factura_Habilitacion'=> 1,\n\t\t\t'Factura_Borrado'=> 0,\n\t\t\t'Factura_Timestamp'\t=> null\n\t\t);\n\t\t$id_factura_recien_insertado =$this->Facturar_model->insertar_factura_tres(\"facturacion\",$data_para_insertar_en_factura);\n\t\t//var_dump($id_factura_recien_insertado);die();\n\t\tif(is_numeric( $id_factura_recien_insertado ) ) // se inserto correctamente\n\t\t{\n\t\t\t$conexion_en_codigo_barra = null;\n\t\t\t$conexion_en_codigo_barra .= $conexion_id;\n\t\t\tfor ($i= strlen($conexion_id); $i < 4 ; $i++) { \n\t\t\t\t$conexion_en_codigo_barra = \"0\".$conexion_en_codigo_barra;\n\t\t\t}\n\t\t\t$facturacion_en_codigo_barra = null;\n\t\t\t$facturacion_en_codigo_barra .= $id_factura_recien_insertado;\n\t\t\tfor ($i= strlen($facturacion_en_codigo_barra); $i < 6 ; $i++) { \n\t\t\t\t$facturacion_en_codigo_barra = \"0\".$facturacion_en_codigo_barra;\n\t\t\t}\n\t\t\t$codigo_aux = \"1\".$conexion_en_codigo_barra.$facturacion_en_codigo_barra;\n\t\t\t$i=0;\n\t\t\t$acumulado = 0;\n\t\t\tfor ($j=0; $j < cantidad_digitos-1 ; $j++)\n\t\t\t\t$acumulado +=$codigo_aux[$j] ;\n\t\t\t$codigo_aux[cantidad_digitos-1] = $acumulado % 7 ; \n\t\t\t$codigo = array('id_factura' => $codigo_aux);\n\t\t\t$resultado_modificacion = $this->Facturar_model->modficar_factura($codigo, $id_factura_recien_insertado);\n\t\t\tif($resultado_modificacion == true)\n\t\t\t\techo $id_factura_recien_insertado;\n\t\t\telse \n\t\t\t\techo \"false\";\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$this->session->set_flashdata('aviso','La factura NO se genero correctamente');\n\t\t\techo \"false\";\n\t\t}\n\t}", "function alta_entrada_bonificacion(){\n\t\t$varP=$_POST;\n\t\t$line=$this->uri->segment(4);\n\t\t$pr= new Entrada();\n\t\t$pr->usuario_id=$GLOBALS['usuarioid'];\n\t\t$pr->empresas_id=$GLOBALS['empresaid'];\n\t\t$pr->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$pr->pr_facturas_id=$varP['pr_facturas_id'.$line];\n\t\t$pr->cproductos_id=$varP['producto'.$line];\n\t\t$pr->cantidad=$varP['unidades'.$line];\n\t\t$pr->estatus_general_id=1;\n\t\t$pr->costo_unitario=0;\n\t\t$pr->tasa_impuesto=0;\n\t\t$pr->costo_total=0;\n\t\t$pr->ctipo_entrada=9;\n\t\t$pr->cproveedores_id=$this->pr_factura->get_pr_factura_entrada($varP['pr_facturas_id'.$line]);\n\t\t$pr->fecha=date(\"Y-m-d H:i:s\");\n\t\tif(isset($varP['id'.$line])==true){\n\t\t\t$pr->id=$varP['id'.$line];\n\t\t}\n\t\t// save with the related objects\n\t\tif($pr->save())\n\t\t{\n\t\t\techo form_hidden('id'.$line, \"$pr->id\"); echo form_hidden('pr_facturas_id'.$line, \"$pr->pr_facturas_id\"); echo \"<a href=\\\"javascript:borrar_detalle('$pr->id', $line)\\\"><img src=\\\"\".base_url().\"images/trash1.png\\\" width=\\\"20px\\\" title=\\\"Borrar Detalle\\\"/></a><img src=\\\"\".base_url().\"images/ok.png\\\" width=\\\"20px\\\" title=\\\"Guardado\\\"/>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function reporte(){\n\n /*Inicia seguridad*/\n $seguridad = $this->loadModel('Seguridad');\n $carne = $this->request->getSession()->read('id');\n $rolActual = $seguridad->getRol($carne);\n if ($carne != ''){\n $resultado = $seguridad->getPermiso($carne,24);\n if($resultado != 1){\n return $this->redirect(['controller' => 'Inicio','action' => 'fail']);\n }\n }\n else{\n return $this->redirect(['controller' => 'Inicio','action' => 'fail']);\n }\n /*Cierra la seguridad*/\n\n //datos para la vista previa en genera y beneratodo\n $solicitude = $this->Solicitudes->newEntity();\n\n //Se guardar las siglas y Ids de los estudiantes con solicitudes aceptadas para usarlos en la vista donde se seleecionara algun estudiante\n $carnetId = $this->Solicitudes->getCarnetId();\n $carnet=array(0 => \"\"); //vector para guardad los carnet de estudiantes que han sido asistentes\n $Ids=array(0 => \"\"); //vector para guardad los id de estudiantes que han sido asistentes\n foreach ($carnetId as $key => $value) {\n array_push($carnet, $value['nombre_usuario']);\n array_push($Ids, $value['usuarios_id']);\n }\n\n if ($this->request->is('post')) { \n $data = $this->request->getData(); \n $ronda = $data['Ronda'];\n if ($ronda == 0){\n $id = $data['Carné'];\n return $this->redirect(['action' => 'genera', $Ids[$id]]);\n } else {\n return $this->redirect(['action' => 'generaRonda', $ronda]);\n }\n }\n\n $this->set(compact('carnet', 'solicitude', 'ronda'));\n }", "function facturaElectronicaCompraVentaImpuestos($data,$id_venta,$codigo_pv,$codigo_sucursal){\r\n\t\t$apiImpuestosBoa = $_SESSION['_END_POINT_FACTURACION_PRO'];\r\n\t\tif ($_SESSION['_ESTADO_SISTEMA'] != \"produccion\") {\r\n\t\t\t$apiImpuestosBoa = $_SESSION['_END_POINT_FACTURACION_DEV'];\r\n\t\t}\r\n\r\n\t\t// validacion de ruta inicial.\r\n\t\tif ($apiImpuestosBoa == \"\" || $apiImpuestosBoa == null){\r\n\r\n\r\n\r\n\t\t\t$send = array(\r\n \"error\" => true,\r\n \"mensaje\" => \"No se definio la ruta de los servicios de facturacion electronica. Favor Contactarse con sistemas.\",\r\n );\r\n echo json_encode($send);exit;\r\n\r\n \t//throw new Exception(\"No se definio la ruta de los servicios de facturacion electronica. Favor Contactarse con sistemas.\");\r\n }\r\n\r\n\t\t// Json request para servicio\r\n\t\t$jsonData = $data[0]['jsondata'];\r\n\r\n\t\t// verifica que tipo de servicio se usara, factura electronica compra venta (1) o tasas (41)\r\n\t\t$endPoint = 'EnviarFacturaElectronicaCompraVenta';\r\n\t\tif ((int)$this->objParam->getParametro('documento_sector') == 41) {\r\n\t\t\t//Valor de la paramétrica que identifica el tipo de factura que se está emitiendo. Para este tipo de factura este valor es 41.\r\n\t\t\t$endPoint = 'EnviarFacturaElectronicaCompraVentaTasas';\r\n\t\t}\r\n\r\n\t\t$this->objParam->arreglo_parametros['solicitud'] = $jsonData;\r\n\t\t$this->objParam->arreglo_parametros['nombre_servicio'] = $endPoint;\r\n\t\t$this->objFunc0 = $this->create('MODServicioImpuesto');\r\n\t\t$this->res0 = $this->objFunc0->insertFacturaElectronicaLog($this->objParam); //registro log antes de llamar al servicio\r\n\r\n\t\t$dataLog = $this->res0->getDatos();\r\n\t\t$id_log_servicio = $dataLog['id_log_servicio'];\r\n\r\n\t\t// esctructura curl para llamada al servicio -> EnviarFacturaElectronicaCompraVenta\r\n\t\t$s = curl_init();\r\n\t\tcurl_setopt($s, CURLOPT_URL, $apiImpuestosBoa.$endPoint);\r\n\t\tcurl_setopt($s, CURLOPT_POST, true);\r\n\t\tcurl_setopt($s, CURLOPT_POSTFIELDS, $jsonData);\r\n\t\tcurl_setopt($s, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($s, CURLOPT_CONNECTTIMEOUT, 20);\r\n\t\tcurl_setopt($s, CURLOPT_HTTPHEADER, array(\r\n\t\t\t\t\t\t'Content-Type: application/json',\r\n\t\t\t\t\t\t'Content-Length: ' . strlen($jsonData))\r\n\t\t);\r\n\r\n\t\t$_out = curl_exec($s);\r\n\r\n\t\t// captura código de respuesta\r\n\t\t$status = curl_getinfo($s, CURLINFO_HTTP_CODE);\r\n\r\n\t\t// estructura respuesta array, para la interfaz\r\n\t\t$response = array('codigo' => '', 'message' => '', 'result' => array('estado' => null, 'cuf' => '', 'cufd' => '', 'numeroFactura' => null, 'descripcionEstado' => ''));\r\n\t\t$totalRes = \"\";\r\n\t\t$cuf = \"\";\r\n\t\t$cufd = \"\";\r\n\t\t$facturaXml = \"\";\r\n\t\t$fechaEmisionSIN = \"\";\r\n\t\t$descripcionEstado = \"\";\r\n\r\n\t\tif (!$status) {\r\n\t\t\t\t$response['message'] = 'No se pudo conectar con el middleware de facturacion electronica.';\r\n\t\t\t\t$response['codigo'] = 'SIN_CONEXION';\r\n\t\t}\r\n\r\n\t\tcurl_close($s);\r\n\r\n\t\t// validacion codigos de statado de conexion [400, 404, 408]\r\n\t\tif ($status == 400) {\r\n\t\t\t\t$response['message'] = 'En informacion enviada, al middleware de facturacion electronica.';\r\n\t\t\t\t$response['codigo'] = 'BAD_REQUEST';\r\n\t\t}\r\n\r\n\t\tif ($status == 404) {\r\n\t\t\t\t$response['message'] = 'Middleware servicio de facturacion electronica no encontrada.';\r\n\t\t\t\t$response['codigo'] = 'API_NO_ENCONTRADA';\r\n\t\t}\r\n\r\n\t\tif ($status == 408) {\r\n\t\t\t$response['message'] = 'La solicitud tardo mas de lo esperado. La conexion con el servicio de facturacion electronica, se agoto.';\r\n\t\t\t$response['codigo'] = 'REQUEST_TIMEOUT';\r\n\t\t}\r\n\r\n\t\t// decodificacion de respuesta\r\n\t\t$res = json_decode($_out);\r\n\r\n\t\tif (!is_null($res)) {\r\n\t\t\t// decodificaion caso exito\r\n\t\t\t$totalRes = json_encode($res);\r\n\r\n\t\t\t// Json response del servicio facturacion electronica\r\n\t\t\t$resData = $res->EnviarFacturaElectronicaCompraVentaResult;\r\n\r\n\r\n\r\n\t\t\tif(in_array($resData->DescripcionEstado, array(\"VALIDADA\", \"OFFLINE\"))) {\r\n\t\t\t\t$response['codigo'] = 'EXITO';\r\n\t\t\t} elseif($resData->DescripcionEstado == \"NO ENVIADA\"){\r\n\t\t\t\t$mensaje = $resData->Mensaje[0];\r\n\r\n\t\t\t\t$mensajeExp = explode('|',$mensaje);\r\n\t\t\t\t$cantidad = count($mensajeExp);\r\n\r\n\t\t\t\tif ($cantidad > 1) {\r\n\t\t\t\t\t$response['codigo'] = 'ERROR';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$response['codigo'] = 'PENDIENTE_EMISION';\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$response['codigo'] = 'ERROR';\r\n\t\t\t}\r\n\r\n\t\t\tif (gettype($resData->Mensaje) == \"array\") {\r\n\t\t\t\tforeach ($resData->Mensaje as $value) {\r\n\t\t\t\t\t$response['message'] = \" En middleware \".$response['message'].\" - \".$value.\" SUCURSAL: \".$codigo_sucursal.\" PUNTO DE VENTA: \".$codigo_pv;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$response['message'] = \" En middleware \".json_encode($resData->Mensaje);\r\n\t\t\t}\r\n\r\n\t\t\t//$response['codigo'] = 'ERROR';\r\n\t\t\t// captura de datos relevantes para actualizar campos de tabla vef.tventa\r\n\r\n\t\t\t/*Aqui para el cuf y cufd poner vacios*/\r\n\t\t\tif ($response['codigo'] == 'EXITO') {\r\n\t\t\t\t$cuf = $resData->Respuesta->cabecera->cuf;\r\n\t\t\t\t$cufd = $resData->Respuesta->cabecera->cufd;\r\n\t\t\t\t$facturaXml = $resData->xmlSigned;\r\n\t\t\t} else {\r\n\t\t\t\t$cuf = '';\r\n\t\t\t\t$cufd = '';\r\n\t\t\t\t$facturaXml = '';\r\n\t\t\t}\r\n\t\t\t/**************************************/\r\n\r\n\t\t\t$fechaEmisionSIN = $resData->Respuesta->cabecera->fechaEmisionSIN;\r\n\t\t\t$leyenda = $resData->Respuesta->cabecera->leyenda;\r\n\t\t\t$numeroFactura = $resData->Respuesta->cabecera->numeroFactura;\r\n\t\t\t$descripcionEstado = $resData->DescripcionEstado;\r\n\r\n\t\t\t$response['result'] = array('estado' => $resData->Estado, 'cuf' => $cuf, 'cufd' => $cufd, 'numeroFactura' => $numeroFactura, \"descripcionEstado\" => $descripcionEstado);\r\n\r\n\t\t}\r\n\r\n\t\t$this->objParam->arreglo_parametros['id_log_servicio'] = $id_log_servicio;\r\n\t\t$this->objParam->arreglo_parametros['cuf'] = ($cuf==\"\")?\"\":$cuf;\r\n\t\t$this->objParam->arreglo_parametros['cufd'] = ($cufd==\"\")?\"\":$cufd;\r\n\t\t$this->objParam->arreglo_parametros['fecha_emision_sin'] = $fechaEmisionSIN;\r\n\t\t$this->objParam->arreglo_parametros['leyenda'] = $leyenda;\r\n\t\t$this->objParam->arreglo_parametros['codigo'] = $response['codigo'];\r\n\t\t$this->objParam->arreglo_parametros['mensaje'] = str_replace(\"'\", \"\", $response['message']);\r\n\t\t$this->objParam->arreglo_parametros['resultado'] = str_replace(\"'\", \"\", $totalRes);\r\n\t\t$this->objParam->arreglo_parametros['facturaxml'] = ($facturaXml==\"\")?\"\":$facturaXml;\r\n\t\t$this->objParam->arreglo_parametros['descripcion_estado'] = $descripcionEstado;\r\n\t\t// actulzacion de datos en tabla vef.tventa\r\n\t\t$this->objFunc1 = $this->create('MODServicioImpuesto');\r\n\t\t$this->res2 = $this->objFunc1->actualizarFacturaElectronicaLog($this->objParam);\r\n\t\t$dataLog = $this->res2->getDatos();\r\n\r\n\t\t// validacion cuf duplicado en base de datos\r\n\t\tif (!is_null($dataLog['cuf'])) {\r\n\t\t\tif ($dataLog['cuf'] != \"\") {\r\n\r\n\r\n $send = array(\r\n \"error\" => true,\r\n \"mensaje\" => \"ERP Mensaje: el CUF: \".$cuf.\" ya fue registrado en una factura. Favor contactarse con sistemas.\",\r\n );\r\n echo json_encode($send);exit;\r\n\r\n //\tthrow new Exception(\"ERP Mensaje: el CUF: \".$cuf.\" ya fue registrado en una factura. Favor contactarse con sistemas.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn json_encode($response);\r\n\r\n\r\n }", "function update() {\r\n $exp_id = VAR3;\r\n $fil_id = VAR4;\r\n $seccion = VAR5;\r\n \r\n // Find ser_id\r\n $expediente = new tab_expediente ();\r\n $tab_expediente = $expediente->dbselectById($exp_id);\r\n $ser_id = $tab_expediente->getSer_id();\r\n \r\n // Tab_archivo\r\n $this->archivo = new tab_archivo();\r\n $row = $this->archivo->dbselectByField(\"fil_id\", $fil_id);\r\n $row = $row[0]; \r\n \r\n\r\n \r\n // Tab_doccorr\r\n $tab_doccorr = new Tab_doccorr();\r\n $sql = \"SELECT * \r\n FROM tab_doccorr \r\n WHERE fil_id='\" . $row->fil_id . \"'\";\r\n $doccorr = $tab_doccorr->dbSelectBySQL($sql);\r\n if($doccorr){\r\n $doccorr = $doccorr[0]; \r\n // Nur\r\n $hojas_ruta = new hojas_ruta();\r\n $this->registry->template->dco_id = $doccorr->dco_id;\r\n $this->registry->template->fil_cite = $hojas_ruta->obtenerSelect($doccorr->fil_cite);\r\n $seguimientos = new seguimientos();\r\n $this->registry->template->fil_nur_s = $seguimientos->obtenerSelect($doccorr->fil_nur_s);\r\n\r\n $this->registry->template->fil_nur = $doccorr->fil_nur;\r\n $this->registry->template->fil_asunto = $doccorr->fil_asunto;\r\n $this->registry->template->fil_sintesis = $doccorr->fil_sintesis;\r\n }else{\r\n // Nur\r\n $this->registry->template->dco_id = \"\";\r\n $this->registry->template->fil_cite = \"\";\r\n $this->registry->template->fil_nur_s = \"\";\r\n $this->registry->template->fil_nur = \"\";\r\n $this->registry->template->fil_asunto = \"\";\r\n $this->registry->template->fil_sintesis = \"\"; \r\n }\r\n// $this->registry->template->fil_nur = \"\";\r\n// $this->registry->template->fil_asunto = \"\";\r\n// $this->registry->template->fil_sintesis = \"\";\r\n// $this->registry->template->fil_cite = \"\";\r\n// $this->registry->template->fil_nur_s = \"\";\r\n \r\n \r\n\r\n\r\n // Tab_exparchivo\r\n $sql = \"SELECT * \r\n FROM tab_exparchivo \r\n WHERE fil_id='\" . $row->fil_id . \"'\";\r\n $exa_row = $this->archivo->dbSelectBySQL($sql);\r\n $exa_row = $exa_row[0];\r\n $this->registry->template->exp_id = $exp_id;\r\n $this->registry->template->tra_id = $exa_row->tra_id;\r\n $this->registry->template->cue_id = $exa_row->cue_id;\r\n $this->registry->template->exa_id = $exa_row->exa_id;\r\n \r\n $expediente = new expediente ();\r\n // Tab_archivo\r\n $this->registry->template->seccion = $seccion;\r\n $this->registry->template->fil_id = $fil_id;\r\n $this->registry->template->fil_codigo = $row->fil_codigo;\r\n $this->registry->template->fil_nro = $row->fil_nro;\r\n $this->registry->template->fil_titulo = $row->fil_titulo;\r\n $this->registry->template->fil_subtitulo = $row->fil_subtitulo;\r\n $this->registry->template->fil_fecha = $row->fil_fecha;\r\n $this->registry->template->fil_mes = $expediente->obtenerSelectMes($row->fil_mes);\r\n $this->registry->template->fil_anio = $expediente->obtenerSelectAnio($row->fil_anio); \r\n \r\n $idioma = new idioma (); \r\n $this->registry->template->idi_id = $idioma->obtenerSelect($row->idi_id);\r\n\r\n $this->registry->template->fil_proc = $row->fil_proc;\r\n $this->registry->template->fil_firma = $row->fil_firma;\r\n $this->registry->template->fil_cargo = $row->fil_cargo;\r\n // Include dynamic fields\r\n $expcampo = new expcampo();\r\n $this->registry->template->filcampo = $expcampo->obtenerSelectCampos($ser_id); \r\n $sopfisico = new sopfisico();\r\n $this->registry->template->sof_id = $sopfisico->obtenerSelect($row->sof_id);\r\n $this->registry->template->fil_nrofoj = $row->fil_nrofoj;\r\n $this->registry->template->fil_tomovol = $row->fil_tomovol;\r\n $this->registry->template->fil_nroejem = $row->fil_nroejem;\r\n $this->registry->template->fil_nrocaj = $row->fil_nrocaj;\r\n $this->registry->template->fil_sala = $row->fil_sala;\r\n $archivo = new archivo ();\r\n $this->registry->template->fil_estante = $archivo->obtenerSelectEstante($row->fil_estante);\r\n $this->registry->template->fil_cuerpo = $row->fil_cuerpo;\r\n $this->registry->template->fil_balda = $row->fil_balda;\r\n $this->registry->template->fil_tipoarch = $row->fil_tipoarch;\r\n $this->registry->template->fil_mrb = $row->fil_mrb;\r\n \r\n $this->registry->template->fil_ori = $row->fil_ori;\r\n $this->registry->template->fil_cop = $row->fil_cop;\r\n $this->registry->template->fil_fot = $row->fil_fot;\r\n \r\n $this->registry->template->fil_confidencilidad = $row->fil_confidencialidad;\r\n $this->registry->template->fil_obs = $row->fil_obs;\r\n \r\n $this->registry->template->required_archivo = \"\"; \r\n\r\n //palabras clave\r\n $palclave = new palclave();\r\n $this->registry->template->pac_nombre = $palclave->listaPC();\r\n $this->registry->template->fil_descripcion = $palclave->listaPCFile($row->fil_id);\r\n \r\n $arc = new archivo ();\r\n $this->registry->template->confidencialidad = $arc->loadConfidencialidad('1');\r\n $this->registry->template->PATH_WEB = PATH_WEB;\r\n $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;\r\n $exp = new expediente ();\r\n if ($seccion == \"estrucDocumental\") {\r\n $this->registry->template->PATH_EVENT = \"update_save\";\r\n $this->registry->template->linkTree = $exp->linkTree($exp_id, $exa_row->tra_id, $exa_row->cue_id);\r\n } else {\r\n $this->registry->template->PATH_EVENT = \"update_saveReg\";\r\n $this->registry->template->linkTree = $exp->linkTreeReg($exp_id, $exa_row->tra_id, $exa_row->cue_id);\r\n }\r\n $this->menu = new menu ();\r\n $liMenu = $this->menu->imprimirMenu($seccion, $_SESSION ['USU_ID']);\r\n $this->registry->template->men_titulo = $liMenu;\r\n \r\n $this->registry->template->GRID_SW = \"true\";\r\n $this->registry->template->PATH_J = \"jquery-1.4.1\";\r\n $this->registry->template->tituloEstructura = $this->tituloEstructuraD;\r\n $this->registry->template->show('header');\r\n $this->registry->template->controller = $seccion;\r\n $this->llenaDatos(VAR3);\r\n $this->registry->template->show('regarchivo.tpl');\r\n }", "function Init_Dossier_AEV_Situation_11($formx) {\n//$AEV_Type = utf8_decode($formx->getFormVar('AEV_Type'));\n//$formx->setVar('L_AEV_Situation',$situation);\n\n\n$ids = $formx->getIDS();\n$id_instance = $formx->getIdInstance();\n$idu = $formx->getVar('ids');\n\neko ($ids);\neko ($id_instance);\neko ($idu);\n\n// On va supprimer tous les fichiers Dossier_Colectomie_Periode_P1 de la table formx\n// $requete=new clRequete(BDD,TABLEFORMX,$param);\n// $sql=$requete->delRecord(\"idformx='Dossier_Colectomie_Periode_P1' and ids='\".$ids.\"'\");\n\n//$param[nomitem] = addslashes(stripslashes($this->getMedecin ( ))) ;\n//$req = new clResultQuery ;\n//$res = $req -> Execute ( \"Fichier\", \"getMatriculeMedecin\", $param, \"ResultQuery\" ) ;\n\n$item=utf8_decode($formx->getVar('L_AEV_Date_Accident_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Date_Accident_Situation_11',date(\"d\").\"-\".date(\"m\").\"-\".date(\"Y\"));\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Heure_Accident_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Heure_Accident_Situation_11',date(\"H\").\":\".date(\"i\"));\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Date_Prophylaxie_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Date_Prophylaxie_Situation_11',date(\"d\").\"-\".date(\"m\").\"-\".date(\"Y\"));\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Heure_Prophylaxie_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Heure_Prophylaxie_Situation_11',date(\"H\").\":\".date(\"i\"));\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Accident_Travail_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Accident_Travail_Situation_11',\"Non\");\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Accident_Travail_Hyeres_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Accident_Travail_Hyeres_Situation_11',\"Oui\");\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Accident_Travail_Etablissement_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Accident_Travail_Etablissement_Situation_11',\"\");\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Source_Nom_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Source_Nom_Situation_11',\"\");\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Source_Prenom_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Source_Prenom_Situation_11',\"\");\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Source_Jour_Naissance_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Source_Jour_Naissance_Situation_11',\"\");\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Source_Mois_Naissance_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Source_Mois_Naissance_Situation_11',\"\");\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Source_Annee_Naissance_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Source_Annee_Naissance_Situation_11',\"\");\n }\n\n$item=utf8_decode($formx->getVar('L_AEV_Complement_Situation_11'));\nif ( $item == \"\" )\n {\n $formx->setVar('L_AEV_Complement_Situation_11',\"\");\n }\n\nreturn \"O\";\n}", "public function productividad(){\n\t\t $sucursal= array('nogales'=>'_n','hermosillo'=>'_h','guaymas'=>'_g');\n\n\t\tif(isset($_POST['submit'])){\n\t\t\tif ($_POST['tipo_busqueda']== 1) {\n\t\t\t\t$_POST['cliente_id']=0;\n\t\t\t}\t\t\t\n\t\t\t$data = array(\n\t\t\t\t\"daterange\" =>$_POST['daterange'],\n\t\t\t\t\"nombre_suc\" =>$_POST['nombre_suc'],\n\t\t\t\t\"cliente_id\" => (int) $_POST['cliente_id'],\n\t\t\t\t\"tipo_busqueda\" =>(int) $_POST['tipo_busqueda']\n\t\t\t);\n\n\t\t\t$cadena= explode(' - ', $data['daterange']);\n\t\t\t$fecha=$data['daterange'];\n\n\t\t\tunset($data['daterange']);\n\t\t\t$data['fecha_home']=$cadena[0];\n\t\t\t$data['fecha_end']=$cadena[1];\t\n\t\t\t$table_data=$this->model['informes']->get_productividad($data);\n\t\t\t\n\t\t\t$table_totales=$this->model['informes']->get_totalprocesos($data);\t\t\t\t\t\t\n\n\t\t\tif ($data['tipo_busqueda']== 0) {\n\t\t\t$empresa= $this->model['planta']->find_by(['id'=>$data['cliente_id']],'view_plantas'); \n $cliente = (trim(strtolower($empresa[0]['nombre']))=='planta1') ? $empresa[0]['empresa']: $empresa[0]['empresa'].' ('.$empresa[0]['nombre'].')';\n\t\t\t}\n\t\t\t\n\t\t\t//$table_totales=$this->model['informes']->get_productividad_total($data);\t\t\n\t\t}\n\n \t\t/* Arreglos default para el formulario */\n\t\t$_data['planta']= $this->model['planta']->find_by([],'view_plantas');\n\t\t if (strtolower(Session::get('sucursal'))==\"nogales\") {\n\t\t\t$_data['sucursal']=$this->model['sucursal']->find_by();\n\t\t}\n\t\telse{\n\t\t\t$_data['sucursal']=$this->model['sucursal']->find_by(['nombre'=>Session::get('sucursal')]);\t \n\t\t}\t\n\n\t\tinclude view($this->name.'.productividad');\n\t}", "public function RegistreVenta($idVentaActiva,$TipoVenta,$CuentaDestino,$Comision,$Comisionista)\r\n {\r\n \r\n $fecha=date(\"Y-m-d\");\r\n $Hora=date(\"H:i:s\");\r\n \r\n //////// Averiguamos el ultimo numero de venta/////////////////////////////////////////////////////////////////////////////////\r\n\r\n$this->NombresColumnas(\"ventas\");\r\n$maxID=$this->VerUltimoID();\r\n$campos=$this->DevuelveValores($maxID);\r\n$NumVenta=$campos[\"NumVenta\"];\r\n$NumVenta=$NumVenta+1;\r\n\r\n//////// Averiguamos el ultimo numero de factura/////////////////////////////////////////////////////////////////////////////////\r\n\r\n$this->NombresColumnas(\"facturas\");\r\n$maxID=$this->VerUltimoID();\r\n$campos=$this->DevuelveValores($maxID);\r\n$NumFact=$campos[\"idFacturas\"];\r\n$NumFact=$NumFact+1;\r\n\r\n//////// Averiguamos el ultimo numero de cotizacion/////////////////////////////////////////////////////////////////////////////////\r\n\r\n$this->NombresColumnas(\"cotizaciones\");\r\n$maxID=$this->VerUltimoID();\r\n$idCoti=$maxID+1;\r\n$campos=$this->DevuelveValores($maxID);\r\n$NumCot=$campos[\"NumCotizacion\"];\r\n$NumCot=$NumCot+1;\r\n\r\n//print(\"max id de ventas: $maxID, Numero de Venta: $NumVenta\");\r\n\r\n$DatosVentaActiva=mysql_query(\"SELECT * FROM vestasactivas WHERE idVestasActivas='$idVentaActiva';\", $this->con) or die('problemas para consultas vestasactivas: ' . mysql_error());\r\n$DatosVentaActiva=mysql_fetch_array($DatosVentaActiva);\r\n$idCliente=$DatosVentaActiva[\"Clientes_idClientes\"];\r\n\r\n$registros=mysql_query(\"SELECT * FROM preventa WHERE VestasActivas_idVestasActivas='$idVentaActiva';\", $this->con) or die('no se pudo conectar: ' . mysql_error());\r\n\r\n//$registros1=mysql_fetch_array($registros);\t\r\n\t\t\t//$this->NombresColumnas(\"productosventa\");\r\n\t\t\tif(mysql_num_rows($registros)){\r\n\t\t\t\t$i=0;\r\n\t\t\t\t//print($i);\r\n\t\t\t\t\r\n\t\t\t\twhile($registros2=mysql_fetch_array($registros)){\r\n\t\t\t\t\t$i++;\t\t\t\r\n\t\t\t\t\t//print(\"fila $i:///////////////////////////////////////////////////////////////<br>\");\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t//print_r($registros2);\r\n\t\t\t\t\t$this->NombresColumnas(\"productosventa\");\r\n\t\t\t\t\t$idProducto=$registros2[\"ProductosVenta_idProductosVenta\"];\r\n\t\t\t\t\t$campos=$this->DevuelveValores($idProducto);\r\n\t\t\t\t\t$TotalVenta=$registros2[\"TotalVenta\"]+$registros2[\"Descuento\"];\r\n\t\t\t\t\t$IVA=$registros2[\"Impuestos\"];\r\n\t\t\t\t\t$TotalCostoP=$registros2[\"Cantidad\"]*$campos[\"CostoUnitario\"]; \r\n\t\t\t\t\t////////empezamos a formar el registro que se hará en ventas empezamos desde porque el id es autoincrement y el numcuentapuc es conocido\r\n\t\t\t\t\t\r\n\t\t\t\t\t$CamposVenta[2]=$NumVenta;\r\n\t\t\t\t\t$CamposVenta[3]=$fecha;\r\n\t\t\t\t\t$CamposVenta[4]=$idProducto;\r\n\t\t\t\t\t$CamposVenta[5]=$campos[\"Nombre\"];\r\n\t\t\t\t\t$CamposVenta[6]=$campos[\"Referencia\"];\r\n\t\t\t\t\t$CamposVenta[7]=$registros2[\"Cantidad\"];\r\n\t\t\t\t\t$CamposVenta[8]=$campos[\"CostoUnitario\"];\r\n\t\t\t\t\t$CamposVenta[9]=$registros2[\"ValorAcordado\"];\r\n\t\t\t\t\t$CamposVenta[10]=$registros2[\"Impuestos\"];\r\n\t\t\t\t\t$CamposVenta[11]=$registros2[\"Descuento\"];\r\n\t\t\t\t\t$CamposVenta[12]=$registros2[\"Cantidad\"]*$campos[\"CostoUnitario\"]; //Total costo\r\n\t\t\t\t\t$CamposVenta[13]=$TotalVenta;\r\n\t\t\t\t\t$CamposVenta[14]=$TipoVenta;\r\n\t\t\t\t\t$CamposVenta[15]=\"NO\"; //cerrado en periodo\r\n\t\t\t\t\t$CamposVenta[16]=$campos[\"Especial\"];\r\n\t\t\t\t\t$CamposVenta[17]=$idCliente;\r\n\t\t\t\t\t$CamposVenta[18]=$Hora;\r\n\t\t\t\t\t$CamposVenta[19]=$registros2[\"Usuarios_idUsuarios\"];\r\n\t\t\t\t\t$CamposVenta[20]=$NumFact;\r\n\t\t\t\t\t//print_r($CamposVenta);\r\n\t\t\t\t\t\r\n\t\t\t\t\t///////////////////////////Inserto el registro en la tabla ventas\r\n\t\t\t\t\tif($TipoVenta==\"Credito\" and $idCliente==0)\r\n\t\t\t\t\t\texit(\"Usted está intentando Registrar una venta a credito sin seleccionar un cliente, por favor asignelo a esta venta antes de continuar\");\r\n\t\t\t\t\telse\t\r\n\t\t\t\t\t\t$this->GuardaRegistroVentas(\"ventas\", $CamposVenta);\r\n\t\t\t\t\t///////////////////////////Registro el movimiento de SALIDA DE LA VENTA de los productos al Kardex\r\n\t\t\t\t\t\r\n\t\t\t\t\t$Movimiento=\"SALIDA\";\r\n\t\t\t\t\t$Detalle=\"VENTA\";\r\n\t\t\t\t\t$idDocumento=$NumVenta;\r\n\t\t\t\t\t$Cantidad=$registros2[\"Cantidad\"];\r\n\t\t\t\t\t$ValorUnitario=$campos[\"CostoUnitario\"];\r\n\t\t\t\t\t$ValorTotalSalidas=round($Cantidad*$ValorUnitario);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->RegistrarKardex(\"kardexmercancias\",\"ProductosVenta_idProductosVenta\",$fecha, $Movimiento, $Detalle, $idDocumento, $Cantidad, $ValorUnitario, $ValorTotalSalidas, $idProducto);\r\n\t\t\t\t\t\r\n\t\t\t\t\t///////////////////////////Registro el movimiento de SALDOS DESPUES DE LA VENTA de los productos al Kardex\r\n\t\t\t\t\t\r\n\t\t\t\t\t$Movimiento=\"SALDOS\";\r\n\t\t\t\t\t$CantidadSaldo=$campos[\"Existencias\"];\r\n\t\t\t\t\t$NuevoSaldo=$CantidadSaldo-$Cantidad;\r\n\t\t\t\t\t$ValorTotal=$NuevoSaldo*$ValorUnitario;\r\n\t\t\t\t\t$this->RegistrarKardex(\"kardexmercancias\",\"ProductosVenta_idProductosVenta\",$fecha, $Movimiento, $Detalle, $idDocumento, $NuevoSaldo, $ValorUnitario, $ValorTotal, $idProducto);\r\n\t\t\t\t\t\r\n\t\t\t\t\t///////////////////////////Actualiza tabla de productos venta\r\n\t\t\t\t\t\r\n\t\t\t\t\t$tabla=\"productosventa\";\r\n\t\t\t\t\t$NumRegistros=1;\r\n\t\t\t\t\t$Columnas[0]=\"Existencias\";\r\n\t\t\t\t\t//$Columnas[1]=\"CostoUnitario\";\r\n\t\t\t\t\t//$Columnas[2]=\"CostoTotal\";\r\n\t\t\t\t\t$Valores[0]=$NuevoSaldo;\r\n\t\t\t\t\t//$Valores[1]=$ValorUnitario;\r\n\t\t\t\t\t//$Valores[2]=$ValorTotal;\r\n\t\t\t\t\t$Filtro=\"idProductosVenta\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->EditeValoresTabla($tabla,$NumRegistros,$Columnas,$Valores,$Filtro,$idProducto);\r\n\t\t\t\t\t\r\n\t\t\t\t\t///////////////////////////Ingresar a Cotizaciones \r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$tabla=\"cotizaciones\";\r\n\t\t\t\t\t$NumRegistros=16; \r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$Columnas[0]=\"Fecha\";\t\t\t\t\t$Valores[0]=$fecha;\r\n\t\t\t\t\t$Columnas[1]=\"NumCotizacion\";\t\t\t$Valores[1]=$NumCot;\r\n\t\t\t\t\t$Columnas[2]=\"Descripcion\";\t\t\t\t$Valores[2]=$campos[\"Nombre\"];\r\n\t\t\t\t\t$Columnas[3]=\"Referencia\";\t\t\t\t$Valores[3]=$campos[\"Referencia\"];\r\n\t\t\t\t\t$Columnas[4]=\"ValorUnitario\";\t\t\t$Valores[4]=$registros2[\"ValorAcordado\"];\r\n\t\t\t\t\t$Columnas[5]=\"Cantidad\";\t\t\t\t$Valores[5]=$registros2[\"Cantidad\"];\r\n\t\t\t\t\t$Columnas[6]=\"Subtotal\";\t\t\t\t$Valores[6]=$registros2[\"Subtotal\"];\r\n\t\t\t\t\t$Columnas[7]=\"IVA\";\t\t\t\t\t\t$Valores[7]=$IVA;\r\n\t\t\t\t\t$Columnas[8]=\"Total\";\t\t\t\t\t$Valores[8]=round($registros2[\"Subtotal\"]+$IVA);\r\n\t\t\t\t\t$Columnas[9]=\"Descuento\";\t\t\t\t$Valores[9]=0;\r\n\t\t\t\t\t$Columnas[10]=\"ValorDescuento\";\t\t\t$Valores[10]=$registros2[\"Descuento\"];\r\n\t\t\t\t\t$Columnas[11]=\"Clientes_idClientes\";\t$Valores[11]=$idCliente;\r\n\t\t\t\t\t$Columnas[12]=\"Usuarios_idUsuarios\";\t$Valores[12]=$registros2[\"Usuarios_idUsuarios\"];\r\n\t\t\t\t\t$Columnas[13]=\"TipoItem\";\t\t\t\t$Valores[13]=\"PR\";\r\n\t\t\t\t\t$Columnas[14]=\"PrecioCosto\";\t\t\t$Valores[14]=round($campos[\"CostoUnitario\"]);\r\n\t\t\t\t\t$Columnas[15]=\"SubtotalCosto\";\t\t\t$Valores[15]=round($campos[\"CostoUnitario\"]*$registros2[\"Cantidad\"]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->InsertarRegistro($tabla,$NumRegistros,$Columnas,$Valores);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t}\r\nreturn($NumVenta);\t\r\n//echo \"Venta Registrada\";\r\n\r\n}", "static public function ctrCrearFacturas(){\n\n\t\tif(isset($_POST[\"nuevoFolio\"])){\n\n/*=============================================\n\tACTUALIZAR LAS COMPRAS DEL CLIENTE Y REDUCIR EL STOCK Y AUMENTAR LAS Facturas DE LOS PRODUCTOS\n\t\t=============================================*/\n\n\t\t\tif($_POST[\"listaProductosF\"] == \"\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"error\",\n\t\t\t\t\t title: \"La venta no se ha ejecuta si no hay productos\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"facturaprueba\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t\treturn;\n\t\t\t}\n\n\n\n\t\t\t$listaProductosF = json_decode($_POST[\"listaProductosF\"], true);\n\n\t\t\t$totalProductosComprados = array();\n\n\t\t\tforeach ($listaProductosF as $key => $value) {\n\n\t\t\t array_push($totalProductosComprados, $value[\"cantidadpro\"]);\n\t\t\t \n \t\t\t\t$tablaProductos = \"productos\";\n\t\t\t \t$descripcion = $value[\"descripcion\"];\n\t\t\t $precio = $value[\"precio\"];\n\t\t\t $unidad = $value[\"unidad\"];\n\t\t\t $cantidadf = $value[\"cantidad\"];\n\t\t\t $preciot = $value[\"preciot\"];\n\n\t\t\t \n\t\n\t\t\t/*=============================================\n\t\t\tGUARDAR LA COMPRA\n\t\t\t=============================================*/\t\n\t\t\t$tabla = \"factura\";\n\t\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t\t$datos = array(\"RECORDID\" => NULL,\n\n\t\t\t\t\t \"FOLIO\" => $_POST[\"nuevoFolio\"],\t\n\t\t\t\t\t \"FECHA\"=> $_POST[\"nuevoFecha\"], \n\t\t\t\t\t \"PROVEEDOR\" => $_POST[\"nuevoProveedor\"],\n\t\t\t\t\t \"CANTIDAD\" => $cantidadf,\n\t\t\t\t\t \"DESCRIPCION\" => $descripcion,\n\t\t\t\t\t \"PRECIOUNITARIO\" => $precio,\n\t\t\t\t\t \"PRECIOCOMPRA\" => $preciot,\n\t\t\t\t\t \"UNIDAD\" => $unidad,\n\t\t\t\t\t \"COMPRATOTAL\" => $_POST[\"nuevototal\"],);\n\t\t\t\t\t \n\n\t\t\t$respuesta = ModeloFacturas::mdlIngresarFactura($tabla, $datos);\n}\t\t\t\n\n\t\t\tif($respuesta == \"ok\"){\n\t\n\n\t\t\t\techo'<script>\n\n\t\t\t\tlocalStorage.removeItem(\"rango\");\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"success\",\n\t\t\t\t\t title: \"La venta ha sido guardada correctamente\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"crear-factura\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function insertarReenvioFactura(){\n\t\t$this->procedimiento='vef.ft_reenvio_factura_ime';\n\t\t$this->transaccion='VF_REFACOR_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\t\t\n\t\t$this->setParametro('id_venta','id_venta','int4');\n\t\t$this->setParametro('correo','correo','varchar');\n\t\t$this->setParametro('correo_copia','correo_copia','varchar');\n\t\t$this->setParametro('observacion','observacion','text');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function rep_objetivos_estrategicos(){\n $tabla='';\n $objetivos = $this->model_mestrategico->list_objetivos_estrategicos(); /// OBJETIVOS ESTRATEGICOS\n $configuracion=$this->model_resultado->configuracion_session(); /// Configuracion\n\n $tabla .='<table cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" border=0.2 style=\"width:100%;\" align=center>\n <thead>\n <tr style=\"font-size: 7px;\" bgcolor=#1c7368 align=center>\n <th style=\"width:1%;height:15px;color:#FFF;\">#</th>\n <th style=\"width:15%;color:#FFF;\">OBJETIVO ESTRATEGICO</th>\n <th style=\"width:84%;color:#FFF;\">ACCI&Oacute;N ESTRATEGICA</th>\n </tr>\n </thead>\n <tbody>';\n $nro=0;\n foreach($objetivos as $rowo){\n $nro++;\n $acciones = $this->model_mestrategico->list_acciones_estrategicas($rowo['obj_id']); \n $tabla.='<tr>';\n $tabla.='<td style=\"width:1%;;height:12px;\" align=center>'.$nro.'</td>';\n $tabla.='<td style=\"width:15%;\">'.$rowo['obj_codigo'].'.- '.$rowo['obj_descripcion'].'</td>';\n $tabla.='<td style=\"width:84%;\">';\n if(count($acciones)!=0){\n $tabla.='<table cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" border=0.1 style=\"width:100%;\" align=center>\n <thead>\n <tr style=\"font-size: 7px;\" bgcolor=#d9d7d7 align=center>\n <th style=\"width:1%;height:15px;\">#</th>\n <th style=\"width:37%;\">DESCRIPCI&Oacute;N</th>\n <th style=\"width:60%;\">VINCULACI&Oacute;N PDES</th>\n </tr>\n </thead>\n <tbody>';\n $nra=0;\n foreach($acciones as $rowa){\n $pdes=$this->model_proyecto->datos_pedes($rowa['pdes_id']);\n $nra++;\n $tabla.='<tr>';\n $tabla.='<td style=\"width:1%;\">'.$nra.'</td>';\n $tabla.='<td style=\"width:37%;\">'.$rowa['acc_codigo'].'.- '.$rowa['acc_descripcion'].'</td>';\n $tabla.='<td style=\"width:60%;\">';\n $tabla.='<ul>\n <li type=\"circle\"><b>PILAR : </b>'.$pdes[0]['pilar'].'</li>\n <li type=\"square\"><b>META : </b>'.$pdes[0]['meta'].'</li>\n <li type=\"disc\"><b>RESULTADO : </b>'.$pdes[0]['resultado'].'</li>\n <li type=\"disc\"><b>ACCI&Oacute;N : </b>'.$pdes[0]['accion'].'</li>\n </ul>';\n $tabla.='</td>';\n $tabla.='</tr>';\n }\n $tabla.=' </tbody>\n </table>';\n }\n $tabla.='</td>';\n $tabla.='</tr>';\n }\n $tabla .='</tbody>\n </table>';\n\n\n\n\n\n return $tabla;\n }", "public function alta()\n {\n $lin_ped_model = new Lineas_pedidos_Model();\n $lin_ped = new Linea_pedido();\n session_start();\n $errores = [];\n $success = \"\";\n //Recojo datos si hay\n if (isset($_POST['cod_pedido'])) {\n $lin_ped->setCod_pedido($_POST['cod_pedido']);\n $lin_ped->setPrecio($_POST['precio']);\n $lin_ped->setCantidad($_POST['cantidad']);\n $lin_ped->setCod_articulo($_POST['cod_articulo']);\n if ($lin_ped_model->create($lin_ped)) {\n $success = \"Agregado correctamente\";\n } else {\n $errores[] = \"Campo duplicados\";\n }\n }\n\n //Pasamos a la vista toda la información que se desea representar\n if (isset($_SESSION['cliente'])) {\n $usuario[\"cliente\"] = $_SESSION['cliente'];\n }\n $variables['articulo'] = $lin_ped;\n $variables['errores'] = $errores;\n $variables['success'] = $success;\n $usuario[\"usuario\"] = $_SESSION[\"usuario\"];\n //Pasamos a la vista toda la información que se desea representar\n $this->view->show(\"cabecera.php\");\n $this->view->show(\"plantilla_header.php\", $usuario);\n $this->view->show(RUTA_VISTAS . \"listar_header.php\");\n $this->view->show(RUTA_VISTAS . \"alta.php\", $variables);\n $this->view->show(\"plantilla_pie.php\");\n $this->view->show(\"pie.php\", $usuario);\n }", "function obtenerDatosFact($ids_Ventas, $rfc, $link, $verificarBoleta)\n{\n //$ids_Ventas=[8];\n if ($rfc == 'XAXX010101000') {\n $complemento = '0';\n $metpags = \"PUE\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n\n $formPago = \"99\";\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n $ArrayIdsVentas = array();\n $ArrayIdsVentas = array_merge($ArrayIdsVentas, $ids_Ventas);\n $busqVentas = implode(',', $ArrayIdsVentas);\n $sql = \"SELECT DISTINCT COUNT(vtas.id) AS totalVtas, pgosvta.idFormaPago, metpgos.clave FROM ventas vtas\n INNER JOIN pagosventas pgosvta ON vtas.id= pgosvta.idVenta\n INNER JOIN sat_formapago metpgos ON metpgos.id= pgosvta.idFormaPago\n WHERE vtas.id IN ($busqVentas) GROUP BY pgosvta.idFormaPago\";\n //print_r($sql);\n $resultXpagos = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => \"Error al Buscar el Metodo de Pago, notifica a tu Administrador\", 'idsErroneos' => mysqli_error($link))));\n $ventaXBoleta = \"<div class='text-danger'>Total de Ventas Pagadas Con Boleta:</div>\";\n $contarxBoleta = 0;\n $erroresVentas = array();\n $total_ventas = mysqli_num_rows($resultXpagos);\n $formaUnica = 0;\n $formaAnterior = \"\";\n $complemento = 0;\n if ($total_ventas == 1) {\n $xpags = mysqli_fetch_array($resultXpagos);\n if ($xpags['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n $formaUnica = 1;\n }\n //----------------------pago de boletas---------------------------------\n else if ($xpags[\"idFormaPago\"] == \"6\" and $verificarBoleta == '1') {\n $ventaXBoleta .= $xpags[\"totalVtas\"];\n $contarxBoleta++;\n } else if ($xpags['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n } else {\n $metpags = \"PUE\";\n $formPago = $xpags['clave'];\n $descripcionMetPgo = \"Pago en una sola exhibición\";\n $formaUnica = 1;\n }\n } else {\n while ($dat = mysqli_fetch_array($resultXpagos)) {\n\n if ($complemento == 0) {\n //----------------------pago de boletas---------------------------------\n if ($dat[\"idFormaPago\"] == \"6\" and $verificarBoleta == '1') {\n $ventaXBoleta .= $dat[\"totalVtas\"];\n $contarxBoleta++;\n } else {\n if ($dat['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n }\n }\n }\n } //cierra While\n\n }\n\n if ($contarxBoleta > 0) {\n array_push($erroresVentas, $ventaXBoleta);\n $resp = array('estatus' => '0', 'mensaje' => 'Ventas Pagadas con Boletas NO se pueden facturar.', 'idsErroneos' => json_encode($erroresVentas));\n return $resp;\n } else {\n if ($formaUnica == 1) {\n\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n if ($complemento == 1) {\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n $metpags = \"PUE\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en una sola exhibición\";\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n }\n }\n }\n }\n}", "function calcular_cotizacion(){\n\t\t$producto=$_POST['producto'];\n\t\t$plan=$_POST['plan'];\n\t\t$temporada=$_POST['temp'];\n\t\t$fecha_llegada=$_POST['llegada'];\n\t\t\t$this->desde=$_POST['llegada'];\n\t\t$fecha_salida=$_POST['salida'];\n\t\t\t$this->hasta=$_POST['salida'];\n\t\t\n\t\t$sql=\"SELECT * FROM producto, temporadas2, habitaciones2 WHERE id_pro='$producto' AND temporadas2.id_alojamiento='$producto' AND temporadas2.id='$temporada' AND temporadas2.id=habitaciones2.id_temporada AND habitaciones2.id='$plan'\";\n\t\t\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\n\t\t//echo \"Noches: \".$noches;\n\t\t$arreglo_datos=\"\";\n\t\t$adultos=\"\"; $infantes=\"\"; $ninos=\"\";\n\t\t$i=1;\n\t\t$temp=\"\";\n\t\t$adultos+=$_POST['numero_adultos'.$i];\n\t\t\t$temp[]=$_POST['numero_adultos'.$i];\n\t\t$infantes+=$_POST['ninos_a'.$i];\n\t\t\t$temp[]=$_POST['ninos_a'.$i];\n\t\t$ninos+=$_POST['ninos_b'.$i];\n\t\t\t$temp[]=$_POST['ninos_b'.$i];\n\t\t$temp[]=$resultado['precio'];\n\t\t$temp[]=$resultado['precio_ninos'];\n\t\t$temp[]=$resultado['precio_ninos2'];\n\t\t$arreglo_dato[]=$temp;\n\t\t\n\t\t$this->listado=$arreglo_dato;\n\t\t$_SESSION['personas']=$arreglo_dato;\n\t\t//print_r($this->listado);\n\t\t\n\t\t$numero_personas=$adultos+$infantes+$ninos;\n\t\t$fee=1000;\n\t\n\t\t\t//cotizamos con precio completo\n\t\t\t$total_adulto=($resultado['precio']*$adultos);\n\t\t\t$total_infantes=($resultado['precio_ninos']*$infantes);\n\t\t\t$total_ninos=($resultado['precio_ninos2']*$ninos);\n\t\t\t\n\t\t\t$subtotal=$total_adulto+$total_infantes+$total_ninos;\n\t\t\t\t$this->subtotal=$subtotal;\n\t\t\t$comision=$fee;\n\t\t\t\t$this->comision=$comision;\n\t\t\t$total=$subtotal+$comision;\n\t\t\t\t$this->total=$total;\n\t\t\t\n\t\t\t/*echo \"Monto Adulto: \".$total_adulto.\"<br />\";\n\t\t\techo \"Monto Infantes: \".$total_infantes.\"<br />\";\n\t\t\techo \"Monto Ni&ntilde;os: \".$total_ninos.\"<br />\";\n\t\t\techo \"Subtotal: \".$subtotal.\"<br />\";\n\t\t\techo \"Comision: \".$comision.\"<br />\";\n\t\t\techo \"Total: \".$total.\"<br /><br />\";*/\n\n\t\t\n\t\t$observaciones=$_POST['comentario'];\n\t\t$this->condiciones=$_POST['comentario'];\n\t\t$this->mensaje2=\"si\";\n\t}", "public function insertarVacunacion(){\n\t\t$nomvac = \"\";\n\t\t$nomjer = \"\";\n\t\t$lotevacuna = \"\";\n\t\t$lotejeringa = \"\";\n\t\t$motivo = \"vacunacion\";\n\t\t$lugar = $_POST[\"lugar\"];\n\t\t$dosis = $_POST[\"dosis\"];\n\t\t$lotvac = $_POST[\"lotevacunas\"];\n\t\t$lotjer = $_POST[\"lotejeringas\"];\n\t\t$id_enf = $_SESSION[\"id_enf\"];\n\t\t$id_pac = $_POST[\"id_pac\"];\n\t\t$id_ser = $_POST[\"serv\"];\n\t\t//registro en la historia clinica\n\t\t$sql = \"INSERT INTO historia VALUES (null, '\".$motivo.\"', CURRENT_DATE(), '\".$lugar.\"', '\".$dosis.\"', '\".$id_enf.\"','\".$id_pac.\"','\".$id_ser.\"')\";\n\t\t$this->db->query($sql);\n\t\t//verificacion de stock del insumo jeringas y vacunas (disponible - no disponible), update de cantidad disponible del insumo y asignacion de disponibilidad del insumo\n\t\t$sql = \"SELECT cant_disp, estado FROM ingresoinsumos WHERE id_ingreso = '\".$lotvac.\"' AND estado = 'usable' \";\n\t\t$vacuna = $this->db->query($sql);\n\t\t$vac = array();\n\t\twhile ($reg = $vacuna->fetch_object()) {\n\t\t\t$vac[] = $reg;\n\t\t}\n\t\t$res = $vac[0]->cant_disp-1;\n\t\t$estv = 'usable';\n\t\tif($res == 0){\n\t\t\t$estv = 'vacio';\n\t\t}\n\t\t$sql = \"UPDATE ingresoinsumos \n\t\t\t\tSET \n\t\t\t\tcant_disp = '\".$res.\"',\n\t\t\t\testado = '\".$estv.\"'\n\t\t\t\twhere id_ingreso = '\".$lotvac.\"' \";\n\t\t$this->db->query($sql);\n\t\t$sql = \"SELECT cant_disp, estado FROM ingresoinsumos WHERE id_ingreso = '\".$lotjer.\"' and estado = 'usable' \";\n\t\t$jeringa= $this->db->query($sql);\n\t\t$jer = array();\n\t\twhile ($reg = $jeringa->fetch_object()) {\n\t\t\t$jer[] = $reg;\n\t\t}\n\t\t$resj = $jer[0]->cant_disp-1;\n\t\t$estj = 'usable';\n\t\tif($resj == 0){\n\t\t\t$estj = 'vacio';\n\t\t}\n\t\t$sql = \"UPDATE ingresoinsumos \n\t\t\t\tset \n\t\t\t\tcant_disp = '\".$resj.\"',\n\t\t\t\testado = '\".$estj.\"'\n\t\t\t\twhere id_ingreso = '\".$lotjer.\"' \";\n\t\t$this->db->query($sql);\n\n\t\t//registro de vacunas y jeringas en el registro diario, verificacion de usabilidad\n\t\t//VACUNAS\n\t\t\n\t\t$sql = \"SELECT * FROM salidainsumos WHERE id_salida = ( SELECT MAX(id_salida) FROM salidainsumos where id_ingreso = '\".$lotvac.\"' )\";\n\t\t$datoo = $this->db->query($sql);\n\t\t$dato = array();\n\t\twhile ($reg = $datoo->fetch_object()) {\n\t\t\t$dato[] = $reg;\n\t\t}\n\t\tif(sizeof($dato) > 0){\n\t\t\t$fec_actual = date(\"Y-m-d\");\n\t\t\t$idreg = $dato[0]->id_salida;\n\t\t\t$salant = $dato[0]->sal_ant;\n\t\t\t$canegr = $dato[0]->cant_egre;\n\t\t\t$saldo = $dato[0]->saldo;\n\t\t\t$regi = $dato[0]->fec_reg;\n\t\t\tif($dato[0]->id_ingreso == $lotvac){\n\t\t\t\t//Si existe ya un registro en el dia\n\t\t\t\tif ($regi == $fec_actual) {\n\t\t\t\t\t$canegr++;\n\t\t\t\t\t$saldo--;\n\t\t\t\t\t$sql = \"UPDATE salidainsumos\n\t\t\t\t\t\t\tSET \n\t\t\t\t\t\t\tcant_egre = '\".$canegr.\"',\n\t\t\t\t\t\t\tsaldo = '\".$saldo.\"'\n\t\t\t\t\t\t\twhere id_salida = '\".$idreg.\"' \";\n\t\t\t\t\t$this->db->query($sql);\n\t\t\t\t}\n\t\t\t\t//si no existe un registro en el dia\n\t\t\t\telse {\n\t\t\t\t\t$salant = $saldo;\n\t\t\t\t\t$egreso = 1;\n\t\t\t\t\t$saldo--;\n\t\t\t\t\t$sql = \"INSERT INTO salidainsumos VALUES (null, CURRENT_DATE(), '\".$salant.\"', '\".$salant.\"', '\".$egreso.\"', '0', '0', '0', '0', '0', '\".$saldo.\"', '\".$id_enf.\"', '\".$lotvac.\"' )\";\n\t\t\t\t\t$this->db->query($sql);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$salant = $saldo;\n\t\t\t\t$egreso = 1;\n\t\t\t\t$saldo--;\n\t\t\t\t$sql = \"INSERT INTO salidainsumos VALUES (null, CURRENT_DATE(), '\".$salant.\"', '\".$salant.\"', '\".$egreso.\"', '0', '0', '0', '0', '0', '\".$saldo.\"', '\".$id_enf.\"', '\".$lotvac.\"' )\";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tprint_r(\"Error 404\");exit;\n\t\t}\n\n\t\t$sql = \"SELECT * FROM salidainsumos WHERE id_salida = ( SELECT MAX(id_salida) FROM salidainsumos where id_ingreso = '\".$lotjer.\"' )\";\n\t\t$datoo = $this->db->query($sql);\n\t\t$dato = array();\n\t\twhile ($reg = $datoo->fetch_object()) {\n\t\t\t$dato[] = $reg;\n\t\t}\n\t\tif(sizeof($dato) > 0){\n\t\t\t$fec_actual = date(\"Y-m-d\");\n\t\t\t$idreg = $dato[0]->id_salida;\n\t\t\t$salant = $dato[0]->sal_ant;\n\t\t\t$canegr = $dato[0]->cant_egre;\n\t\t\t$saldo = $dato[0]->saldo;\n\t\t\t$regi = $dato[0]->fec_reg;\n\t\t\tif($dato[0]->id_ingreso == $lotjer){\n\t\t\t\t//Si existe ya un registro en el dia\n\t\t\t\tif ($regi == $fec_actual) {\n\t\t\t\t\t$canegr++;\n\t\t\t\t\t$saldo--;\n\t\t\t\t\t$sql = \"UPDATE salidainsumos\n\t\t\t\t\t\t\tSET \n\t\t\t\t\t\t\tcant_egre = '\".$canegr.\"',\n\t\t\t\t\t\t\tsaldo = '\".$saldo.\"'\n\t\t\t\t\t\t\twhere id_salida = '\".$idreg.\"' \";\n\t\t\t\t\t$this->db->query($sql);\n\t\t\t\t}\n\t\t\t\t//si no existe un registro en el dia\n\t\t\t\telse {\n\t\t\t\t\t$salant = $saldo;\n\t\t\t\t\t$egreso = 1;\n\t\t\t\t\t$saldo--;\n\t\t\t\t\t$sql = \"INSERT INTO salidainsumos VALUES (null, CURRENT_DATE(), '\".$salant.\"', '\".$salant.\"', '\".$egreso.\"', '0', '0', '0', '0', '0', '\".$saldo.\"', '\".$id_enf.\"', '\".$lotjer.\"' )\";\n\t\t\t\t\t$this->db->query($sql);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$salant = $saldo;\n\t\t\t\t$egreso = 1;\n\t\t\t\t$saldo--;\n\t\t\t\t$sql = \"INSERT INTO salidainsumos VALUES (null, CURRENT_DATE(), '\".$salant.\"', '\".$salant.\"', '\".$egreso.\"', '0', '0', '0', '0', '0', '\".$saldo.\"', '\".$id_enf.\"', '\".$lotjer.\"' )\";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tprint_r(\"Error 404\");exit;\n\t\t}\n\t}", "function EstadoCuentaDes(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_AGTD_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n $this->setParametro('id_agencia','id_agencia','int4');\n //Definicion de la lista del resultado del query\n $this->captura('fecha_ini','date');\n $this->captura('fecha_fin','date');\n $this->captura('titulo','varchar');\n $this->captura('mes','varchar');\n $this->captura('fecha','date');\n $this->captura('autorizacion__nro_deposito','varchar');\n $this->captura('id_periodo_venta','int4');\n $this->captura('monto_total','numeric');\n $this->captura('neto','numeric');\n $this->captura('monto','numeric');\n $this->captura('cierre_periodo','varchar');\n $this->captura('ajuste','varchar');\n $this->captura('tipo','varchar');\n $this->captura('transaccion','varchar');\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n // var_dump($this->respuesta);exit;\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function establecimientos4()\n\t{\t\n\t\t//-----------------------------------\n\t\t$data['estado'] \t\t= $this->input->post('estado');\n\t\t$departamento\t \t\t= $this->input->post('departamento');\n\t\t$localidad\t\t\t\t= $this->input->post('localidad');\n\t\t$escuela\t\t\t\t= $this->input->post('escuela');\n\t\t\n\t\t$data['localidad']\t\t= $this->input->post('localidad');\n\t\t$data['departamento']\t= $this->input->post('departamento');\n\t\t$data['escuela']\t\t= $this->input->post('escuela');\n\t\t\n\t\t//-----------------------------------\n\t\t$data['escuelas_localidad']\t\t\t=\t$this->opendatagov->datos_escuela($escuela);\n\t\t$escuela_localidad\t\t\t\t\t=\t$this->opendatagov->datos_escuela($escuela);\n\t\t\t\t\n\t\t//-----------------------------------\n\t\tforeach($escuela_localidad->result_array() as $row)\n\t { \n\t $cue = $row['Cue_Anexo'];\n\t }//fin de foreach de datos de la escuela\n\t\t$cue_anexo = substr($cue, 0, -2).'-'.substr($cue, -2);\n\t\t//------------------------------------------------------------\n\t\t$data['cursos_divisiones']\t\t\t=\t$this->opendatagov->datos_cursos($cue_anexo);\n\t\t$data['total']\t\t\t= $this->opendatagov->alumnos_escuela_total($cue_anexo);\n\t\t$data['femeninos']\t\t= $this->opendatagov->alumnos_escuela_femeninos($cue_anexo);\n\t\t$data['masculinos']\t\t= $this->opendatagov->alumnos_escuela_masculinos($cue_anexo);\n\t\t//------------------------------------------------------------\n\t\n\t\t$this->load->view('includes/header');\n\t\t$this->load->view('vista_establecimientos', $data);\n\t\t$this->load->view('includes/footer');\t\t\t\t\n\t}", "public function temporalizacion_prod($prod_id,$gestion){\n $prod=$this->model_producto->get_producto_id($prod_id); /// Producto Id\n $programado=$this->model_producto->producto_programado($prod_id,$gestion); /// Producto Programado\n $tp='';\n if($prod[0]['indi_id']==2){$tp='%';};\n $m[0]='g_id';\n $m[1]='enero';\n $m[2]='febrero';\n $m[3]='marzo';\n $m[4]='abril';\n $m[5]='mayo';\n $m[6]='junio';\n $m[7]='julio';\n $m[8]='agosto';\n $m[9]='septiembre';\n $m[10]='octubre';\n $m[11]='noviembre';\n $m[12]='diciembre';\n\n for ($i=1; $i <=12 ; $i++) { \n $prog[1][$i]=0;\n $prog[2][$i]=0;\n $prog[3][$i]=0;\n }\n\n $pa=0;\n if(count($programado)!=0){\n for ($i=1; $i <=12 ; $i++) { \n $prog[1][$i]=$programado[0][$m[$i]];\n/* $pa=$pa+$prog[1][$i];\n $prog[2][$i]=$pa+$prod[0]['prod_linea_base'];\n\n if($prod[0]['prod_meta']!=0){\n $prog[3][$i]=round(((($pa+$prod[0]['prod_linea_base'])/$prod[0]['prod_meta'])*100),1);\n } */ \n } \n }\n $tr_return = '';\n for($i = 1 ;$i<=12 ;$i++){\n $tr_return .= '<td bgcolor=\"#d2f5d2\" style=\"width: 3%; text-align: right\" title=\"'.$m[$i].'\"><b>'.$prog[1][$i].''.$tp.'</b></td>';\n }\n \n return $tr_return;\n }", "public function resultadoscursoAction()\r\n {\r\n // action body\r\n // requiere layout activado en aplication ini\r\n //$this->_helper->layout->disableLayout();\r\n //echo \"voy bien 1\";\r\n //configuraci�n inicial\r\n $config = Zend_Registry::get('config');\r\n //echo \"voy bien 2\";\r\n //CONEXION\r\n $DB = Zend_Db_Table::getDefaultAdapter();\r\n //echo \"voy bien 3\";\r\n \r\n\r\n //PARAMETROS\r\n\r\n $S_CODCOL=$this->_request->getParam('codigoColegio');\r\n $S_CODLISTA = $this->_request->getParam('codigoLista');\r\n $S_TIPOUSUARIO = $this->_request->getParam('tipoUsuario');\r\n\r\n\t\tif(trim($S_CODCOL)!=\"\" && trim($S_CODLISTA)!=\"\" )\r\n {\r\n $sql = \"select count(rut) as inscritos from olimpiadas.tblacceso where institucion = $S_CODCOL and lista = '$S_CODLISTA';\";\r\n $rowset = $DB->fetchAll($sql);\r\n //print_r($rowset);\r\n if (count($rowset) > 0)\r\n {\r\n $equipos = $rowset[0]['inscritos'];\r\n }else{\r\n $equipos = 0;\r\n }\r\n $sql = \"Select a.nombre,a.curso, date_format(r.termino,'%H:%i') as hora, r.puntaje, d.*\r\n from tblregistro r, tblacceso a, tbldetallecursos d\r\n\t\t\t\t\t\twhere a.rut = r.rut and r.modulo = d.modulo and a.institucion = $S_CODCOL and a.lista = '$S_CODLISTA' and (r.termino <> '' and r.termino is not null)\";\r\n\t\t\t\t\r\n //echo($sql);\r\n try{\r\n $rowset = $DB->fetchAll($sql);\r\n //print_r($rowset);\r\n if (count($rowset) > 0)\r\n {\r\n $puntos_acumulados = 0;\r\n $multiplier = 0;\r\n $vector_datos = array();\r\n\r\n foreach($rowset as $key => $val){\r\n switch ($val['curso']){\r\n case '3 BASICO' : $multiplier = 500 + ($val['tercero'] * 500); break;\r\n case '4 BASICO' : $multiplier = 500 + ($val['cuarto'] * 500); break;\r\n case '5 BASICO' : $multiplier = 500 + ($val['quinto'] * 500); break;\r\n case '6 BASICO' : $multiplier = 500 + ($val['sexto'] * 500); break;\r\n case '7 BASICO' : $multiplier = 500 + ($val['septimo'] * 500); break;\r\n case '8 BASICO' : $multiplier = 500 + ($val['octavo'] * 500); break;\r\n case 'I MEDIO' : $multiplier = 500 + ($val['primero_medio'] * 500); break;\r\n case 'II MEDIO' : $multiplier = 500 + ($val['segundo_medio'] * 500); break;\r\n case 'III MEDIO' : $multiplier = 500 + ($val['tercero_medio'] * 500); break;\r\n case 'IV MEDIO' : $multiplier = 500 + ($val['cuarto_medio'] * 500); break;\r\n }\r\n\r\n $puntos = ($val['puntaje'] * $multiplier) / 100;\r\n $puntos_acumulados+= $puntos;\r\n\r\n $vector_datos[] = array(\r\n \"nombre\" => $val['nombre'],\r\n \"descripcion\" => $val['descripcion'],\r\n \"hora\" => $val['hora'],\r\n \"puntaje\" => round($val['puntaje'],1),\r\n \"puntos\" => $puntos,\r\n );\r\n\r\n\r\n }\r\n Zend_Layout::getMvcInstance()->assign('actcol',$vector_datos);\r\n Zend_Layout::getMvcInstance()->assign('puntaje',round($puntos_acumulados / $equipos,1));\r\n Zend_Layout::getMvcInstance()->assign('equipos',$equipos);\r\n Zend_Layout::getMvcInstance()->assign('usuario',$S_TIPOUSUARIO);\r\n }\r\n\r\n }\r\n catch (Zend_Exception $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n }\r\n else\r\n {\r\n $this->_helper->layout->disableLayout();\r\n echo \"-1\";\r\n }\r\n\r\n }", "public function componente_operacion_pi_nuevo($com_id){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente = $this->model_componente->get_componente_pi($com_id); //// DATOS COMPONENTE\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']); /// DATOS FASE\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $mes = $this->mes_nombre();\n $tabla='';\n $tabla.='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" style=\"width:100%;\" align=\"center\">\n <thead>\n <tr class=\"modo1\">\n <th style=\"width:1%;\" style=\"background-color: #1c7368; color: #FFFFFF\" style=\"height:12px;\">#</th>\n <th style=\"width:9%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ACCI&Oacute;N ESTRATEGICA</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">OPERACI&Oacute;N</th>\n <th style=\"width:9%;\" style=\"background-color: #1c7368; color: #FFFFFF\">RESULTADO</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ACTIVIDAD</th>\n <th style=\"width:7%;\" style=\"background-color: #1c7368; color: #FFFFFF\">INDICADOR</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">LB.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">META</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ENE.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">FEB.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAR.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ABR.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAY.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUN.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUL.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">AGO.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">SEPT.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">OCT.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">NOV.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">DIC.</th>\n <th style=\"width:8%;\" style=\"background-color: #1c7368; color: #FFFFFF\">VERIFICACI&Oacute;N</th> \n <th style=\"width:4%;\" style=\"background-color: #1c7368; color: #FFFFFF\">PPTO.</th>\n </tr> \n \n </thead>\n <tbody>';\n $nro=0;\n if(count($obj_est)!=0){\n foreach($obj_est as $rowo){\n $tabla.='<tr class=\"modo1\" bgcolor=\"#9cdcd4\"><td colspan=\"22\" style=\"width: 100%; text-align: left\" style=\"height:13px;\">OBJ. EST. '.$rowo['obj_codigo'].'.- '.$rowo['obj_descripcion'].'</td></tr>';\n $productos=$this->model_producto->list_producto_programado_oestrategico($com_id,$this->gestion,$rowo['obj_id'],$rowo['gi'],$rowo['gf']); /// Productos\n foreach($productos as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $color=''; $tp='';\n if($rowp['indi_id']==1){\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n elseif ($rowp['indi_id']==2) {\n $tp='%';\n if($rowp['mt_id']==3){\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n }\n\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $nro++;\n\n $tabla.='<tr class=\"modo1\" bgcolor=\"'.$color.'\">';\n $tabla.=' <td style=\"width: 1%; text-align: left;\" style=\"height:11px;\">'.$nro.'</td>\n <td style=\"width: 9%; text-align: left;\">'.$rowp['acc_codigo'].'.- '.$rowp['acc_descripcion'].'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['prod_producto'].'</td>\n <td style=\"width: 9%; text-align: left;\">'.$rowp['prod_resultado'].'</td>\n <td style=\"width: 10%; text-align: left;\"></td>\n <td style=\"width: 7%; text-align: left;\">'.$rowp['prod_indicador'].'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['prod_linea_base'],2).'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['prod_meta'],2).'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['enero'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['febrero'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['marzo'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['abril'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['mayo'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['junio'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['julio'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['agosto'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['septiembre'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['octubre'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['noviembre'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['diciembre'],2).''.$tp.'</td>\n <td style=\"width: 8%; text-align: left;\">'.$rowp['prod_fuente_verificacion'].'</td>\n <td style=\"width: 5%; text-align: right;\"></td>'; \n $tabla.='</tr>';\n $tabla.=''.$this->actividades_2019($rowp['prod_id'],$nro).'';\n }\n }\n }\n else{\n $tabla.='<tr class=\"modo1\"><td colspan=\"22\" style=\"width: 100%; text-align: left;\">SIN OPERACIONES</td></tr>';\n }\n $tabla.='\n </tbody>\n </table>';\n\n return $tabla;\n }", "function oprimio($mysqli){\t \t\n\t \t\t//obtencion de valores\n\t \t\t//datos de la factura\n\t \t\t$arts = $_POST ['narts'];\n\t \t\t$ref= $_POST ['idfact'];\n\t\t\t$fecha =strtoupper($_POST ['idfecha']) ;\n\t\t\t$oc= $_POST ['oc'];\n\t\t\t$remision =$_POST ['rem'] ;\t\n\t\t\t$subtotal= $_POST ['ist'];\n\t\t\t$iva= $_POST ['idiva'];\n\t\t\t$total= $_POST ['idtot'];\n\t\t\t$agente =$_POST ['idrepresentantes']; \n\t\t\t//construye el numero adecuado de sucursal\n\t\t\t$idclientes = $_POST ['idclientes'];\t\n\t\t\t$nosuc = decidesuc($idclientes,$_POST['idsuccliente']);\n\t\t\t$observaciones = $_POST ['obser'];\n\t\t\t$usu = $_SESSION['login_user'];\t\n\t\t\t$invact = 99;\n\t\t\t\n\t\t\t//datos de los articulos.ciclo por cada articulo\n\t\t\t$table = 'artfactura';\n\t\t\t$table2 = 'inventarios';\n\t\t\t$table3 = 'remisiones';\n\t//ciclo por tantos articulos como haya en la factura\t\t\n\t\t\tfor ($i=0; $i<$arts; $i++) {\n\t \t\t$idproductos= $_POST ['tdid'.$i];\n\t\t\t\t$punit= $_POST ['tdi4'.$i];\n\t\t\t\t$cantidad = $_POST ['tdi3'.$i];\n\t\t\t\t$impor = $_POST ['tdi5'.$i];\t\t\t\n//cambios en la tabla de inventarios si no hay numero de remision.\n\t\t\t\tif($remision == ''){\n//disminución de almacen central\n\t\t\t \t\t$sqlCommand= \"INSERT INTO $table2 (idproductos,fecha,almacen,tipomov,cantidad,referencia,usu,status)\n\t\t\t \tVALUES ($idproductos,'$fecha',999999,2,-$cantidad,$ref,'$usu',5)\";\n\t\t\t\t\t// Execute the query here now\n\t\t\t \t$query=mysqli_query($mysqli, $sqlCommand) or die (\"error en alta de inventarios\".mysqli_error($mysqli));\n//decremento en almacen de inventario. mientras no se tengan pasos separados en logistica\n\t\t\t\t\t//se supone que nos estamos enterando de los productos consumidos.\n\t\t\t\t\t\t\t\t$sqlCommand= \"INSERT INTO $table2 (idproductos,fecha,almacen,tipomov,cantidad,referencia,usu,status)\n\t\t\t\t\t\t \tVALUES ($idproductos,'$fecha','$nosuc',2,-$cantidad,$ref,'$usu',5)\";\n\t\t\t\t\t\t\t\t$query=mysqli_query($mysqli, $sqlCommand) or die (\"error en disminucion inv cent \".mysqli_error($mysqli)); \n//Incremento en almacen de destino\n\t\t\t\t\t\t \t\t$sqlCommand= \"INSERT INTO $table2 (idproductos,fecha,almacen,tipomov,cantidad,referencia,usu,status)\n\t\t\t\t\t\t \tVALUES ($idproductos,'$fecha','$nosuc',1,$cantidad,$ref,'$usu',5)\";\n\t\t\t\t\t\t\t\t$query=mysqli_query($mysqli, $sqlCommand) or die (\"error en incremento inv cent \".mysqli_error($mysqli)); \n//si hay numero de remision, se disminuye el inventario del cliente\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sqlCommand= \"INSERT INTO $table2 (idproductos,fecha,almacen,tipomov,cantidad,referencia,usu,status)\n\t\t\t\t\t\t \tVALUES ($idproductos,'$fecha','$nosuc',2,-$cantidad,$ref,'$usu',5)\";\n\t\t\t\t\t\t\t\t$query=mysqli_query($mysqli, $sqlCommand) or die (\"error en disminucion inv cte \".mysqli_error($mysqli));\n\t\t\t//MARCADO DE REMISION COMO FACTURADA EN TABLA REMISIONES\n\t\t\t\t\t\t\t\t$sqlCommand = \"UPDATE $table3 SET factura ='$ref', status =10 WHERE idremisiones= $remision LIMIT 1\";\n\t\t\t\t\t\t\t // Execute the query here now\n\t\t\t\t\t \t\t$query = mysqli_query($mysqli, $sqlCommand) or die ('error en marcado de remision '.mysqli_error($mysqli)); \n\t\t\t\t\t}\n//obtencion del numero de movimiento del inventario\n\t\t\t\t\t\t\t\t$sql= \"SELECT MAX(idinventarios) FROM inventarios\";\n\t\t\t\t\t $result = mysqli_query($mysqli,$sql);\n\t\t\t\t\t $result2 = mysqli_fetch_row($result);\n\t\t\t\t\t\t\t\t$invact= $result2[0];\n\t\t\t\t\t\n//INSERCION EN TABLA ARTICULOS\t\t\t\n\t\t\t\t$sqlCommand= \"INSERT INTO $table (idfactura,codigo,precio_unitario,cantidad,importe,idinventario)\n\t \t\tVALUES ($ref,$idproductos,$punit,$cantidad,$impor,$invact)\";\n\t\t\t\t// Execute the query here now\n\t\t \t$query=mysqli_query($mysqli, $sqlCommand) or die (\"error en tabla artfactura \".mysqli_error($mysqli));\t\n\t\t\t} \n\t\t\t\t \t\t \n//INSERCION EN TABLA FACTURAS\n\t\t\t\t$table = 'facturas2';\n\t\t \t\t$sqlCommand= \"INSERT INTO $table (no_factura,fecha,oc,remision,subtotal,iva,total,agente,idsuccliente,\n\t\t \t\tidclientes,observaciones,usu)\n\t\t \tVALUES ($ref,'$fecha','$oc','$remision',$subtotal,$iva,$total,'$agente','$nosuc',$idclientes,'$observaciones',\n\t\t \t'$usu')\";\n\t\t\t// Execute the query here now\n\t \t\t$query=mysqli_query($mysqli, $sqlCommand) or die (\"error en tabla facturas \".mysqli_error($mysqli)); \n\t\t\t\n}", "public function componente_operacion_nuevo($com_id){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente = $this->model_componente->get_componente_pi($com_id); //// DATOS COMPONENTE\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']); /// DATOS FASE\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $mes = $this->mes_nombre();\n $tabla='';\n $tabla.='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" style=\"width:100%;\" align=\"center\">\n <thead>\n <tr class=\"modo1\">\n <th style=\"width:1%;\" style=\"background-color: #1c7368; color: #FFFFFF\" style=\"height:12px;\">#</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ACCI&Oacute;N ESTRATEGICA</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">OPERACI&Oacute;N</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">RESULTADO</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">INDICADOR</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">LB.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">META</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ENE.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">FEB.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAR.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ABR.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAY.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUN.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUL.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">AGO.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">SEPT.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">OCT.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">NOV.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">DIC.</th>\n <th style=\"width:8%;\" style=\"background-color: #1c7368; color: #FFFFFF\">VERIFICACI&Oacute;N</th> \n <th style=\"width:4%;\" style=\"background-color: #1c7368; color: #FFFFFF\">PPTO.</th> \n <th style=\"width:4%;\" style=\"background-color: #1c7368; color: #FFFFFF\">COD. PPTO.</th> \n </tr> \n \n </thead>\n <tbody>';\n $nro=0;\n if(count($obj_est)!=0){\n foreach($obj_est as $rowo){\n $productos=$this->model_producto->list_producto_programado_oestrategico($com_id,$this->gestion,$rowo['obj_id'],$rowo['gi'],$rowo['gf']); /// Productos\n\n if(count($productos)!=0){\n $tabla.='<tr class=\"modo1\" bgcolor=\"#9cdcd4\"><td colspan=\"22\" style=\"width: 100%; text-align: left\" style=\"height:13px;\">OBJ. EST. '.$rowo['obj_codigo'].'.- '.$rowo['obj_descripcion'].'</td></tr>';\n foreach($productos as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $color=''; $tp='';\n if($rowp['indi_id']==1){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n elseif ($rowp['indi_id']==2) {\n $tp='%';\n if($rowp['mt_id']==3){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n }\n\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $nro++;\n\n $tabla.='<tr class=\"modo1\" bgcolor=\"'.$color.'\">';\n $tabla.=' <td style=\"width: 1%; text-align: left;\" style=\"height:11px;\">'.$nro.'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['acc_codigo'].'.- '.$rowp['acc_descripcion'].'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['prod_producto'].'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['prod_resultado'].'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['prod_indicador'].'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['prod_linea_base'],2).'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['prod_meta'],2).'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['enero'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['febrero'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['marzo'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['abril'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['mayo'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['junio'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['julio'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['agosto'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['septiembre'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['octubre'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['noviembre'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['diciembre'],2).''.$tp.'</td>\n <td style=\"width: 8%; text-align: left;\">'.$rowp['prod_fuente_verificacion'].'</td>\n <td style=\"width: 4%; text-align: right;\">'.number_format($ptto, 2, ',', '.').'</td>\n <td style=\"width: 4%; text-align: center;\" bgcolor=\"#dedcdc\">'.$rowp['prod_cod'].'</td>'; \n $tabla.='</tr>';\n }\n }\n }\n }\n else{\n $tabla.='<tr class=\"modo1\"><td colspan=\"22\" style=\"width: 100%; text-align: left;\">SIN OPERACIONES</td></tr>';\n }\n $tabla.='\n </tbody>\n </table>';\n\n return $tabla;\n }", "public function operaciones2019($proy_id,$com_id){\n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); \n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// recupera datos de la tabla fase activa\n $productos = $this->model_producto->list_producto_programado($com_id,$this->gestion); // Lista de productos\n $tabla ='';\n $tabla .='<thead>\n <tr class=\"modo1\">\n <th style=\"width:1%; text-align=center\"><b>COD.</b></th>\n <th style=\"width:1%; text-align=center\"><b>E/B</b></th>\n <th style=\"width:20%;\"><b>OPERACI&Oacute;N</b></th>\n <th style=\"width:20%;\"><b>RESULTADO</b></th>\n <th style=\"width:10%;\"><b>TIP. IND.</b></th>\n <th style=\"width:10%;\"><b>INDICADOR</b></th>\n <th style=\"width:1%;\"><b>LINEA BASE</b></th>\n <th style=\"width:1%;\"><b>META</b></th>\n <th style=\"width:5%;\"><b>PONDERACI&Oacute;N</b></th>\n <th style=\"width:4%;\"><b>ENE.</b></th>\n <th style=\"width:4%;\"><b>FEB.</b></th>\n <th style=\"width:4%;\"><b>MAR.</b></th>\n <th style=\"width:4%;\"><b>ABR.</b></th>\n <th style=\"width:4%;\"><b>MAY.</b></th>\n <th style=\"width:4%;\"><b>JUN.</b></th>\n <th style=\"width:4%;\"><b>JUL.</b></th>\n <th style=\"width:4%;\"><b>AGO.</b></th>\n <th style=\"width:4%;\"><b>SEP.</b></th>\n <th style=\"width:4%;\"><b>OCT.</b></th>\n <th style=\"width:4%;\"><b>NOV.</b></th>\n <th style=\"width:4%;\"><b>DIC.</b></th>\n <th style=\"width:7%;\"><b>MEDIO DE VERIFICACI&Oacute;N</b></th>\n <th style=\"width:7%;\"><b>DELETE</b></th>\n <th style=\"width:7%;\"><b>NRO. REQ.</b></th>\n </tr>\n </thead>\n <tbody>';\n $cont = 0;\n foreach($productos as $rowp){\n $cont++;\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $color='';\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n $tabla .='<tr bgcolor=\"'.$color.'\" class=\"modo1\">';\n $tabla.='<td title=\"C&Oacute;DIGO OPERACI&Oacute;N : '.$rowp['prod_cod'].'\" align=\"center\"><font color=\"blue\" size=\"2\"><b>'.$rowp['prod_cod'].'</b></font></td>';\n $tabla.='<td align=\"center\">';\n $tabla.='<a href=\"'.site_url(\"admin\").'/prog/mod_prod/'.$rowp['prod_id'].'\" title=\"MODIFICAR OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/modificar.png\" WIDTH=\"33\" HEIGHT=\"34\"/></a>';\n $tabla.='<a href=\"'.site_url(\"\").'/prog/requerimiento/'.$proy_id.'/'.$rowp['prod_id'].'\" target=\"_blank\" title=\"REQUERIMIENTOS DE LA OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/insumo.png\" WIDTH=\"33\" HEIGHT=\"33\"/></a>';\n\n $tabla.='</td>';\n $tabla.='<td style=\"width:20%;\">'.$rowp['prod_producto'].'</td>';\n $tabla.='<td style=\"width:20%;\">'.$rowp['prod_resultado'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['indi_abreviacion'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_indicador'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_linea_base'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_meta'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_ponderacion'].'%</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['enero'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['febrero'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['marzo'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['abril'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['mayo'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['junio'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['julio'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['agosto'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['septiembre'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['octubre'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['noviembre'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['diciembre'].'</td>';\n $tabla.='<td style=\"width:7%;\" bgcolor=\"#e5fde5\">'.$rowp['prod_fuente_verificacion'].'</td>';\n $tabla.='<td style=\"width:7%;\">';\n $tabla.='<a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_del_ff\" class=\"btn btn-default del_ff\" title=\"ELIMINAR OPERACI&Oacute;N\" name=\"'.$rowp['prod_id'].'\" id=\"'.$proy_id.'\"><img src=\"' . base_url() . 'assets/ifinal/eliminar.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a><br><br>';\n $tabla.='<center>\n <input type=\"checkbox\" name=\"req[]\" value=\"'.$rowp['prod_id'].'\" onclick=\"scheck'.$cont.'(this.checked);\"/>\n </center>';\n $tabla.='</td>';\n $tabla.='<td style=\"width:7%;\" align=\"center\"><font color=\"blue\" size=\"2\"><b>'.count($this->model_producto->insumo_producto($rowp['prod_id'])).'</b></font></td>';\n $tabla .='</tr>';\n ?>\n <script>\n function scheck<?php echo $cont;?>(estaChequeado) {\n val = parseInt($('[name=\"tot\"]').val());\n if (estaChequeado == true) {\n val = val + 1;\n } else {\n val = val - 1;\n }\n $('[name=\"tot\"]').val((val).toFixed(0));\n }\n </script>\n <?php\n }\n $tabla.='</tbody>';\n\n return $tabla;\n }", "public function actividades_2019($prod_id,$nro){\n $actividad=$this->model_actividad->list_act_anual($prod_id); /// Actividad\n $tabla='';\n $nro_a=0;\n if(count($actividad)!=0){\n foreach ($actividad as $row){\n $programado=$this->model_actividad->actividad_programado($row['act_id'],$this->gestion); /// Actividad Programado\n if(count($programado)!=0){\n $nro_a++;\n $monto=$this->model_actividad->monto_insumoactividad($row['act_id']);\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n $tabla.='<tr class=\"modo1\" bgcolor=\"#f5f5f5\">';\n $tabla.='<td style=\"width: 1%; text-align: left;\" style=\"height:11px;\">'.$nro.'.'.$nro_a.'</td>';\n $tabla.='<td style=\"width: 9%; text-align: left;\"></td>';\n $tabla.='<td style=\"width: 10%; text-align: left;\"></td>';\n $tabla.='<td style=\"width: 9%; text-align: left;\"></td>';\n $tabla.='<td style=\"width: 10%; text-align: left;\">'.$row['act_actividad'].'</td>';\n $tabla.='<td style=\"width: 7%; text-align: left;\">'.$row['act_indicador'].'</td>';\n $tabla.='<td style=\"width: 3%; text-align: right;\">'.$row['act_linea_base'].'</td>';\n $tabla.='<td style=\"width: 2.5%; text-align: right;\">'.$row['act_meta'].'</td>';\n $tabla.='<td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['enero'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['febrero'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['marzo'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['abril'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['mayo'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['junio'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['julio'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['agosto'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['septiembre'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['octubre'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['noviembre'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['diciembre'].'</td>';\n $tabla.='<td style=\"width: 8%; text-align: left;\">'.$row['act_fuente_verificacion'].'</td>';\n $tabla.='<td style=\"width: 5%; text-align: left;\">'.number_format($ptto, 2, ',', '.').'</td>';\n $tabla.='</tr>';\n }\n \n }\n }\n\n return $tabla;\n }", "public function formuAction(){\t\n \t$cn = new Model_DbDatos_Datos();\n\t\t$fn = new Libreria_Pintar();\n\t\t$ar = new Libreria_ArraysFunctions();\n\n \t$codCarta = $this->_request->getParam('codCarta',''); \n\t\t\n\t\t\n\t\t//Cargando combos fiscalizadores\n\n\t\tunset($parametros);\n \t$parametros[] = array('@mquery',22);\n \t$parametros[] = array('@idCarta',$codCarta);\n\t\t$rowFicalizadores = $cn->ejec_store_procedura_sql('[SP_FISCA_CARTA_REQ]',$parametros);\n\n\t\t$fiscalizadoresCombo = $ar->RegistrosComboc($rowFicalizadores,0,1,'');\n\t\t$val[] = array('#cbNotificadores',$fn->ContenidoCombo($fiscalizadoresCombo,'[Seleccione]',''),'html');\n\t\t \t\n\n\t\t//Cargando cabecera del cargo de notificacion\t\t\n\t\tunset($parametros);\n\t\t$parametros[] = array('@mquery',20);\n \t$parametros[] = array('@idCarta',$codCarta);\n \t$rowCabecera = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_CARGO_NOTIFICA]',$parametros);\n\n \tif ($rowCabecera[0]) {\n \t\t$row = $rowCabecera[1][0]; \n\n \t\t$codCargoNotificacion = $row[0];\n \t\t$nroCargoNotificacion = $row[1].\" - \".$row[9];\n \t\t$codContrib = $row[2];\n \t\t$contribuyente = trim(utf8_encode( strtoupper($row[3].\" \".$row[4].\" \".$row[5])));\n \t\t$idTipoDocIdent = $row[6];\n \t\t$nroDocIdent = $row[7];\n \t\t$domicilioFiscal = strtoupper(utf8_encode( $row[8]));\n \t\t$anio = $row[9];\n \t\t$nroCartareq = $row[10].\" - \".$row[9];\n \t\n \t\t$val[] = array('#hcodCartaReq',$codCarta,'val');\n \t\t$val[] = array('#txtNroNotificacion',$nroCargoNotificacion,'val');\n \t\t$val[] = array('#hcodNotificacion',$codCargoNotificacion,'val');\n \t\t$val[] = array('#txtCodigoContribuyenteN',$codContrib,'val');\n \t\t$val[] = array('#txtContribuyenteN',$contribuyente,'val');\n \t\t$val[] = array('#hTipoDocIdent',$idTipoDocIdent,'val');\n \t\t$val[] = array('#hNroDocIdent',$nroDocIdent,'val');\n \t\t$val[] = array('#txtDomicilioFiscal',$domicilioFiscal,'val');\n \t\t$val[] = array('#txtAnioN',$anio,'val');\n \t\t$val[] = array('#txtNroCartaReqN',$nroCartareq,'val');\n\n \t\t//CARGANDO DATOS DE LA PERSONA QUIEN RECEPCIONA\n \t\tunset($parametros);\n\t\t\t$parametros[] = array('@mquery',21);\n\t \t$parametros[] = array('@idCargoNotFisca',$codCargoNotificacion);\n\t \t$rowDatosPersona = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_CARGO_NOTIFICA]',$parametros);\n\t\t\t\n\n\t \tif ($rowDatosPersona[0]) {\n\t \t\t\n\t \t\t$row = $rowDatosPersona[1][0];\n\n\t\t\t unset($parametros);\n\t\t\t\t$parametros[] = array('@mquery',7);\n\t\t \t$rowTDoc = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_T_DOC_IDEN]',$parametros);\n\t\t \t$row2 = $rowTDoc[1];\n\t\t \t\n\t\t \tforeach ($row2 as $f) {\n\t\t \t\tif ($f[0]==1) {\t$val[]= array('#hmaxDni',$f[2],'val');}\n\t\t \t\tif ($f[0]==5) {\t$val[]= array('#hmaxIdentidad',$f[2],'val');}\n\t\t \t\tif ($f[0]==9) {\t$val[]= array('#hmaxExtranjeria',$f[2],'val');}\n\t\t \t}\n\n\t \t\t$nomRecepciona = trim(utf8_encode($row[0]));\n\t \t\t$idTipoDocIdent = trim($row[1]);\n\t \t\t$nomTDocIden = trim(utf8_encode($row[2]));\n\t \t\t$nroDocIdent = trim($row[3]);\n\t \t\t$fechaNotifica = (!empty($row[4]) && !empty($row[5]) && !empty($row[6]))? $row[4].\"/\".$row[5].\"/\".$row[6] : '';\n\t \t\t$horaNotifica = trim($row[7]);\n\t \t\t$NegoIdentificar = trim($row[8]);\n\t \t\t$NegoFirmar = $row[9];\n\t \t\t$NegoRecibir = $row[10];\n\t \t\t$firma = $row[11];\n\t \t\t$idVinculo = $row[12];\n\t \t\t$vinculo = $row[13];\n\t \t\t$vinculo_otros = trim($row[14]);\n\n\t \t\t$val[] = array('#txtNomApeRecepciona',$nomRecepciona,'val');\n\t \t\tif($idTipoDocIdent==1){$evt[] = array('#chkDni','checked','true');}\n\t \t\tif($idTipoDocIdent==5){$evt[] = array('#chkIdentidad','checked','true');}\n\t \t\tif($idTipoDocIdent==9){$evt[] = array('#chkExtranjeria','checked','true');}\n\t \t\t$val[] = array('#txtNroDocIdent',$nroDocIdent,'val');\n\t \t\t$val[] = array('#dpFechaNotifica',$fechaNotifica,'val');\n\t \t\t$val[] = array('#txtHoraNotifica',$horaNotifica,'val');\n\t \t\tif($NegoIdentificar==1){$evt[] = array('#chkNegoIdentificar','checked','true');}\n\t \t\tif($NegoFirmar==1){$evt[] = array('#chkNegoFirmar','checked','true');}\n\t \t\tif($NegoRecibir==1){$evt[] = array('#chkNegoRecibir','checked','true');}\n\t \t\t$evt[] = array(( ($firma==1) ? \"#rdFirmaRecepcionaSi\" : \"#rdFirmaRecepcionaNo\"),\"checked\",\"true\");\n\t \t\tif($idVinculo==1){$evt[] = array('#chkTitular','checked','true');}\n\t \t\tif($idVinculo==2){$evt[] = array('#chkFamiliar','checked','true');}\n\t \t\tif($idVinculo==3){$evt[] = array('#chkVigilante','checked','true');}\n\t \t\tif($idVinculo==4){$evt[] = array('#chkEmpleado','checked','true');}\n\t \t\tif($idVinculo==5){$evt[] = array('#chkRepresentante','checked','true');}\n\t \t\tif($idVinculo==6){$evt[] = array('#chkVinculoOtros','checked','true');$val[] = array('#txtVinculoOtros',$vinculo_otros,'val');}\n\n\n\t \t\t//CARGANDO DATOS DEL CEDULON Y MOTIVOS DE NO ENTREGA\n\n\t \t\tunset($parametros);\n\t\t\t\t$parametros[] = array('@mquery',22);\n\t\t \t$parametros[] = array('@idCargoNotFisca',$codCargoNotificacion);\n\t\t \t$rowCedulonMovNoEntrega = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_CARGO_NOTIFICA]',$parametros);\n\t\t \t\n\t\t \tif ($rowCedulonMovNoEntrega[0]) {\n\t\t \t\t$row = $rowCedulonMovNoEntrega[1][0]; \n\n\t\t \t\t$codCedulon = trim($row[0]);\n\t\t \t\t$PersonaIncapaz = trim($row[1]);\n\t\t \t\t$DomicilioCerrado = trim($row[2]);\n\t\t \t\t$fechaCedulon = (!empty($row[3]) && !empty($row[4]) && !empty($row[5])) ? $row[3].\"/\".$row[4].\"/\".$row[5] : '' ;\n\t\t \t\t$horaCedulon = trim($row[6]);\n\t\t \t\t$direcccionIncorrecta = trim($row[7]);\n\t\t \t\t$direccionInexistente = trim($row[8]);\n\t\t \t\t$otrosMotNoEntrega = $row[9];\n\t\t \t\t$otrosValor = trim($row[10]);\n\t\t \t\t$codInmueble = trim($row[11]);\n\t\t \t\t$nroPisos = trim($row[12]);\n\t\t \t\t$color = trim($row[13]);\n\t\t \t\t$casa = trim($row[14]);\n\t\t \t\t$edificio = trim($row[15]);\n\t\t \t\t$PuertaMadera = trim($row[16]);\n\t\t \t\t$PuertaFierro = trim($row[17]);\n\t\t \t\t$SuminElect = trim($row[18]);\n\t\t \t\t$in_Otros = trim($row[19]);\n\t\t \t\t$in_OtrosValor = trim($row[20]);\n\n\t\t \t\t$val[] = array('#hcodCedulon',$codCedulon,'val');\n\t\t \t\tif($PersonaIncapaz==1){ $evt[] = array('#chkPersonaIncapaz','checked','true');}\n\t\t \t\tif($DomicilioCerrado==1){ $evt[] = array('#chkDomicilioCerrado','checked','true');}\n\t\t \t\t$val[] = array('#dpFechaCedulon',$fechaCedulon,'val');\n\t\t \t\t$val[] = array('#txtHoraCedulon',$horaCedulon,'val');\n\t\t \t\tif($direcccionIncorrecta==1){ $evt[] = array('#chkDireccionIncorrecta','checked','true');}\n\t\t \t\tif($direccionInexistente==1){ $evt[] = array('#chkDireccionInexistente','checked','true');}\n\t\t \t\tif($otrosMotNoEntrega==1){$evt[]=array('#chkMotNoEntregaOtros','checked','true');$val[] = array('#txtNoEntregaOtros',$otrosValor,'val');}\n\t\t \t\t\n\t\t \t\t$val[] = array('#hcodInmueble',$codInmueble,'val');\n\t\t \t\t$val[] = array('#txtNroPisos',$nroPisos,'val');\n\t\t \t\t$val[] = array('#txtColor',$color,'val');\n\t\t \t\tif($casa==1){ $evt[] = array('#chkCasa','checked','true');}\n\t\t \t\tif($edificio==1){ $evt[] = array('#chkEdificio','checked','true');}\n\t\t \t\tif($PuertaMadera==1){ $evt[] = array('#chkMadera','checked','true');}\n\t\t \t\tif($PuertaFierro==1){ $evt[] = array('#chkFierro','checked','true');}\n\t\t \t\t$val[] = array('#txtSuministroElectrico',$SuminElect,'val');\n\t\t \t\tif($in_Otros==1){$evt[]=array('#chkInmuebleOtros','checked','true');$val[] = array('#txtInmuebleOtros',$in_OtrosValor,'val');}\n\t\t \t\t\n\n\n\t\t \t\t//CARGA DE DATOS DE VISITA EFECTUADA\n\t\t \t\tunset($parametros);\n\t\t\t\t\t$parametros[] = array('@mquery',23);\n\t\t\t \t$parametros[] = array('@idCargoNotFisca',$codCargoNotificacion);\n\t\t\t \t$rowVisitaEfectuada = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_CARGO_NOTIFICA]',$parametros);\n\t\t\t \t\n\t\t\t \tif ($rowVisitaEfectuada[0]) {\n\t\t\t \t\t$row = $rowVisitaEfectuada[1][0]; \n\n\t\t\t \t\t$fechaVisita = (!empty($row[0]) && !empty($row[1]) && !empty($row[2])) ? $row[0].\"/\".$row[1].\"/\".$row[2] : '' ;\n\t\t\t \t\t$codNotificador = trim($row[3]);\n\t\t\t \t\t$dniNotificador = trim($row[4]);\n\t\t\t \t\t$firmaNotificador = trim($row[5]);\n\n\t\t\t \t\t$val[] = array('#dpFechaVisita',$fechaVisita,'val');\n\t\t\t \t\t$val[] = array('#cbNotificadores',$codNotificador.'-'.$dniNotificador,'val');\n\t\t\t \t\t$val[] = array('#txtdniNotificador',$dniNotificador,'val');\n\t\t\t \t\t$evt[] = array((($firmaNotificador==1) ? \"#rdFirmaNotSi\" : \"#rdFirmaNotNo\"),\"checked\",\"true\");\n\n\n\t\t\t \t}else{\n\t\t\t \t\techo utf8_encode($rowVisitaEfectuada[1]); \n\t\t\t \t}\n\n\t\t \t}else{\n\t\t\t\t\techo utf8_encode($rowCedulonMovNoEntrega[1]); \n\t\t \t} \n\n\t \t}else{\n\t \t\techo utf8_encode($rowDatosPersona[1]); \n\t \t}\n\n \t}else{\n \t\techo utf8_encode($rowCabecera[1]);\n \t}\n\n\t\t$evt[] = array('#contentBox6',\"tabs\",\"\");\t\n\t\t$evt[] = array('#contentBox7',\"tabs\",\"\");\t\n\t\t$evt[] = array('#contentBox8',\"tabs\",\"\");\t\t\t\t\n\t\t$evt[] = array('#tabsNotificacion',\"tabs\",\"\");\n\t\t$evt[] = array('#radioFirmaRecep',\"buttonset\",\"\");\n\t\t$evt[] = array('#radioFirmaNot',\"buttonset\",\"\");\n\t\t\n\t\t\n\n\t\t$fn->PintarEvento($evt);\n\t\t$fn->PintarValor($val);\n }", "public function accionesParticulares($str_accion, $objDatos) {\n \n\t\t//throw new Exception('Se ha intentado ejecutar la acción '.$str_accion.' y no está programada.'); \n\n\t\t//IgepDebug::setDebug(DEBUG_USER,\"El valor es: <pre>\".$str_accion.\"</pre>\");\n //$num=IgepSession::dameCampoTuplaSeleccionada('TcomintComunicaciones','edi_numorden');\n //$anyo=IgepSession::dameCampoTuplaSeleccionada('TcomintComunicaciones','edi_anyo');\n $id_animal=$objDatos->getValue('id_animal');\n $fecha=$objDatos->getValue('edi_fecha');\n switch ($str_accion) {\n case 'verInformeAnalisis':\n //Bucle para crear un listado para cada peticion seleccionada:\n // $objDatos->setOperation(\"seleccionar\");\n //$m_datosSeleccionados = $objDatos->currentTupla();\n $res = $this->consultar(\"SELECT nombre_fichero,informe from tasoka_historial_analitica\n WHERE id_animal ='\".$id_animal.\"' and fecha='\".$this->getConnection()->prepararFecha( $fecha).\"'\");\n if(is_array($res)&&$res[0]['informe']!=''){ \n $trozos = explode(\".\", $res[0]['nombre_fichero']); \n $extension =strtolower(end($trozos));\n if($extension===\"pdf\") \n header('Content-Type: application/pdf');\n elseif($extension===\"doc\" || $extension===\"docx\")\n header(\"Content-type: application/msword\");\n elseif($extension===\"odt\") \n header(\"Content-type: application/vnd.oasis.opendocument.text\");\n else {\n $this->showMessage('APL-11');\n $actionForward = new ActionForward('gvHidraValidationError');\n $actionForward->put('IGEPclaseManejadora','Tasoka_salud_analitica2D');\n break;\n }\n \n \n header('Content-Disposition: attachment; filename=\"'.$res[0]['nombre_fichero'].'\"');\n \n /*\n * header(\"Content-type: application/msword\");\nheader(\"Content-Disposition: inline; filename=word.doc\");\n\n */\n //print(pg_unescape_bytea($res[0]['doc_entrada']));\n\t\t\t\t\tprint($res[0]['informe']);\n ob_end_flush ();\n //Para que no continue la ejecuci\\F3n de la p\\E1gina\n die; \n } \n else {\n $this->showMessage('APL-44');\n $actionForward = new ActionForward('gvHidraValidationError');\n $actionForward->put('IGEPclaseManejadora','Tasoka_salud_analitica2D');\n \n } \n \n break;\n \n case 'borrarInformeAnalisis': \n // $objDatos->setOperation(\"actualizar\");\n if($objDatos->getValue('edi_nombre_fichero','actualizar')!='') {\n \n if(!empty($id_animal) && !empty($fecha)) {\n \n $sql=\"update tasoka_historial_analitica set informe=null , nombre_fichero=null where id_animal=$id_animal and fecha='\".$this->getConnection()->prepararFecha($fecha).\"' \";\n $error=$this->operar($sql);\n if($error==0) {\n $this->showMessage('APL-49',array('ENTRADA'));\n $actionForward = $objDatos->getForward('gvHidraSuccess');\n $this->refreshSearch(false);\n }\n else {\n $this->showMessage('APL-48',array('ENTRADA'));\n $actionForward = $objDatos->getForward('gvHidraError');\n }\n }\n //IgepDebug::setDebug(DEBUG_USER,\"El codigo es: <pre>\".print_r($objDatos->getValue('edi_doc_entrada_nombre'),true).\"</pre>\");\n //$objDatos->setValue('edi_asunto','');\n //die;\n } \n else {\n $this->showMessage('APL-52',array('ENTRADA'));\n $actionForward = new ActionForward('gvHidraValidationError');\n $actionForward->put('IGEPclaseManejadora','Tasoka_salud_analitica2D');\n }\n break;\n }\n \t\n }", "public function RegistreComision($fecha,$ValorComision, $TipoVenta,$comisionista,$idVenta,$Paga)\r\n{\r\n\r\n\t\t\t\t\t\r\n\t\t$tabla=\"comisionesporventas\";\r\n\t\t$NumRegistros=8;\r\n\t\r\n\t\t$this->NombresColumnas(\"colaboradores\");\r\n\t\t\r\n\t\t$DatosColaborador=$this->DevuelveValores($comisionista);\r\n\t\t\t\t\t\t\t\r\n\t\t$CuentaPUC=\"233520$comisionista\";\r\n\t\t$NombreCuenta=\"Comision por pagar del colaborador $DatosColaborador[Nombre] CC $DatosColaborador[Identificacion]\";\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$Columnas[0]=\"Fecha\";\t\t\t\t\t\t\t$Valores[0]=$fecha;\r\n\t\t$Columnas[1]=\"CuentaPUC\";\t\t\t\t\t\t$Valores[1]=$CuentaPUC;\r\n\t\t$Columnas[2]=\"NombreCuenta\";\t\t\t\t\t$Valores[2]=$NombreCuenta;\r\n\t\t$Columnas[3]=\"Valor\";\t\t\t\t\t\t\t$Valores[3]=$ValorComision;\r\n\t\t$Columnas[4]=\"TipoVenta\";\t\t\t\t\t\t$Valores[4]=$TipoVenta;\r\n\t\t$Columnas[5]=\"Colaboradores_idColaboradores\";\t$Valores[5]=$comisionista;\r\n\t\t$Columnas[6]=\"Ventas_NumVenta\";\t\t\t\t\t$Valores[6]=$idVenta;\r\n\t\t$Columnas[7]=\"Paga\";\t\t\t\t\t\t\t$Valores[7]=$Paga;\r\n\t\t\t\t\t\t\t\r\n\t\t$this->InsertarRegistro($tabla,$NumRegistros,$Columnas,$Valores);\r\n\r\n\r\n}", "function alta_salidas(){\n\t\t$varP=$_POST;\n\t\t$line=$this->uri->segment(4);\n\t\t$pr= new Salida();\n\t\t$pr->usuario_id=$GLOBALS['usuarioid'];\n\t\t$pr->empresas_id=$GLOBALS['empresaid'];\n\t\t$pr->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$pr->cl_facturas_id=$varP['cl_facturas_id'.$line];\n\t\t$pr->cproductos_id=$varP['producto'.$line];\n\t\t$pr->cantidad=$varP['unidades'.$line];\n\t\t$pr->costo_unitario=$varP['precio_u'.$line];\n\t\t$pr->tasa_impuesto=$varP['iva'.$line];\n\t\t//\t $pr->costo_total=($pr->cantidad * $pr->costo_unitario) * ((100+$pr->tasa_impuesto)/100);\n\t\t$pr->costo_total=$pr->cantidad * $pr->costo_unitario;\n\t\t$pr->ctipo_salida_id=1;\n\t\t$pr->estatus_general_id=2;\n\t\t$pr->cclientes_id=$this->cl_factura->get_cl_factura_salida($varP['cl_facturas_id'.$line]);\n\t\t$pr->fecha=date(\"Y-m-d H:i:s\");\n\t\tif(isset($varP['id'.$line])==true){\n\t\t\t$pr->id=$varP['id'.$line];\n\t\t}\n\t\tif($pr->save()) {\n\t\t\techo form_hidden('id'.$line, \"$pr->id\"); echo form_hidden('cl_facturas_id'.$line, \"$pr->cl_facturas_id\"); echo \"<img src=\\\"\".base_url().\"images/ok.png\\\" width=\\\"20px\\\" title=\\\"Guardado\\\"/>\";\n\t\t} else\n\t\t\tshow_error(\"\".$u->error->string);\n\n\t}", "function TablaServiciosFacturados()\n {\n //Logo\n $this->Image(\"./assets/img/logo.png\" , 20 ,12, 60 , 20 , \"PNG\");\n\t$this->SetXY(10, 15);\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(75,6,'',0,0,'');\n\t$this->Cell(120,6,'LISTADO DE SERVICIOS FACTURADOS POR FECHAS ',0,1,'C');\n \n\t$this->Cell(75,6,'',0,0,'');\n $this->Cell(120,6,' DESDE '.$_GET[\"desde\"].' HASTA '.$_GET[\"hasta\"],0,0,'C');\n //Salto de línea\n $this->Ln(15);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'CÉDULA GERENTE: ',0,0,'');\n\t$this->Cell(44,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->Cell(30,5,'NOMBRE GERENTE:',0,0,'');\n\t$this->Cell(83,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'TELÉFONO GERENTE: ',0,0,'');\n $this->Cell(44,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->Cell(30,5,'CORREO GERENTE:',0,0,'');\n $this->Cell(83,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(8,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(20,8,'CÓDIGO',1,0,'C', True);\n\t$this->CellFitSpace(90,8,'DESCRIPCIÓN DE SERVICIO',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'COSTO',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'FACTURADOS',1,0,'C', True);\n\t$this->CellFitSpace(26,8,'MONTO TOTAL',1,1,'C', True);\n\t\n $ve = new Login();\n\t$reg = $ve->BuscarServicios();\n\t$serviciosTotal=0;\n\t$pagoTotal=0;\n\t$a=1;\n\tfor($i=0;$i<sizeof($reg);$i++){\n\t$serviciosTotal+=$reg[$i]['cantidad']; \n\t$pagoTotal+=$reg[$i]['precioservicio']*$reg[$i]['cantidad'];\n\t$this->SetFont('courier','',7); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(8,5,$a++,1,0,'C');\n\t$this->CellFitSpace(20,5,$reg[$i][\"coditems\"],1,0,'C');\n $this->CellFitSpace(90,5,utf8_decode($reg[$i][\"nombreitems\"]),1,0,'C');\n\t$this->CellFitSpace(25,5,utf8_decode(number_format($reg[$i][\"precioservicio\"], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(25,5,utf8_decode($reg[$i][\"cantidad\"]),1,0,'C');\n\t$this->CellFitSpace(26,5,utf8_decode(number_format($reg[$i]['precioservicio']*$reg[$i]['cantidad'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(8,5,'',1,0,'C');\n $this->Cell(20,5,'',1,0,'C');\n $this->Cell(90,5,'',1,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(25,5,'TOTALES',1,0,'C', True);\n $this->SetFont('courier','B',7);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n $this->Cell(25,5,utf8_decode($serviciosTotal),1,0,'C'); \n $this->CellFitSpace(26,5,utf8_decode(number_format($pagoTotal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n\n \n $this->Ln(15); \n $this->SetFont('courier','B',9);\n $this->Cell(190,0,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]).' RECIBIDO POR:___________________________','',1,'C');\n $this->Ln(4);\n }", "public function mostrarDatosComprobantes(){\r\n\t\t$html = null;\t\t\r\n\r\n\t\t$month = date('m');\r\n \t$year = date('Y');\r\n \t$day = date(\"d\");\r\n\r\n\t\t$data['fechaEmision'] = date('Y-m-d');\r\n\r\n\t\t$fecemi = $data['fechaEmision'];\r\n\r\n\t\t$canales=$_POST['canalesDos'];\r\n\t\t$datos['canalesDos'] = $canales;\r\n\r\n\t\t$inicio = $_POST['fechainicioDos'];\r\n\t\t//$fin = $_POST['fechafinDos'];\r\n\r\n\t\t$serie = $_POST['numeroSerie'];\t\r\n\t\t//$data['nameCheck'] = $_POST['nameCheck'];\r\n\t\t//$idPlan = $data['nameCheck'];\r\n\r\n\r\n\t\tif (substr($serie, 0, 1) == 'B') {\r\n\r\n\t\t\t$boletaSumaSoles = $this->comprobante_pago_mdl->getDatosSumaEmiSoles($inicio, $canales, $serie);\r\n\t\t\t$boletaSumaSolesArray = json_decode(json_encode($boletaSumaSoles), true);\r\n\t\t\t$boletaSumaSolesstring = array_values($boletaSumaSolesArray)[0];\r\n\t\t\t$sumaS = $boletaSumaSolesstring['sumas'];\r\n\t\t\t$sumaDosS=number_format((float)$sumaS, 2, '.', ',');\r\n\r\n\t\t\t$boletaSumaDolares = $this->comprobante_pago_mdl->getDatosSumaEmiDolares($inicio, $canales, $serie);\r\n\t\t\t$boletaSumaDolaresArray = json_decode(json_encode($boletaSumaDolares), true);\r\n\t\t\t$boletaSumaDolaresstring = array_values($boletaSumaDolaresArray)[0];\r\n\t\t\t$sumaD = $boletaSumaDolaresstring['sumad'];\r\n\r\n\t\t\t$sumaDosd=number_format((float)$sumaD, 2, '.', ',');\r\n\r\n\t\t\t$html .=\"<H1><span class='label label-succes label-white middle'><b>Total de cobros Soles: S/. \".$sumaDosS.\"</b></span>&nbsp;<span class='label label-succes label-white middle'><b>Total de cobros Dólares: $ \".$sumaDosd.\"</b></span></H1>\";\r\n\r\n\t\t\t//html de tabla dinámica que se va a generar\r\n\t\t\t$html .= \"<br>\";\r\n\t\t\t$html .= \"<div align='center' class='col-xs-12'>\";\r\n\t\t\t\t$html .= \"<table align='center' id='tablaDatos' class='table table-striped table-bordered table-hover'>\";\r\n\t\t\t\t\t$html .= \"<thead>\";\r\n\t\t\t\t\t\t$html .=\"<tr>\";\r\n\t\t\t\t\t\t\t//$html .=\"<th>Id Comprobante</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Fecha de Emisión</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>N° de comprobante</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Nombres y Apellidos</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>DNI</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Plan</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Importe (S/.)</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Estado</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Opciones</th>\";\r\n\t\t\t\t\t\t$html .=\"</tr>\";\r\n\t\t\t\t\t$html .= \"</thead>\";\r\n\t\t\t\t\t$html .= \"<tbody>\";\r\n\r\n\t\t\t\t//\tfor ($i=0; $i < count($idPlan); $i++) {\r\n\r\n\t\t\t\t\t$boleta = $this->comprobante_pago_mdl->getDatosBoletaEmitida($inicio, $serie);\r\n\r\n\t\t\t\t\tforeach ((array) $boleta as $b):\r\n\r\n\t\t\t\t\t\t$importe = $b->importe_total;\r\n\t\t\t\t\t\t$importe2=number_format((float)$importe, 2, '.', ',');\r\n\r\n\t\t\t\t\t\t$estado = $b->idestadocobro;\r\n\t\t\t\t\t\t$newDate = date(\"d/m/Y\", strtotime($b->fecha_emision));\r\n\r\n\t\t\t\t\t\t$html .= \"<tr>\";\r\n\t\t\t\t\t\t\t//$html .= \"<td align='left'>\".$$b->idcomprobante.\"</td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$newDate.\"</td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->serie.\" - \".$b->correlativo.\"<input type='text' class='hidden' id='numSerie' name='numSerie[]' value='\".$b->serie.\"'></td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->contratante.\"<input type='text' class='hidden' id='idcomprobante' name='idcomprobante[]' value='\".$b->idcomprobante.\"'></td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->cont_numDoc.\"</td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".utf8_decode($b->nombre_plan).\"</td>\";\r\n\t\t\t\t\t\t\tif ($b->tipo_moneda == 'PEN') {\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center'>S/. \".$importe2.\"</td>\";\r\n\t\t\t\t\t\t\t} elseif ($b->tipo_moneda == 'USD') {\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center'>$ \".$importe2.\"</td>\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif ($estado == 2) {\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center' class='danger'>\".$b->descripcion.\"</td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"<ul class='ico-stack'>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='ver PDF' id='pdfButton' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/generarPdf/\".$b->idcomprobante.\"/\".$canales.\"' data-fancybox-width='950' data-fancybox-height='800' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-file-pdf-o bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='enviar PDF' id='pdfButtonEnviar' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/enviarPdf/\".$b->idcomprobante.\"/\".$canales.\"' data-fancybox-width='750' data-fancybox-height='275' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-envelope bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t$html .=\"</td>\";\r\n\t\t\t\t\t\t\t} elseif ($estado == 3) {\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center' class='success'>\".$b->descripcion.\"</td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"<ul class='ico-stack'>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='ver PDF' id='pdfButton' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/generarPdf/\".$b->idcomprobante.\"/\".$canales.\"' data-fancybox-width='950' data-fancybox-height='800' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-file-pdf-o bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='enviar PDF' id='pdfButtonEnviar' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/enviarPdf/\".$b->idcomprobante.\"/\".$canales.\"' data-fancybox-width='750' data-fancybox-height='275' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-envelope bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t$html .=\"</td>\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= \"</tr>\";\r\n\r\n\t\t\t\t\tendforeach;\r\n\r\n\t\t\t\t\t//}\r\n\t\t\t\t\r\n\t\t\t\t$html .= \"</tbody>\";\r\n\t\t\t$html .= \"</table>\";\r\n\t\t$html .= \"</div>\";\r\n\r\n\t\t} elseif (substr($serie, 0, 1) == 'F') {\r\n\r\n\r\n\t\t\t$boletaSumaSoles = $this->comprobante_pago_mdl->getDatosSumaEmiSoles($inicio, $canales, $serie);\r\n\t\t\t$boletaSumaSolesArray = json_decode(json_encode($boletaSumaSoles), true);\r\n\t\t\t$boletaSumaSolesstring = array_values($boletaSumaSolesArray)[0];\r\n\t\t\t$sumaS = $boletaSumaSolesstring['sumas'];\r\n\t\t\t$sumaDosS=number_format((float)$sumaS, 2, '.', ',');\r\n\r\n\t\t\t$boletaSumaDolares = $this->comprobante_pago_mdl->getDatosSumaEmiDolares($inicio, $canales, $serie);\r\n\t\t\t$boletaSumaDolaresArray = json_decode(json_encode($boletaSumaDolares), true);\r\n\t\t\t$boletaSumaDolaresstring = array_values($boletaSumaDolaresArray)[0];\r\n\t\t\t$sumaD = $boletaSumaDolaresstring['sumad'];\r\n\t\t\t$sumaDosd=number_format((float)$sumaD, 2, '.', ',');\r\n\r\n\t\t\t$html .=\"<H1><span class='label label-succes label-white middle'><b>Total de cobros Soles: S/. \".$sumaDosS.\"</b></span>&nbsp;<span class='label label-succes label-white middle'><b>Total de cobros Dólares: $ \".$sumaDosd.\"</b></span></H1>\";\r\n\r\n\r\n\t\t\t$html .=\"<hr>\";\r\n\t\t\t$html .= \"<div align='center' class='col-xs-12'>\";\r\n\t\t\t\t$html .= \"<table align='center' id='tablaDatos' class='table table-striped table-bordered table-hover'>\";\r\n\t\t\t\t\t$html .= \"<thead>\";\r\n\t\t\t\t\t\t$html .=\"<tr>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Fecha para emisión</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>N° de comprobante</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Razon Social</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>RUC</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Plan</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Importe (S/.)</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Estado</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Opciones</th>\";\r\n\t\t\t\t\t\t$html .=\"</tr>\";\r\n\t\t\t\t\t$html .= \"</thead>\";\r\n\t\t\t\t\t$html .= \"<tbody>\";\r\n\r\n\t\t\t\t\t//for ($i=0; $i < count($idPlan); $i++) {\r\n\r\n\t\t\t\t\t$factura = $this->comprobante_pago_mdl->getDatosFacturaEmitida($inicio, $serie);\r\n\r\n\t\t\t\t\tforeach ((array)$factura as $f):\r\n\r\n\t\t\t\t\t\t$importeDos = $f->importe_total;\r\n\t\t\t\t\t\t$importe2=number_format((float)$importeDos, 2, '.', ',');\r\n\t\t\t\t\t\t$estado = $f->idestadocobro;\r\n\t\t\t\t\t\t$newDate = date(\"d/m/Y\", strtotime($f->fecha_emision));\r\n\r\n\t\t\t\t\t\t\t$html .= \"<tr>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$newDate.\"</td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center'>\".$f->serie.\" - \".$f->correlativo.\"<input type='text' class='hidden' id='numSerie' name='numSerie' value='\".$f->serie.\"'></td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->razon_social_cli.\"<input type='text' class='hidden' id='idcomprobante' name='idcomprobante' value='\".$f->idcomprobante.\"'></td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->numero_documento_cli.\"</td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->nombre_plan.\"</td>\";\r\n\t\t\t\t\t\t\t\tif ($f->tipo_moneda == 'PEN') {\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='center'>S/. \".$importe2.\"</td>\";\r\n\t\t\t\t\t\t\t\t} elseif ($f->tipo_moneda == 'USD') {\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='center'>$ \".$importe2.\"</td>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif ($estado == 2) {\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='center' class='danger'>\".$f->descripcion.\"</td>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .= \"<ul class='ico-stack'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='ver PDF' id='pdfButton' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/generarPdf/\".$f->idcomprobante.\"/\".$canales.\"/F001' data-fancybox-width='950' data-fancybox-height='800' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-file-pdf-o bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='enviar PDF' id='pdfButtonEnviar' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/enviarPdf/\".$f->idcomprobante.\"/\".$canales.\"' data-fancybox-width='750' data-fancybox-height='275' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-envelope bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t\t$html .=\"</td>\";\r\n\t\t\t\t\t\t\t\t} elseif ($estado == 3) {\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='center' class='success'>\".$f->descripcion.\"</td>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .= \"<ul class='ico-stack'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='ver PDF' id='pdfButton' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/generarPdf/\".$f->idcomprobante.\"/\".$canales.\"/F001' data-fancybox-width='950' data-fancybox-height='800' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-file-pdf-o bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='enviar PDF' id='pdfButtonEnviar' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/enviarPdf/\".$f->idcomprobante.\"/\".$canales.\"' data-fancybox-width='750' data-fancybox-height='275' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-envelope bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t\t$html .=\"</td>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$html .= \"</tr>\";\r\n\r\n\t\t\t\t\tendforeach;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//}\r\n\r\n\t\t\t\t$html .= \"</tbody>\";\r\n\t\t\t$html .= \"</table>\";\r\n\t\t$html .= \"</div>\";\r\n\t\t}\r\n\r\n\t\techo json_encode($html);\r\n\t}", "static public function mdlCierreForzoso($tabla, $id_caja, $id_corte, $id_fecha){\t\n\ttry{ \n\t\t $item=\"fecha_salida\";\n\t\t $valor=$id_caja;\n\t\t $campo=\"id_caja\";\n\t\t $cerrado=0;\n \n\t\t $ventas=self::mdlSumaTotalVentas($tabla, $item, $valor, $cerrado, $id_fecha);\n\t\t $ventasgral=$ventas[\"sinpromo\"]>0?$ventas[\"sinpromo\"]:0;\n\t\t $ventaspromo=$ventas[\"promo\"]>0?$ventas[\"promo\"]:0;\n\n\t\t $vtaEnv = self::mdlSumTotVtasEnv($tabla, $item, $valor, $cerrado, $id_fecha);\n\t\t $ventasenvases=$vtaEnv[\"total\"]>0?$vtaEnv[\"total\"]:0;\n\n\t\t $vtaServ = self::mdlSumTotVtasServ($tabla, $item, $valor, $cerrado, $id_fecha);\n\t\t $ventasservicios=$vtaServ[\"total\"]>0?$vtaServ[\"total\"]:0;\n\n\t\t $ventasaba=self::mdlSumTotVtasOtros($tabla, $item, $valor, $cerrado, $id_fecha);\n\t\t $ventasgralaba=$ventasaba[\"sinpromo\"]>0?$ventasaba[\"sinpromo\"]:0;\n\t\t $ventaspromoaba=$ventasaba[\"promo\"]>0?$ventasaba[\"promo\"]:0;\n \n\t\t $vtaCred = self::mdlSumTotVtasCred($tabla, $item, $valor, $cerrado, $id_fecha);\n\t\t $ventascredito=$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]>0?$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]:0;\n\n\t\t $totingyegr=self::mdlTotalingresoegreso($campo, $valor,$cerrado, $id_fecha);\n\t\t $ingresodia=$totingyegr[\"monto_ingreso\"]>0?$totingyegr[\"monto_ingreso\"]:0;\n\t\t $egresodia=$totingyegr[\"monto_egreso\"]>0?$totingyegr[\"monto_egreso\"]:0;\n\n\t\t $totVentaDia=$ventasgral+$ventaspromo+$ventasenvases+$ventasservicios+$ventasgralaba+$ventaspromoaba+$ventascredito;\n \n\t\t\t //CERRAR REGISTRO Y COLOCAR EL ID DE CORTE DE VENTA EN EL HIST_SALIDAS\n\t\t\t $stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET cerrado=1, id_corte=$id_corte WHERE fecha_salida='\".$id_fecha.\"' AND id_caja=$id_caja AND cerrado=0\");\n\t\t\t if($stmt->execute()){\n\t\t\t \n\t\t\t\t //ACTUALIZAR TABLA CORTES CON LAS VENTAS, INGRESO Y EGRESOS\n\t\t\t\t $stmt2 = Conexion::conectar()->prepare(\"UPDATE cortes SET ventasgral=$ventasgral, ventaspromo=$ventaspromo, ventasenvases=$ventasenvases, ventasservicios=$ventasservicios, ventasabarrotes=($ventasgralaba+$ventaspromoaba), ventascredito=$ventascredito, monto_ingreso=$ingresodia, monto_egreso=$egresodia, total_venta=$totVentaDia, estatus=1 WHERE fecha_venta='\".$id_fecha.\"' AND id=$id_corte AND id_caja=$id_caja AND estatus=0\");\n\t\t\t\t \n\t\t\t\t //COLOCAR EL ID DE CORTE DE VENTA EN INGRESOS E EGRESOS\n\t\t\t\t if ($stmt2->execute()){\n\t\t\t\t\t $query = Conexion::conectar()->prepare(\"UPDATE ingresos SET id_corte=$id_corte WHERE fecha_ingreso='\".$id_fecha.\"' AND id_caja=$id_caja AND id_corte=0\");\n\t\t\t\t\t if($query->execute()){\n\t\t\t\t\t\t $query = Conexion::conectar()->prepare(\"UPDATE egresos SET id_corte=$id_corte WHERE fecha_egreso='\".$id_fecha.\"' AND id_caja=$id_caja AND id_corte=0\");\n\t\t\t\t\t\t $query->execute();\n\t\t\t\t\t }\n\t\t\t\t\t //UPDATE `hist_salidas` SET `cerrado`=0,`id_corte`=0 WHERE `fecha_salida`=2019-12-24\"\n\t\t\t\t\t //unset($_SESSION[\"abierta\"]);\n\t\t\t\t }\n\t\t\t\treturn true;\t \n\t\t\t }else{\n\t\t\t\t return false;\n\t\t\t }\n\t\t\t $query->close();\n\t\t\t $query = null;\n\t\t\t $stmt -> close();\n\t\t\t $stmt = null;\n\t\t\t $stmt2 -> close();\n\t\t\t $stmt2 = null;\n\t\t\t \n\t } catch (Exception $e) {\n\t\t echo \"Failed: \" . $e->getMessage();\n\t }\n \n }", "function tacta($curso){\n\t\t\t//require('C:/Program Files (x86)/VertrigoServ/www/ingenieria/library/fpdf/fpdf.php');\n\t\t\t\n\t\t\tif(Session::get_data('tipousuario')!=\"PROFESOR\"){\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\n\t\t\t//ELIMINAR CONTENIDO DE LAS VARIABLES QUE PERTENECERÁN A LA CLASE\n\t\t\tunset($this -> excel);\n\t\t\tunset($this -> alumnado);\n\t\t\tunset($this -> registro);\n\t\t\tunset($this -> nombre);\n\t\t\tunset($this -> curso);\n\t\t\tunset($this -> materia);\n\t\t\tunset($this -> clave);\n\t\t\tunset($this -> situacion);\n\t\t\tunset($this -> especialidad);\n\t\t\tunset($this -> profesor);\n\t\t\tunset($this -> periodo);\n\t\t\tunset($this -> nomina);\n\t\t\tunset($this -> parcial);\n\n\t\t\t$id = Session::get_data('registro');\n\t\t\t//$periodo = $this -> actual;\n\t\t\t$Periodos = new Periodos();\n\t\t\t$periodo = $Periodos -> get_periodo_actual_();\n\n\t\t\t//Tendrá que llegar por medio de un post\n\t\t\t$parcial = $this -> post(\"tparcial\");\n\n\t\t\t$maestros = new Maestros();\n\t\t\t$maestro = $maestros -> find_first(\"nomina=\".$id);\n\n\t\t\t$xcursos = new Xtcursos();\n\t\t\t$materias = new Materia();\n\t\t\t$calificaciones = new Xtalumnocursos();\n\t\t\t$alumnos = new Alumnos();\n\t\t\t$Carrera = new Carrera();\n\n\t\t\tswitch($parcial){\n\t\t\t\tcase 1: $parcialito = \"PRIMER PARCIAL\"; break;\n\t\t\t\tcase 2: $parcialito = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\tcase 3: $parcialito = \"TERCER PARCIAL\"; break;\n\t\t\t}\n\n\n\t\t\t$xcurso = $xcursos -> find_first(\"clavecurso='\".$curso.\"'\");\n\t\t\t$materia = $materias -> find_first(\"clave='\".$xcurso -> materia.\"'\");\n\n\t\t\t$this -> set_response(\"view\");\n\n\t\t\t$reporte = new FPDF();\n\n\t\t\t$reporte -> Open();\n\t\t\t$reporte -> AddPage();\n\n\t\t\t$reporte -> AddFont('Verdana','','verdana.php');\n\n\t\t\t$reporte -> Image('http://ase.ceti.mx/ingenieria/img/logoceti.jpg', 5, 0);\n\n\t\t\t$reporte -> SetX(45);\n\t\t\t$reporte -> SetFont('Verdana','',14);\n\t\t\t$reporte -> MultiCell(0,3,\"CENTRO DE ENSEÑANZA TÉCNICA INDUSTRIAL\",0,'C',0);\n\n\t\t\t$reporte -> Ln();\n\n\t\t\t$reporte -> SetX(45);\n\t\t\t$reporte -> SetFont('Verdana','',12);\n\t\t\t$reporte -> MultiCell(0,3,\"SUBDIRECCIÓN DE OPERACION ACADÉMICA\",0,'C',0);\n\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> Ln();\n\n\t\t\t$reporte -> SetX(45);\n\t\t\t$reporte -> SetFont('Verdana','',12);\n\t\t\t$reporte -> MultiCell(0,2,\"NIVEL INGENIERÍA\",0,'C',0);\n\t\t\t$reporte -> Ln();\n\n\t\t\t$reporte -> SetX(45);\n\t\t\t$reporte -> SetFont('Verdana','',8);\n\t\t\t$reporte -> MultiCell(0,2,\"PLANTEL TONALA\",0,'C',0);\n\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> Ln();\n\n\t\t\tif( substr( $periodo, 0, 1) == 1 )\n\t\t\t\t$periodo2 = \"FEB - JUN, \";\n\t\t\telse\n\t\t\t\t$periodo2 = \"AGO - DIC, \";\n\n\t\t\t$periodo2 .= substr($periodo,1,4);\n\n\t\t\t$reporte -> SetX(45);\n\t\t\t$reporte -> SetFont('Verdana','',8);\n\t\t\t$reporte -> MultiCell(0,2,\"REPORTE DE CALIFICACIONES PERIODO: \".$periodo2.\"\",0,'C',0);\n\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> Ln();\n\n\t\t\t$reporte -> SetFillColor(0xDD,0xDD,0xDD);\n\t\t\t$reporte -> SetTextColor(0);\n\t\t\t$reporte -> SetDrawColor(0xFF,0x66,0x33);\n\t\t\t$reporte -> SetFont('Verdana','',6);\n\n\t\t\t$reporte -> Cell(20,4,\"NOMINA\",1,0,'C',1);\n\t\t\t$reporte -> Cell(60,4,\"NOMBRE DEL PROFESOR\",1,0,'C',1);\n\t\t\t$reporte -> Cell(25,4,\"PLANTEL\",1,0,'C',1);\n\t\t\t$reporte -> Cell(25,4,\"CLAVE CURSO\",1,0,'C',1);\n\t\t\t$reporte -> Cell(60,4,\"MATERIA\",1,0,'C',1);\n\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> SetFillColor(0xFF,0xFF,0xFF);\n\t\t\t$reporte -> Cell(20,4,$id,1,0,'C',1);\n\t\t\t$reporte -> Cell(60,4,$maestro -> nombre,1,0,'C',1);\n\t\t\t$reporte -> Cell(25,4,\"TONALA\",1,0,'C',1);\n\t\t\t$reporte -> Cell(25,4,$curso,1,0,'C',1);\n\t\t\t$reporte -> Cell(60,4,$materia -> clave.\" - \".$materia -> nombre,1,0,'C',1);\n\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> Ln();\n\n\t\t\t$reporte -> SetFillColor(0xDD,0xDD,0xDD);\n\t\t\t$reporte -> SetTextColor(0);\n\t\t\t$reporte -> SetDrawColor(0xFF,0x66,0x33);\n\t\t\t$reporte -> SetFont('Verdana','',8);\n\n\t\t\t$reporte -> SetFillColor(0xFF,0xFF,0xFF);\n\t\t\t$reporte -> Cell(127,6,\"\",1,0,'C',1);\n\t\t\t$reporte -> SetFillColor(0xDD,0xDD,0xDD);\n\t\t\t$reporte -> Cell(69,6,$parcialito,1,0,'C',1);\n\n\t\t\t$reporte -> Ln();\n\n\t\t\t$reporte -> SetFont('Verdana','',6);\n\n\t\t\t$reporte -> Cell(8,4,\"No.\",1,0,'C',1);\n\t\t\t$reporte -> Cell(18,4,\"REGISTRO\",1,0,'C',1);\n\t\t\t$reporte -> Cell(55,4,\"NOMBRE DEL ALUMNO\",1,0,'C',1);\n\t\t\t$reporte -> Cell(31,4,\"CARRERA\",1,0,'C',1);\n\t\t\t$reporte -> Cell(15,4,\"SITUACION\",1,0,'C',1);\n\t\t\t$reporte -> Cell(30,4,\"FALTAS\",1,0,'C',1);\n\t\t\t$reporte -> Cell(39,4,\"CALIFICACION\",1,0,'C',1);\n\n\t\t\t$reporte -> Ln();\n\n\t\t\t$reporte -> SetFillColor(0xFF,0xFF,0xFF);\n\t\t\t$np = 0;\n\t\t\tforeach($calificaciones -> find(\"curso_id='\".$xcurso->id.\"' ORDER BY registro\") as $calificacion){\n\t\t\t\t\t$n++;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: if($calificacion -> calificacion1 >= 70 && $calificacion -> calificacion1 <= 100){ $aprobados++; } else { $reprobados++; } if( $calificacion -> calificacion1 >= 0 && $calificacion -> calificacion1 <= 100 ) { $promedio += $calificacion -> calificacion1; $np++;} break;\n\t\t\t\t\t\t\tcase 2: if($calificacion -> calificacion2 >= 70 && $calificacion -> calificacion2 <= 100){ $aprobados++; } else { $reprobados++; } if( $calificacion -> calificacion2 >= 0 && $calificacion -> calificacion2 <= 100 ) { $promedio += $calificacion -> calificacion2; $np++;} break;\n\t\t\t\t\t\t\tcase 3: if($calificacion -> calificacion3 >= 70 && $calificacion -> calificacion3 <= 100){ $aprobados++; } else { $reprobados++; } if( $calificacion -> calificacion3 >= 0 && $calificacion -> calificacion3 <= 100 ) { $promedio += $calificacion -> calificacion3; $np++;} break;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $faltas = $calificacion -> faltas1; break;\n\t\t\t\t\t\t\tcase 2: $faltas = $calificacion -> faltas2; break;\n\t\t\t\t\t\t\tcase 3: $faltas = $calificacion -> faltas3; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $cal = $calificacion -> calificacion1; break;\n\t\t\t\t\t\t\tcase 2: $cal = $calificacion -> calificacion2; break;\n\t\t\t\t\t\t\tcase 3: $cal = $calificacion -> calificacion3; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch($cal){\n\t\t\t\t\t\t\tcase 300: $cal=\"-\"; $faltas=\"-\"; break;\n\t\t\t\t\t\t\tcase 500: $cal=\"PND\"; break;\n\t\t\t\t\t\t\tcase 999: $cal=\"NP\"; $nps++; break;\n\t\t\t\t\t}\n\n\t\t\t\t\t$faltasletra = $this -> numero_letra($faltas);\n\t\t\t\t\t$calletra = $this -> numero_letra($cal);\n\n\t\t\t\t\tif($alumno = $alumnos -> find_first(\"miReg=\".$calificacion -> registro)){\n\t\t\t\t\t\t$carrera = $Carrera -> get_nombre_carrera_and_areadeformacion_($alumno);\n\t\t\t\t\t\t$reporte -> Cell(8,4,$n,1,0,'C',1);\n\t\t\t\t\t\t$reporte -> Cell(18,4,$calificacion -> registro,1,0,'C',1);\n\t\t\t\t\t\t$reporte -> Cell(55,4,$alumno -> vcNomAlu,1,0,'L',1);\n\t\t\t\t\t\t$reporte -> Cell(31,4, substr($carrera, 0, 26),1,0,'C',1);\n\t\t\t\t\t\t$reporte -> Cell(15,4,$alumno -> enTipo,1,0,'C',1);\n\t\t\t\t\t\t$reporte -> Cell(10,4,$faltas,1,0,'C',1);\n\t\t\t\t\t\t$reporte -> Cell(20,4,$faltasletra,1,0,'C',1);\n\t\t\t\t\t\t$reporte -> Cell(10,4,$cal,1,0,'C',1);\n\t\t\t\t\t\t$reporte -> Cell(29,4,$calletra,1,0,'C',1);\n\t\t\t\t\t\t$reporte -> Ln();\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t$promedio /= $np;\n\t\t\t$aprobados += 0;\n\t\t\t$reprobados += 0;\n\t\t\t$nps += 0;\n\n\t\t\t$reporte -> Ln();\n\n\t\t\t$reporte -> SetFont('Verdana','',7);\n\n\t\t\t$reporte -> SetFillColor(0xDD,0xDD,0xDD);\n\t\t\t$reporte -> Cell(25,5,\"HORAS CLASE\",1,0,'C',1);\n\t\t\t$reporte -> Cell(25,5,\"AVANCE\",1,0,'C',1);\n\t\t\t$reporte -> Cell(26,5,\"NUMERO DE NPs\",1,0,'C',1);\n\t\t\t$reporte -> Cell(38,5,\"ALUMNOS APROBADOS\",1,0,'C',1);\n\t\t\t$reporte -> Cell(38,5,\"ALUMNOS REPROBADOS\",1,0,'C',1);\n\t\t\t$reporte -> Cell(38,5,\"PROMEDIO DEL GRUPO\",1,0,'C',1);\n\n\t\t\t$reporte -> Ln();\n\n\t\t\t$avance = $xcursos -> find_first(\"id='\".$xcurso->id.\"'\");\n\n\t\t\t$reporte -> SetFillColor(0xFF,0xFF,0xFF);\n\t\t\tswitch($parcial){\n\t\t\t\tcase 1: $reporte -> Cell(25,5,$avance -> horas1,1,0,'C',1); $reporte -> Cell(25,5,$avance -> avance1.\"%\",1,0,'C',1);break;\n\t\t\t\tcase 2: $reporte -> Cell(25,5,$avance -> horas2,1,0,'C',1); $reporte -> Cell(25,5,$avance -> avance2.\"%\",1,0,'C',1);break;\n\t\t\t\tcase 3: $reporte -> Cell(25,5,$avance -> horas3,1,0,'C',1); $reporte -> Cell(25,5,$avance -> avance3.\"%\",1,0,'C',1);break;\n\t\t\t}\n\n\t\t\t$reporte -> Cell(26,5,$nps,1,0,'C',1);\n\t\t\t$reporte -> Cell(38,5,$aprobados,1,0,'C',1);\n\t\t\t$reporte -> Cell(38,5,$reprobados,1,0,'C',1);\n\n\t\t\t$promedio = round($promedio*100)/100;\t//REDONDEO A DOS DECIMALES\n\n\t\t\t$reporte -> Cell(38,5,$promedio,1,0,'C',1);\n\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> Ln();\n\n\t\t\t$reporte -> SetX(70);\n\t\t\t$reporte -> SetFillColor(0xDD,0xDD,0xDD);\n\t\t\t$reporte -> Cell(70,4,\"FIRMA DEL PROFESOR\",1,0,'C',1);\n\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> SetX(70);\n\t\t\t$reporte -> SetFillColor(0xFF,0xFF,0xFF);\n\t\t\t$reporte -> Cell(70,15,\"\",1,0,'C',1);\n\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> SetX(70);\n\t\t\t$reporte -> SetFillColor(0xDD,0xDD,0xDD);\n\t\t\t$reporte -> Cell(70,5,$maestro -> nombre,1,0,'C',1);\n\t\t\t\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> Ln();\n\t\t\t$reporte -> SetX(165);\n\t\t\t$reporte -> SetFont('Verdana','',8);\n\t\t\t$reporte -> MultiCell(0,2,\"FSGC-217-7.INS-005\",0,'C',0);\n\t\t\t\n\t\t\t// /datos/calculo/ingenieria/apps/default/controllers\n\t\t\t$reporte -> Output(\"public/files/reportes/\".$periodo.\"/\".$parcial.\"/\".$curso.\".pdf\");\n\n\t\t\t$this->redirect(\"public/files/reportes/\".$periodo.\"/\".$parcial.\"/\".$curso.\".pdf\");\n }", "public function fraccionar()\n {\n log_message('DEBUG',\"#TRAZA | #TRAZ-PROD-TRAZASOFT | Etapa | fraccionar()\");\n $this->load->model(ALM . 'Articulos');\n $this->load->model('general/Recipientes');\n\n $data['articulos'] = $this->Articulos->getList();\n\n $data['accion'] = 'Nuevo';\n $data['id'] = $this->input->get('op');\n $data['etapa'] = $this->Etapas->nuevo($data['id'])->etapa;\n $data['fecha'] = date('Y-m-d');\n $data['establecimientos'] = $this->Establecimientos->listarTodo()->establecimientos->establecimiento;\n $data['empaques'] = $this->Recipientes->listarEmpaques()->empaques->empaque;\n $data['articulos_fraccionar'] = $this->Etapas->getEntradaEtapa($data['id'])['data'];\n $data['articulos_fracc_salida'] = $this->Etapas->getSalidaEtapa($data['id'])['data'];\n\n $this->load->view('etapa/fraccionar/fraccionar', $data);\n }", "function alta_cl_factura(){\n\t\t$u= new Cl_factura();\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresaid'];\n\t\t$u->fecha_captura=date(\"Y-m-d H:i:s\");\n\t\t$u->estatus_general_id=1;\n\t\t$related = $u->from_array($_POST);\n\t\tif($u->save($related)) {\n\t\t\t$pr=new Cl_pedido();\n\t\t\t$pr->get_by_id($u->cl_pedido_id);\n\t\t\t$pr->ccl_estatus_pedido_id=3;\n\t\t\t$pr->save();\n\n\n\t\t\t$this->db->query(\"update salidas set cclientes_id=$u->cclientes_id, fecha='$u->fecha' where cl_facturas_id=$u->id\");\n\t\t\techo form_hidden('id', \"$u->id\"); echo '<p></p><button type=\"submit\" id=\"boton1\" style=\"display:none;\">Paso 2. Registrar Factura</button>';\n\t\t} else {\n\t\t\techo form_hidden('id', \"0\"); echo '<p></p><button type=\"submit\" id=\"boton1\" style=\"display:none;\">Paso 2. Registrar Factura</button><h3>El pedido de venta número:'. $u->cl_pedido_id. ', previamente se le ha dado salida, se cancela la salida</h3>';\n\t\t}\n\t}", "public function componente_operaciones($com_id){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente = $this->model_componente->get_componente_pi($com_id); //// DATOS COMPONENTE\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']); /// DATOS FASE\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $mes = $this->mes_nombre();\n \n $tabla='';\n \n if($proyecto[0]['tp_id']==1){ /// Proyectos de Inversion\n $tabla.='<table cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" border=0.2 style=\"width:100%;\" align=center>\n <thead>\n <tr style=\"font-size: 7px;\" bgcolor=#1c7368 align=center>\n <th style=\"width:1%;height:15px;color:#FFF;\">#</th>\n <th style=\"width:2%;color:#FFF;\">COD.<br>ACE.</th>\n <th style=\"width:2%;color:#FFF;\">COD.<br>ACP.</th>\n <th style=\"width:2%;color:#FFF;\">COD.<br>OPE.</th>\n <th style=\"width:2%; color:#FFF;\">COD.<br>ACT.</th> \n <th style=\"width:11%; color:#FFF;\">ACTIVIDAD</th>\n <th style=\"width:11%; color:#FFF;\">RESULTADO</th>\n <th style=\"width:11%; color:#FFF;\">INDICADOR</th>\n <th style=\"width:2%; color:#FFF;\">LB.</th>\n <th style=\"width:2.5%; color:#FFF;\">META</th>\n <th style=\"width:2.5%; color:#FFF;\">ENE.</th>\n <th style=\"width:2.5%; color:#FFF;\">FEB.</th>\n <th style=\"width:2.5%; color:#FFF;\">MAR.</th>\n <th style=\"width:2.5%; color:#FFF;\">ABR.</th>\n <th style=\"width:2.5%; color:#FFF;\">MAY.</th>\n <th style=\"width:2.5%; color:#FFF;\">JUN.</th>\n <th style=\"width:2.5%; color:#FFF;\">JUL.</th>\n <th style=\"width:2.5%; color:#FFF;\">AGO.</th>\n <th style=\"width:2.5%; color:#FFF;\">SEPT.</th>\n <th style=\"width:2.5%; color:#FFF;\">OCT.</th>\n <th style=\"width:2.5%; color:#FFF;\">NOV.</th>\n <th style=\"width:2.5%; color:#FFF;\">DIC.</th>\n <th style=\"width:8.5%; color:#FFF;\">VERIFICACI&Oacute;N</th> \n <th style=\"width:5%; color:#FFF;\">PPTO.</th> \n </tr>\n </thead>\n <tbody>';\n $operaciones=$this->model_producto->list_operaciones_pi($com_id); /// 2020\n $nro=0;\n foreach($operaciones as $rowp){\n $nro++;\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $tp='';\n if($rowp['indi_id']==2){\n $tp='%';\n }\n\n $color_or='';\n if($rowp['or_id']==0){\n $color_or='#fbd5d5';\n }\n\n $ptto=number_format(0, 2, '.', ',');\n if(count($monto)!=0){\n $ptto=\"<b>\".number_format($monto[0]['total'], 2, ',', '.').\"</b>\";\n }\n\n\n $tabla.='\n <tr>\n <td style=\"height:12px;\">'.$nro.'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor='.$color_or.' >'.$rowp['acc_codigo'].'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor='.$color_or.' >'.$rowp['og_codigo'].'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor='.$color_or.' >'.$rowp['or_codigo'].'</td>\n <td style=\"width: 2%; text-align: center; font-size: 8px;\" bgcolor=\"#eceaea\"><b>'.$rowp['prod_cod'].'</b></td>\n <td style=\"width: 11%; text-align: left;\">'.$rowp['prod_producto'].'</td>\n <td style=\"width: 11%; text-align: left;\">'.$rowp['prod_resultado'].'</td>\n <td style=\"width:11%; text-align: left;\">'.$rowp['prod_indicador'].'</td>\n <td style=\"width:2%; text-align: center;\">'.round($rowp['prod_linea_base'],2).'</td>\n <td style=\"width:2.5%; text-align: center;\" bgcolor=\"#eceaea\">'.round($rowp['prod_meta'],2).'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['enero'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['febrero'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['marzo'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['abril'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['mayo'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['junio'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['julio'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['agosto'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['septiembre'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['octubre'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['noviembre'],2).''.$tp.'</td>\n <td style=\"width:2.5%;\" align=center>'.round($rowp['diciembre'],2).''.$tp.'</td>\n <td style=\"width:8.5%; text-align: left;\">'.$rowp['prod_fuente_verificacion'].'</td>\n <td style=\"width: 5%; text-align: right;\">'.$ptto.'</td>\n </tr>'; \n }\n $tabla.='\n </tbody>\n </table>';\n\n }\n else{ //// Gasto Corriente\n\n $tabla.='<table cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" border=0.2 style=\"width:100%;\" align=center>\n <thead>\n <tr style=\"font-size: 7px;\" bgcolor=#1c7368 align=center>\n <th style=\"width:1%;height:15px;color:#FFF;\">#</th>\n <th style=\"width:2%;color:#FFF;\">COD.<br>ACE.</th>\n <th style=\"width:2%;color:#FFF;\">COD.<br>ACP.</th>\n <th style=\"width:2%;color:#FFF;\">COD.<br>OPE.</th>\n <th style=\"width:2%;color:#FFF;\">COD.<br>ACT.</th> \n <th style=\"width:10%;color:#FFF;\">ACTIVIDAD</th>\n <th style=\"width:9.5%;color:#FFF;\">RESULTADO</th>\n <th style=\"width:7%;color:#FFF;\">UNIDAD RESPONSABLE</th>\n <th style=\"width:9%;color:#FFF;\">INDICADOR</th>\n <th style=\"width:2%;color:#FFF;\">LB.</th>\n <th style=\"width:3%;color:#FFF;\">META</th>\n <th style=\"width:3%;color:#FFF;\">ENE.</th>\n <th style=\"width:3%;color:#FFF;\">FEB.</th>\n <th style=\"width:3%;color:#FFF;\">MAR.</th>\n <th style=\"width:3%;color:#FFF;\">ABR.</th>\n <th style=\"width:3%;color:#FFF;\">MAY.</th>\n <th style=\"width:3%;color:#FFF;\">JUN.</th>\n <th style=\"width:3%;color:#FFF;\">JUL.</th>\n <th style=\"width:3%;color:#FFF;\">AGO.</th>\n <th style=\"width:3%;color:#FFF;\">SEPT.</th>\n <th style=\"width:3%;color:#FFF;\">OCT.</th>\n <th style=\"width:3%;color:#FFF;\">NOV.</th>\n <th style=\"width:3%;color:#FFF;\">DIC.</th>\n <th style=\"width:9%;color:#FFF;\">VERIFICACI&Oacute;N</th> \n <th style=\"width:5%;color:#FFF;\">PPTO.</th> \n </tr> \n \n </thead>\n <tbody>';\n $nro=0;\n $operaciones=$this->model_producto->list_operaciones($com_id);\n \n foreach($operaciones as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $programado=$this->model_producto->producto_programado($rowp['prod_id'],$this->gestion);\n $color=''; $tp='';\n if($rowp['indi_id']==1){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n elseif ($rowp['indi_id']==2) {\n $tp='%';\n if($rowp['mt_id']==3){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n }\n\n $ptto=number_format(0, 2, '.', ',');\n if(count($monto)!=0){\n $ptto=\"<b>\".number_format($monto[0]['total'], 2, ',', '.').\"</b>\";\n }\n\n $color_or='';\n if($rowp['or_id']==0){\n $color_or='#fbd5d5';\n }\n\n $nro++;\n $tabla.=\n '<tr style=\"font-size: 6.5px;\" bgcolor=\"'.$color.'\">\n <td style=\"height:12px;\" bgcolor='.$color_or.'>'.$nro.'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor='.$color_or.' >'.$rowp['acc_codigo'].'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor='.$color_or.' >'.$rowp['og_codigo'].'</td>\n <td style=\"width: 2%; text-align: center;\" bgcolor='.$color_or.' >'.$rowp['or_codigo'].'</td>\n <td style=\"width: 2%; text-align: center; font-size: 8px;\" bgcolor=\"#eceaea\"><b>'.$rowp['prod_cod'].'</b></td>\n <td style=\"width: 10%; text-align: left;font-size: 7px;\">'.$rowp['prod_producto'].'</td>\n <td style=\"width: 9.5%; text-align: left;\">'.$rowp['prod_resultado'].'</td>\n <td style=\"width: 7%; text-align: left;\">'.strtoupper($rowp['prod_unidades']).'</td>\n <td style=\"width: 9%; text-align: left;\">'.$rowp['prod_indicador'].'</td>\n <td style=\"width: 2%; text-align: center;\">'.round($rowp['prod_linea_base'],2).'</td>\n <td style=\"width: 3%; text-align: center;\" bgcolor=\"#eceaea\">'.round($rowp['prod_meta'],2).'</td>';\n\n if(count($programado)!=0){\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['enero'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['febrero'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['marzo'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['abril'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['mayo'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['junio'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['julio'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['agosto'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['septiembre'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['octubre'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['noviembre'],2).''.$tp.'</td>';\n $tabla.='<td style=\"width:3%;\" bgcolor=\"#e5fde5\" align=center>'.round($programado[0]['diciembre'],2).''.$tp.'</td>';\n }\n else{\n for ($i=1; $i <=12 ; $i++) { \n $tabla.='<td bgcolor=\"#f5cace\" align=center>0.00</td>';\n }\n }\n\n $tabla.='\n <td style=\"width: 9%; text-align: left;\">'.$rowp['prod_fuente_verificacion'].'</td>\n <td style=\"width: 5%; text-align: right;\">'.$ptto.'</td>\n </tr>';\n\n }\n $tabla.='\n </tbody>\n </table>';\n }\n return $tabla;\n }", "function tcapturando($curso){\n\t\t\tif(Session::get_data('tipousuario')!=\"PROFESOR\"){\n\t\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t\t//ELIMINAR CONTENIDO DE LAS VARIABLES QUE PERTENECERÁN A LA CLASE\n\t\t\tunset($this -> excel);\n\t\t\tunset($this -> alumnado);\n\t\t\tunset($this -> registro);\n\t\t\tunset($this -> nombre);\n\t\t\tunset($this -> curso);\n\t\t\tunset($this -> materia);\n\t\t\tunset($this -> clave);\n\t\t\tunset($this -> situacion);\n\t\t\tunset($this -> especialidad);\n\t\t\tunset($this -> profesor);\n\t\t\tunset($this -> periodo);\n\t\t\tunset($this -> nomina);\n\t\t\tunset($this -> parcial);\n\t\t\tunset($this -> idcapturaesp);\n\n\t\t\t$maestros = new Maestros();\n\t\t\t$id = Session::get_data('registro');\n\t\t\t$this -> nomina = $id;\n\t\t\t$profesor = $maestros -> find_first(\"nomina=\".$this -> nomina.\"\");\n\t\t\t$this -> profesor = $profesor -> nombre;\n\n\t\t\t$periodo = $this -> actual;\n\n\t\t\t$xcursos = new Xtcursos();\n\t\t\t$pertenece = $xcursos -> count(\"clavecurso='\".$curso.\"' AND nomina=\".$id.\" AND periodo='\".$periodo.\"'\");\n\n\t\t\tif($pertenece<1){\n\t\t\t\t$log = new Xtlogcalificacion();\n\t\t\t\t$log -> clavecurso = $curso;\n\t\t\t\t$log -> nomina = Session::get_data('registro');\n\t\t\t\t$log -> accion = \"INTENTANDO MODIFICAR UNA CALIFICACION QUE NO LE CORRESPONDE\";\n\t\t\t\t$log -> ip = $this -> getIP();;\n\t\t\t\t$log -> fecha = time();\n\t\t\t\t$log -> save();\n\n\t\t\t\t$this->redirect('profesor/captura');\n\t\t\t}\n\n\n\t\t\t$Xccursos = new Xtcursos();\n\t\t\t$maestros = new Maestros();\n\t\t\t$materias = new Materia();\n\t\t\t$xtalumnocursos = new Xtalumnocursos();\n\t\t\t$alumnos = new Alumnos();\n\t\t\t$especialidades = new Especialidades();\n\n\n\t\t\t$xccursos = $Xccursos -> find_first(\"clavecurso='\".$curso.\"'\");\n\t\t\tif( $this -> post(\"tparcial\") == \"\" ){\n\t\t\t\t$this->redirect('profesor/captura');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tswitch($this -> post(\"tparcial\")){\n\t\t\t\t\tcase 1: $this -> horas = $xccursos -> horas1; break;\n\t\t\t\t\tcase 2: $this -> horas = $xccursos -> horas2; break;\n\t\t\t\t\tcase 3: $this -> horas = $xccursos -> horas3; break;\n\t\t\t}\n\n\t\t\t$this -> horas1 = $xccursos -> horas1;\n\t\t\t$this -> horas2 = $xccursos -> horas2;\n\t\t\t$this -> horas3 = $xccursos -> horas3;\n\n\t\t\tif($this -> horas==0){\n\t\t\t\t\t$this -> horas = \"\";\n\t\t\t}\n\n\t\t\tif($this -> horas1==0){\n\t\t\t\t\t$this -> horas1 = \"-\";\n\t\t\t}\n\n\t\t\tif($this -> horas2==0){\n\t\t\t\t\t$this -> horas2 = \"-\";\n\t\t\t}\n\n\t\t\tif($this -> horas3==0){\n\t\t\t\t\t$this -> horas3 = \"-\";\n\t\t\t}\n\t\t\t\n\t\t\tswitch($this -> post(\"tparcial\")){\n\t\t\t\t\tcase 1: $this -> avance = $xccursos -> avance1; break;\n\t\t\t\t\tcase 2: $this -> avance = $xccursos -> avance2; break;\n\t\t\t\t\tcase 3: $this -> avance = $xccursos -> avance3; break;\n\t\t\t}\n\n\t\t\t$this -> avance1 = $xccursos -> avance1;\n\t\t\t$this -> avance2 = $xccursos -> avance2;\n\t\t\t$this -> avance3 = $xccursos -> avance3;\n\n\t\t\tif($this -> avance==0){\n\t\t\t\t\t$this -> avance = \"\";\n\t\t\t}\n\n\t\t\tif($this -> avance1==0){\n\t\t\t\t\t$this -> avance1 = \"-\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t$this -> avance1 .= \"%\";\n\t\t\t}\n\n\t\t\tif($this -> avance2==0){\n\t\t\t\t\t$this -> avance2 = \"-\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t$this -> avance2 .= \"%\";\n\t\t\t}\n\n\t\t\tif($this -> avance3==0){\n\t\t\t\t\t$this -> avance3 = \"-\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t$this -> avance3 .= \"%\";\n\t\t\t}\n\t\t\t$total = 0;\n\n\t\t\t$xpermcapturaesp\t= new Xpermisoscapturaesp();\n\t\t\t$xpermcapturaespdet\t= new XpermisoscapturaespDetalle();\n\t\t\t\n\t\t\t$day = date (\"d\");\n\t\t\t$month = date (\"m\");\n\t\t\t$year = date (\"Y\");\n\t\t\t$hour = date (\"H\");\n\t\t\t$minute = date (\"i\");\n\t\t\t$second = date (\"s\");\n\t\t\t\n\t\t\t$fecha = mktime( $hour, $minute, $second, $month, $day, $year );\n\t\t\t\n\t\t\t$aux = 0;\n\t\t\t$aux5 = 0;\n\t\t\tforeach( $xpermcapturaesp -> find_all_by_sql\n\t\t\t\t\t( \"select * from xpermisoscapturaesp\n\t\t\t\t\t\twhere clavecurso = '\".$curso.\"'\n\t\t\t\t\t\tand parcial = \".$this -> post(\"tparcial\").\"\n\t\t\t\t\t\tand fin > \".$fecha.\"\n\t\t\t\t\t\tand captura = 0\n\t\t\t\t\t\torder by id desc\n\t\t\t\t\t\tlimit 1\" ) as $xpcapesp ){\n\t\t\t\t$aux5 = 1;\n\t\t\t\t// Para checar los permisosdecapturasespeciales\n\t\t\t\tif( $xpermcapturaespdet -> find_first\n\t\t\t\t\t\t( \"xpermisoscapturaesp_id = \".$xpcapesp -> id ) ){\n\t\t\t\t\t$aux ++;\n\t\t\t\t}\n\t\t\t\t$this -> idcapturaesp = $xpcapesp -> id;\n\t\t\t\tif( $aux == 1 ){\n\t\t\t\t\tforeach( $xpermcapturaespdet -> find\n\t\t\t\t\t\t\t( \"xpermisoscapturaesp_id = \".$xpcapesp -> id ) as $xpdetalle ){\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($xtalumnocursos -> find\n\t\t\t\t\t\t\t\t(\"curso_id='\".$xccursos->id.\"' \n\t\t\t\t\t\t\t\tand registro = \".$xpdetalle -> registro.\"\n\t\t\t\t\t\t\t\tORDER BY registro\") as $alumno){\n\t\t\t\t\t\t\t$this -> registro = $alumno -> registro;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"id\"] = $alumno -> id;\n\t\t\t\t\t\t\t$this -> curso = $curso;\n\t\t\t\t\t\t\t$this -> materia = $this -> post(\"tmateria\");\n\t\t\t\t\t\t\t$this -> clave = $this -> post(\"tclave\");\n\n\t\t\t\t\t\t\t$parcial = $this -> post(\"tparcial\");\n\t\t\t\t\t\t\t$this -> parcialito = $parcial;\n\n\t\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\t\tcase 1: $this -> parcial = \"PRIMER PARCIAL\"; break;\n\t\t\t\t\t\t\t\tcase 2: $this -> parcial = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\t\t\t\t\tcase 3: $this -> parcial = \"TERCER PARCIAL\"; break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach($alumnos -> find(\"miReg=\".$alumno->registro) as $a){\n\t\t\t\t\t\t\t\t$this -> nombre = $a -> vcNomAlu;\n\t\t\t\t\t\t\t\t$this -> nombre = iconv(\"latin1\", \"ISO-8859-1\", $this -> nombre);\n\t\t\t\t\t\t\t\t$situacion = $a -> enTipo;\n\t\t\t\t\t\t\t\t$especialidad = $a -> idtiEsp;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch($situacion){\n\t\t\t\t\t\t\t\tcase 'R': $this -> situacion = \"REGULAR\"; break;\n\t\t\t\t\t\t\t\tcase 'I': $this -> situacion = \"IRREGULAR\"; break;\n\t\t\t\t\t\t\t\tcase 'P': $this -> situacion = \"PROCESO DE REGULARIZACION\"; break;\n\t\t\t\t\t\t\t\tcase 'C': $this -> situacion = \"CONDICIONADO\"; break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach($especialidades -> find(\"idtiEsp=\".$especialidad) as $e){\n\t\t\t\t\t\t\t\t$this -> especialidad = $e -> siNumEsp;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"registro\"] = $this -> registro;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"nombre\"] = $this -> nombre;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"especialidad\"] = $this -> especialidad;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"situacion\"] = $this -> situacion;\n\n\t\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas1;break;\n\t\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas2;break;\n\t\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas3;break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"] = $alumno -> faltas1;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"] = $alumno -> faltas2;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"] = $alumno -> faltas3;\n\n\t\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion1;break;\n\t\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion2;break;\n\t\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion3;break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"] = $alumno -> calificacion1;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"] = $alumno -> calificacion2;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"] = $alumno -> calificacion3;\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas\"]=\"\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"-\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"]=\"-\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"-\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"]=\"-\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"-\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"]=\"-\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$total++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tforeach($xtalumnocursos -> find(\"curso_id='\".$xccursos->id.\"' ORDER BY registro\") as $alumno){\n\t\t\t\t\t\t$this -> registro = $alumno -> registro;\n\t\t\t\t\t\t$this -> alumnado[$total][\"id\"] = $alumno -> id;\n\t\t\t\t\t\t$this -> curso = $curso;\n\t\t\t\t\t\t$this -> materia = $this -> post(\"tmateria\");\n\t\t\t\t\t\t$this -> clave = $this -> post(\"tclave\");\n\n\t\t\t\t\t\t$parcial = $this -> post(\"tparcial\");\n\t\t\t\t\t\t$this -> parcialito = $parcial;\n\n\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> parcial = \"PRIMER PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 2: $this -> parcial = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 3: $this -> parcial = \"TERCER PARCIAL\"; break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach($alumnos -> find(\"miReg=\".$alumno->registro) as $a){\n\t\t\t\t\t\t\t$this -> nombre = $a -> vcNomAlu;\n\t\t\t\t\t\t\t$this -> nombre = iconv(\"latin1\", \"ISO-8859-1\", $this -> nombre);\n\t\t\t\t\t\t\t$situacion = $a -> enTipo;\n\t\t\t\t\t\t\t$especialidad = $a -> idtiEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tswitch($situacion){\n\t\t\t\t\t\t\tcase 'R': $this -> situacion = \"REGULAR\"; break;\n\t\t\t\t\t\t\tcase 'I': $this -> situacion = \"IRREGULAR\"; break;\n\t\t\t\t\t\t\tcase 'P': $this -> situacion = \"PROCESO DE REGULARIZACION\"; break;\n\t\t\t\t\t\t\tcase 'C': $this -> situacion = \"CONDICIONADO\"; break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach($especialidades -> find(\"idtiEsp=\".$especialidad) as $e){\n\t\t\t\t\t\t\t$this -> especialidad = $e -> siNumEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this -> alumnado[$total][\"registro\"] = $this -> registro;\n\t\t\t\t\t\t$this -> alumnado[$total][\"nombre\"] = $this -> nombre;\n\t\t\t\t\t\t$this -> alumnado[$total][\"especialidad\"] = $this -> especialidad;\n\t\t\t\t\t\t$this -> alumnado[$total][\"situacion\"] = $this -> situacion;\n\n\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas3;break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"] = $alumno -> faltas1;\n\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"] = $alumno -> faltas2;\n\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"] = $alumno -> faltas3;\n\n\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion3;break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"] = $alumno -> calificacion1;\n\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"] = $alumno -> calificacion2;\n\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"] = $alumno -> calificacion3;\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas\"]=\"\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"-\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"]=\"-\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"-\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"]=\"-\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"-\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"]=\"-\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"PD\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"PD\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"PD\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"PD\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$total++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( $aux5 == 0 ){\n foreach($xtalumnocursos -> find(\"curso_id='\".$xccursos->id.\"' ORDER BY registro\") as $alumno){\n\t\t\t\t\t$this -> registro = $alumno -> registro;\n\t\t\t\t\t$this -> alumnado[$total][\"id\"] = $alumno -> id;\n\t\t\t\t\t$this -> curso = $curso;\n\t\t\t\t\t$this -> materia = $this -> post(\"tmateria\");\n\t\t\t\t\t$this -> clave = $this -> post(\"tclave\");\n\n\t\t\t\t\t$parcial = $this -> post(\"tparcial\");\n\t\t\t\t\t$this -> parcialito = $parcial;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> parcial = \"PRIMER PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 2: $this -> parcial = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 3: $this -> parcial = \"TERCER PARCIAL\"; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($alumnos -> find(\"miReg=\".$alumno->registro) as $a){\n\t\t\t\t\t\t\t$this -> nombre = $a -> vcNomAlu;\n\t\t\t\t\t\t\t$this -> nombre = iconv(\"latin1\", \"ISO-8859-1\", $this -> nombre);\n\t\t\t\t\t\t\t$situacion = $a -> enTipo;\n\t\t\t\t\t\t\t$especialidad = $a -> idtiEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch($situacion){\n\t\t\t\t\t\t\tcase 'R': $this -> situacion = \"REGULAR\"; break;\n\t\t\t\t\t\t\tcase 'I': $this -> situacion = \"IRREGULAR\"; break;\n\t\t\t\t\t\t\tcase 'P': $this -> situacion = \"PROCESO DE REGULARIZACION\"; break;\n\t\t\t\t\t\t\tcase 'C': $this -> situacion = \"CONDICIONADO\"; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($especialidades -> find(\"idtiEsp=\".$especialidad) as $e){\n\t\t\t\t\t\t\t$this -> especialidad = $e -> siNumEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this -> alumnado[$total][\"registro\"] = $this -> registro;\n\t\t\t\t\t$this -> alumnado[$total][\"nombre\"] = $this -> nombre;\n\t\t\t\t\t$this -> alumnado[$total][\"especialidad\"] = $this -> especialidad;\n\t\t\t\t\t$this -> alumnado[$total][\"situacion\"] = $this -> situacion;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas3;break;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"] = $alumno -> faltas1;\n\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"] = $alumno -> faltas2;\n\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"] = $alumno -> faltas3;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion3;break;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"] = $alumno -> calificacion1;\n\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"] = $alumno -> calificacion2;\n\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"] = $alumno -> calificacion3;\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas\"]=\"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"-\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"]=\"-\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"-\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"]=\"-\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"-\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"]=\"-\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"PD\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"PD\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"PD\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"PD\";\n\t\t\t\t\t}\n\t\t\t\t\t$total++;\n }\n\t\t\t}\n }", "public function mostrarDatosComprobantesDeclarados(){\r\n\t\t$html = null;\t\t\r\n\r\n\t\t$month = date('m');\r\n \t$year = date('Y');\r\n \t$day = date(\"d\");\r\n\r\n\t\t$fecemi = date('Y-m-d');\r\n\r\n\t\t$canales=$_POST['canalesDeclarado'];\r\n\r\n\t\t$inicio = $_POST['fechainicioDeclarado'];\r\n\t\t$fin = $_POST['fechafinDeclarado'];\r\n\r\n\t\t$serie = $_POST['numeroSerieDeclarado'];\t\r\n\r\n\t\tif (substr($serie, 0, 1) == 'B') {\r\n\t\t\t//html de tabla dinámica que se va a generar\r\n\r\n\t\t\t$boletaSumaSoles = $this->comprobante_pago_mdl->getDatosSumaDecSoles($inicio, $fin, $canales, $serie);\r\n\t\t\t$boletaSumaSolesArray = json_decode(json_encode($boletaSumaSoles), true);\r\n\t\t\t$boletaSumaSolesstring = array_values($boletaSumaSolesArray)[0];\r\n\t\t\t$sumaS = $boletaSumaSolesstring['sumas'];\r\n\t\t\t$sumaDosS=number_format((float)$sumaS, 2, '.', ',');\r\n\r\n\t\t\t$boletaSumaDolares = $this->comprobante_pago_mdl->getDatosSumaDecDolares($inicio, $fin, $canales, $serie);\r\n\t\t\t$boletaSumaDolaresArray = json_decode(json_encode($boletaSumaDolares), true);\r\n\t\t\t$boletaSumaDolaresstring = array_values($boletaSumaDolaresArray)[0];\r\n\t\t\t$sumaD = $boletaSumaDolaresstring['sumad'];\r\n\r\n\t\t\t$sumaDosd=number_format((float)$sumaD, 2, '.', ',');\r\n\r\n\t\t\t$html .=\"<H1><span class='label label-succes label-white middle'><b>Total de cobros Soles: S/. \".$sumaDosS.\"</b></span>&nbsp;<span class='label label-succes label-white middle'><b>Total de cobros Dólares: $ \".$sumaDosd.\"</b></span></H1>\";\r\n\r\n\t\t\t//html de tabla dinámica que se va a generar\r\n\t\t\t$html .= \"<br>\";\r\n\t\t\t$html .= \"<div align='center' class='col-xs-12'>\";\r\n\t\t\t\t$html .= \"<table align='center' id='tablaDatos' class='table table-striped table-bordered table-hover'>\";\r\n\t\t\t\t\t$html .= \"<thead>\";\r\n\t\t\t\t\t\t$html .=\"<tr>\";\r\n\t\t\t\t\t\t\t//$html .=\"<th>Id Comprobante</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Fecha de Emisión</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>N° de comprobante</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Nombres y Apellidos</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>DNI</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Plan</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Importe (S/.)</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Estado</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Opciones</th>\";\r\n\t\t\t\t\t\t$html .=\"</tr>\";\r\n\t\t\t\t\t$html .= \"</thead>\";\r\n\t\t\t\t\t$html .= \"<tbody>\";\r\n\r\n\t\t\t\t//\tfor ($i=0; $i < count($idPlan); $i++) {\r\n\r\n\t\t\t\t\t$boleta = $this->comprobante_pago_mdl->getDatosBoletaDeclarada($inicio, $fin, $serie);\r\n\r\n\t\t\t\t\tforeach ((array) $boleta as $b):\r\n\r\n\t\t\t\t\t\tif ($b->tipo_moneda=='PEN') {\r\n\t\t\t\t\t\t\t$moneda = 'S/. ';\r\n\t\t\t\t\t\t} elseif ($b->tipo_moneda=='USD') {\r\n\t\t\t\t\t\t\t$moneda = '$ ';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$importe = $b->importe_total;\r\n\t\t\t\t\t\t$importe2=number_format((float)$importe, 2, '.', ',');\r\n\r\n\t\t\t\t\t\t$estado = $b->idestadocobro;\r\n\t\t\t\t\t\t$newDate = date(\"d/m/Y\", strtotime($b->fecha_emision));\r\n\r\n\t\t\t\t\t\t$html .= \"<tr>\";\r\n\t\t\t\t\t\t\t//$html .= \"<td align='left'>\".$$b->idcomprobante.\"</td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$newDate.\"</td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->serie.\" - \".$b->correlativo.\"<input type='text' class='hidden' id='numSerie' name='numSerie[]' value='\".$b->serie.\"'></td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->contratante.\"<input type='text' class='hidden' id='idcomprobante' name='idcomprobante[]' value='\".$b->idcomprobante.\"'></td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->cont_numDoc.\"</td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='left'>\".utf8_decode($b->nombre_plan).\"</td>\";\r\n\t\t\t\t\t\t\t$html .= \"<td align='center'>\".$moneda.$importe2.\"</td>\";\r\n\t\t\t\t\t\t\tif ($estado == 2) {\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center' class='danger'>\".$b->descripcion.\"</td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'></td>\";\r\n\t\t\t\t\t\t\t} elseif ($estado == 3) {\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center' class='success'>\".$b->descripcion.\"</td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"<ul class='ico-stack'>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='ver PDF' id='pdfButton' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/generarPdf/\".$b->idcomprobante.\"/\".$canales.\"' data-fancybox-width='950' data-fancybox-height='800' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-file-pdf-o bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='enviar PDF' id='pdfButtonEnviar' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/enviarPdf/\".$b->idcomprobante.\"/\".$canales.\"' data-fancybox-width='750' data-fancybox-height='275' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-envelope bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t$html .=\"</td>\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= \"</tr>\";\r\n\r\n\t\t\t\t\tendforeach;\r\n\r\n\t\t\t\t\t//}\r\n\t\t\t\t\r\n\t\t\t\t\t$html .= \"</tbody>\";\r\n\t\t\t\t$html .= \"</table>\";\r\n\t\t\t$html .= \"</div>\";\r\n\t\t} elseif (substr($serie, 0, 1) == 'F') {\r\n\r\n\t\t\t$boletaSumaSoles = $this->comprobante_pago_mdl->getDatosSumaDecSoles($inicio, $fin, $canales, $serie);\r\n\t\t\t$boletaSumaSolesArray = json_decode(json_encode($boletaSumaSoles), true);\r\n\t\t\t$boletaSumaSolesstring = array_values($boletaSumaSolesArray)[0];\r\n\t\t\t$sumaS = $boletaSumaSolesstring['sumas'];\r\n\t\t\t$sumaDosS=number_format((float)$sumaS, 2, '.', ',');\r\n\r\n\t\t\t$boletaSumaDolares = $this->comprobante_pago_mdl->getDatosSumaDecDolares($inicio, $fin, $canales, $serie);\r\n\t\t\t$boletaSumaDolaresArray = json_decode(json_encode($boletaSumaDolares), true);\r\n\t\t\t$boletaSumaDolaresstring = array_values($boletaSumaDolaresArray)[0];\r\n\t\t\t$sumaD = $boletaSumaDolaresstring['sumad'];\r\n\r\n\t\t\t$sumaDosd=number_format((float)$sumaD, 2, '.', ',');\r\n\r\n\t\t\t$html .=\"<H1><span class='label label-succes label-white middle'><b>Total de cobros Soles: S/. \".$sumaDosS.\"</b></span>&nbsp;<span class='label label-succes label-white middle'><b>Total de cobros Dólares: $ \".$sumaDosd.\"</b></span></H1>\";\r\n\r\n\t\t\t$html .=\"<hr>\";\r\n\t\t\t$html .= \"<div align='center' class='col-xs-12'>\";\r\n\t\t\t\t$html .= \"<table align='center' id='tablaDatos' class='table table-striped table-bordered table-hover'>\";\r\n\t\t\t\t\t$html .= \"<thead>\";\r\n\t\t\t\t\t\t$html .=\"<tr>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Fecha para emisión</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>N° de comprobante</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Razon Social</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>RUC</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Plan</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Importe (S/.)</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Estado</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Opciones</th>\";\r\n\t\t\t\t\t\t$html .=\"</tr>\";\r\n\t\t\t\t\t$html .= \"</thead>\";\r\n\t\t\t\t\t$html .= \"<tbody>\";\r\n\r\n\t\t\t\t\t//for ($i=0; $i < count($idPlan); $i++) {\r\n\r\n\t\t\t\t\t$factura = $this->comprobante_pago_mdl->getDatosFacturaDeclarada($inicio, $fin, $serie);\r\n\r\n\t\t\t\t\tforeach ((array)$factura as $f):\r\n\r\n\t\t\t\t\t\tif ($f->tipo_moneda=='PEN') {\r\n\t\t\t\t\t\t\t$moneda = 'S/. ';\r\n\t\t\t\t\t\t} elseif ($f->tipo_moneda=='USD') {\r\n\t\t\t\t\t\t\t$moneda = '$ ';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$importeDos = $f->importe_total;\r\n\t\t\t\t\t\t$importe2=number_format((float)$importeDos, 2, '.', ',');\r\n\t\t\t\t\t\t$estado = $f->idestadocobro;\r\n\t\t\t\t\t\t$newDate = date(\"d/m/Y\", strtotime($f->fecha_emision));\r\n\r\n\t\t\t\t\t\t\t$html .= \"<tr>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$newDate.\"</td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center'>\".$f->serie.\" - \".$f->correlativo.\"<input type='text' class='hidden' id='numSerie' name='numSerie' value='\".$f->serie.\"'></td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->razon_social_cli.\"<input type='text' class='hidden' id='idcomprobante' name='idcomprobante' value='\".$f->idcomprobante.\"'></td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->numero_documento_cli.\"</td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->nombre_plan.\"</td>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center'>\".$moneda.$importe2.\"</td>\";\r\n\t\t\t\t\t\t\t\tif ($estado == 2) {\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='center' class='danger'>\".$f->descripcion.\"</td>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'></td>\";\r\n\t\t\t\t\t\t\t\t} elseif ($estado == 3) {\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='center' class='success'>\".$f->descripcion.\"</td>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .= \"<ul class='ico-stack'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='ver PDF' id='pdfButton' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/generarPdf/\".$f->idcomprobante.\"/\".$canales.\"' data-fancybox-width='950' data-fancybox-height='800' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-file-pdf-o bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"<div title='enviar PDF' id='pdfButtonEnviar' onclick=''>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"<a class='boton fancybox' href='\".base_url().\"index.php/ventas_cnt/enviarPdf/\".$f->idcomprobante.\"/\".$canales.\"' data-fancybox-width='750' data-fancybox-height='275' target='_blank'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$html .= \"<i class='ace-icon fa fa-envelope bigger-120'></i>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t$html .=\"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$html .=\"</div>\";\r\n\t\t\t\t\t\t\t\t\t\t$html .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t\t$html .=\"</td>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$html .= \"</tr>\";\r\n\r\n\t\t\t\t\tendforeach;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//}\r\n\r\n\t\t\t\t\t$html .= \"</tbody>\";\r\n\t\t\t\t$html .= \"</table>\";\r\n\t\t\t$html .= \"</div>\";\r\n\t\t}\r\n\r\n\t\techo json_encode($html);\r\n\t}", "function fechas_entregas($id_licitacion){\r\n global $bgcolor3,$html_root;\r\n\r\n $sql=\" select * from (\r\n select id_subir,nro_orden,vence_oc from\r\n subido_lic_oc where id_licitacion=$id_licitacion and tipo_muestras=0\r\n ) as sl\r\n left join\r\n (\r\n select sum(cantidad*precio) as total,id_subir from renglones_oc\r\n group by id_subir\r\n ) as total\r\n using (id_subir)\r\n order by vence_oc ASC\r\n \";\r\n $res=sql($sql) or fin_pagina();\r\n\r\n $sql=\"select simbolo from licitacion join moneda using(id_moneda)\r\n where id_licitacion=$id_licitacion\";\r\n $moneda=sql($sql) or fin_pagina();\r\n\r\n if ($res->recordcount()>0) {\r\n //es que hay ordenes\r\n\r\n ?>\r\n <table width=100% align=center border=1 cellpading=0 cellspacing=0 bordercolor='<?=$bgcolor3?>'>\r\n <tr>\r\n <td colspan=4 align=Center><b>Ordenes de Compra</b></td>\r\n </tr>\r\n <tr>\r\n <td width=40% align=center><b>Orden de Compra</b></td>\r\n <td align=center><b>Fecha de Entrega</b></td>\r\n <td>&nbsp;</td>\r\n <td align=center><b>Montos</b></td>\r\n </tr>\r\n <?\r\n for($i=1;$i<=$res->recordcount();$i++){\r\n $id_subir=$res->fields[\"id_subir\"];\r\n $link=encode_link(\"../../lib/archivo_orden_de_compra.php\",array(\"id_subir\"=>$id_subir,\"solo_lectura\"=>1));\r\n $fechas_entregas=fechas_entregas_oc($id_subir);\r\n ?>\r\n <tr>\r\n <a href=<?=$link?> target=\"_blank\">\r\n <td align=left >\r\n <font color='blue'>\r\n <?=$res->fields[\"nro_orden\"]?>\r\n </font>\r\n </td>\r\n <td align=center><?=fechas_entregas_oc($id_subir)?></td>\r\n <td align=center><?=$moneda->fields[\"simbolo\"]?></td>\r\n <td align=right><?=formato_money($res->fields[\"total\"])?></td>\r\n </a>\r\n\r\n </tr>\r\n <?\r\n $cont++;\r\n $res->movenext();\r\n\r\n } // del for\r\n ?>\r\n </table>\r\n <?\r\n}\r\n\r\n}", "function procesar_carga ($datos){\n \n if(strcmp($datos['tipo'], \"Definitiva\")==0){\n $this->s__dia=$datos['dia_semana'];\n \n //if($this->validar_datos($datos['hora_inicio'], $datos['hora_fin'])){\n //if($this->existe_definitiva($datos)){\n $secuencia= recuperar_secuencia('asignacion_id_asignacion_seq');\n $this->registrar_asignacion($datos);\n $this->registrar_asignacion_definitiva($datos);\n //agregamos el equipo de catedra si existe\n if(count($this->s__docentes_seleccionados)>0){\n foreach($this->s__docentes_seleccionados as $clave=>$docente){\n $catedra=array(\n 'id_asignacion' => $secuencia,\n 'nro_doc' => $docente['nro_doc'],\n 'tipo_doc' => $docente['tipo_doc']\n );\n \n $this->dep('datos')->tabla('catedra')->nueva_fila($catedra);\n $this->dep('datos')->tabla('catedra')->sincronizar();\n $this->dep('datos')->tabla('catedra')->resetear();\n }\n }\n //}\n// else{\n// $mensaje=\" Está intentando solapar asignaciones \";\n// //$mensaje=\"Error Horario Repetido {$this->s__error}\";\n// toba::notificacion()->agregar(utf8_d_seguro($mensaje));\n// }\n// }\n// else{\n// $mensaje=\" La hora de inicio debe ser menor a la hora de fin \";\n// toba::notificacion()->agregar($mensaje);\n// }\n }\n else{\n if($this->validar_datos($datos['hora_inicio'], $datos['hora_fin'], $datos['fecha_inicio'], $datos['fecha_fin'])){\n if($this->existe_periodo($datos)){\n $this->registrar_asignacion($datos);\n $this->registrar_asignacion_periodo($datos);\n }\n else{\n $mensaje=\" Está intentando solapar asignaciones \";\n toba::notificacion()->agregar(utf8_decode($mensaje), $nivel);\n }\n }\n else{\n $mensaje=\" Datos inconsistentes en la fecha u hora \";\n toba::notificacion()->agregar($mensaje, $nivel);\n }\n }\n }", "function trabajo(){\nglobal $fechac;\nglobal $fechaf;\nglobal $data;\nglobal $plano;\n if(isset($_POST['fechai']))\n $fecha=$_POST['fechai'];\n if(isset($_SESSION['fechai']))\n $fecha=$_SESSION['fechai'];\n $dia=substr($fecha,0,2);\n $mes=substr($fecha,3,2);\n $ano=substr($fecha,6,4);\n $fechac=$ano.\"-\".$mes.\"-\".$dia;\n\n if(isset($_POST['fechat']))\n $fecha=$_POST['fechat'];\n if(isset($_SESSION['fechat']))\n $fecha=$_SESSION['fechat'];\n $dia=substr($fecha,0,2);\n $mes=substr($fecha,3,2);\n $ano=substr($fecha,6,4);\n $fechaf=$ano.\"-\".$mes.\"-\".$dia;\n\n//echo \"trabajo fechac:\".$fechac.\"<br>\";\n//echo \"trabajo fechaf:\".$fechaf.\"<br>\";\n\n/*\nif (!isset($_SESSION['fechai']))\n $_SESSION['fechai']=$_POST['fechai'];\nif (!isset($_SESSION['fechat']))\n $_SESSION['fechat']=$_POST['fechat'];\n\n$fecha=$_POST['fechai'];\n$dia=substr($fecha,0,2);\n$mes=substr($fecha,3,2);\n$ano=substr($fecha,6,4);\n$fechai=$ano.\"-\".$mes.\"-\".$dia;\n$fecha=$_POST['fechat'];\n$dia=substr($fecha,0,2);\n$mes=substr($fecha,3,2);\n$ano=substr($fecha,6,4);\n$fechat=$ano.\"-\".$mes.\"-\".$dia;\n*/\n$query_rsh = \"select sum(pbm1+pb1_9+pb10_14+pb15_64+pb65ym+pbotras +\n pom1+po1_9+po10_14+po15_64+po65ym+pootras) as pediatria,\n sum(hbm1+hb1_9+hb10_14+hb15_64+hb65ym+hbotras +\n hom1+ho1_9+ho10_14+ho15_64+ho65ym+hootras +\n mbm1+mb1_9+mb10_14+mb15_64+mb65ym+mbotras +\n mom1+mo1_9+mo10_14+mo15_64+mo65ym+mootras ) as medicina,\n sum(utitm1+utit1_9+utit10_14+utit15_64+utit65ym+utitotras +\n utibm1+utib1_9+utib10_14+utib15_64+utib65ym+utibotras +\n ucibm1+ucib1_9+ucib10_14+ucib15_64+ucib65ym+ucibotras +\n ucitm1+ucit1_9+ucit10_14+ucit15_64+ucit65ym+ucitotras ) as upc\n FROM hospitaliza\n where id_estab=\".$_SESSION['id_estab'].\n \" and fecha between '\".$fechac.\"' and '\".$fechaf.\"'\";\n\n$query_rsf = \"select sum(falli0a14 + falle0a14 + falleh0a14) as f0a14,\n sum(falli15a64 + falle15a64 + falleh15a64) as f15a64,\n sum(falli65a74 + falle65a74 + falleh65a74) as f65a74,\n sum(falli75ym + falle75ym + falleh75ym) as f75ym,\n\t\t\t\t\t sum(falli0a14ira + falle0a14ira + falleh0a14ira) as f0a14ira,\n sum(falli15a64ira + falle15a64ira + falleh15a64ira) as f15a64ira,\n sum(falli65a74ira + falle65a74ira + falleh65a74ira) as f65a74ira,\n sum(falli75ymira + falle75ymira + falleh75ymira) as f75ymira,\n\t\t\t\t\t sum(ifi0a14) as ifi0a14,\n\t\t\t\t\t sum(ifi15a64) as ifi15a64,\n\t\t\t\t\t sum(ifi65a74) as ifi65a74,\n\t\t\t\t\t sum(ifi75ym) as ifi75ym\n FROM fallecidoh\n where id_estab=\".$_SESSION['id_estab'].\n \" and fecha between '\".$fechac.\"' and '\".$fechaf.\"'\";\n\n$query_rs = \"SELECT \n sum(bronq_m1+ bronq_1a9 + bronq_10a14 + bronq_15a64 + bronq_65ym + \n asma_m1 + asma_1a9 + asma_10a14 + asma_15a64 + asma_65ym + \n neumo_m1 + neumo_1a9 + neumo_10a14 + neumo_15a64+ neumo_65ym + \n influ_m1 + influ_1a9 + influ_10a14 + influ_15a64+ influ_65ym + \n larin_m1 + larin_1a9 + larin_10a14 + larin_15a64+ larin_65ym + \n\t\t\tiraltas_m1 + iraltas_1a9 + iraltas_10a14 + iraltas_15a64+ iraltas_65ym + \n resto_m1 + resto_1a9 + resto_10a14 + resto_15a64 + resto_65ym +\n totsinm1 + totsin1a9 + totsin10a14 + totsin15a64 + totsin65ym +\n totm1 + tot1a9 + tot10a14 + tot15a64 + tot65ym) as toturg,\n\n sum(totm1 + tot1a9 + tot10a14 + tot15a64 + tot65ym) as totmed,\n\n sum(bronq_m1+ bronq_1a9 + bronq_10a14 + bronq_15a64 + bronq_65ym) as totsbo,\n\n sum(neumo_m1 + neumo_1a9 + neumo_10a14 + neumo_15a64+ neumo_65ym) as totneumo, \n\n sum(bronq_m1 + asma_m1 + neumo_m1 + influ_m1 + larin_m1 + iraltas_m1 + resto_m1) as iram1,\n\n sum(bronq_65ym + asma_65ym + neumo_65ym + influ_65ym + larin_65ym + iraltas_65ym + resto_65ym) as ira65ym,\n\n sum(bronq_m1+ bronq_1a9 + bronq_10a14 + bronq_15a64 + bronq_65ym + \n asma_m1 + asma_1a9 + asma_10a14 + asma_15a64 + asma_65ym + \n neumo_m1 + neumo_1a9 + neumo_10a14 + neumo_15a64+ neumo_65ym + \n influ_m1 + influ_1a9 + influ_10a14 + influ_15a64+ influ_65ym + \n larin_m1 + larin_1a9 + larin_10a14 + larin_15a64+ larin_65ym + \n\t\t\t iraltas_m1 + iraltas_1a9 + iraltas_10a14 + iraltas_15a64+ iraltas_65ym + \n resto_m1 + resto_1a9 + resto_10a14 + resto_15a64 + resto_65ym) as totira \n\n FROM aturg_urbana\n where id_estab=\".$_SESSION['id_estab'].\n \" and fecha between '\".$fechac.\"' and '\".$fechaf.\"'\";\n$rs = safe_query($query_rs);\n$row_rs = mysql_fetch_assoc($rs);\n$totalRows_rs = mysql_num_rows($rs);\n$toturg=$row_rs['toturg'];\n$totira=$row_rs['totira'];\n$totmed=$row_rs['totmed'];\n$totsbo=$row_rs['totsbo'];\n$totneumo=$row_rs['totneumo'];\n$iram1=$row_rs['iram1'];\n$ira65ym=$row_rs['ira65ym'];\n\n$rsf = safe_query($query_rsf);\n$row_rsf = mysql_fetch_assoc($rsf);\n$totalRows_rsf = mysql_num_rows($rsf);\n$f0a14=$row_rsf['f0a14'];\n$f15a64=$row_rsf['f15a64'];\n$f65a74=$row_rsf['f65a74'];\n$f75ym=$row_rsf['f75ym'];\n$f0a14ira=$row_rsf['f0a14ira'];\n$f15a64ira=$row_rsf['f15a64ira'];\n$f65a74ira=$row_rsf['f65a74ira'];\n$f75ymira=$row_rsf['f75ymira'];\n$ifi0a14=$row_rsf['ifi0a14'];\n$ifi15a64=$row_rsf['ifi15a64'];\n$ifi65a74=$row_rsf['ifi65a74'];\n$ifi75ym=$row_rsf['ifi75ym'];\n\n$rsh = safe_query($query_rsh);\n$row_rsh = mysql_fetch_assoc($rsh);\n$totalRows_rsh = mysql_num_rows($rsh);\n$pediatria=$row_rsh['pediatria'];\n$medicina=$row_rsh['medicina'];\n$upc=$row_rsh['upc'];\n\nif ($toturg>0){\n $ind1=($totira/$toturg)*100;\n $val1=number_format($ind1,2,\",\",\".\"); }\nelse\n $val1=\"-\";\n\nif ($totmed>0){\n $ind2=($totira/($totmed + $totira))*100;\n $val2=number_format($ind2,2,\",\",\".\"); }\nelse\n $val2=\"-\";\n\nif ($totira>0){\n $ind3=($totsbo/$totira)*100;\n $val3=number_format($ind3,2,\",\",\".\"); }\nelse\n $val3=\"-\";\n\nif ($totneumo>0){\n $ind4=($totneumo/$totira)*100;\n $val4=number_format($ind4,2,\",\",\".\"); }\nelse\n $val4=\"-\";\n\nif ($totira>0){\n $ind5=($iram1/$totira)*100;\n $val5=number_format($ind5,2,\",\",\".\"); }\nelse\n $val5=\"-\";\n\nif ($totira>0){\n $ind6=($ira65ym/$totira)*100;\n $val6=number_format($ind6,2,\",\",\".\"); }\nelse\n $val6=\"-\";\n\n// crea archivo para enviar por correo\n$fileExcel=$_SESSION['nombre'].\".htm\";\n$fileExcel=str_replace(\" \",\"_\",$fileExcel);\n$fp=fopen($fileExcel,\"w\");\n\n$imp= <<<EOQ\n<table width=\"600\" border=\"0\" align=\"center\">\n <caption>\n <font color=\"#0000CC\" size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><strong>\n Gestión IRA<br>\nEOQ;\necho $imp;\n$data=$imp;\n\n$plano=\"Establecimiento: \".$_SESSION['nombre'].\"\\n\";\n$plano.=\"Semana: \".$_SESSION['fechai'].\" al \".$_SESSION['fechat'].\"\\n\";\n\n$imp= \"<br><font size=\\\"1\\\">Establecimiento:</font> <i>\".$_SESSION['nombre'].\"</i> \"\n .\"&nbsp;&nbsp;Fecha: &nbsp;<font size=\\\"1\\\">\".$_SESSION['fechai'].\"&nbsp;&nbsp; al &nbsp;&nbsp;\" .$_SESSION['fechat'].\"</font>\";\necho $imp;\n$data.=$imp;\n\n$plano.=\"Indicador \\t \\t \\t \\t \\t \\t \\t \\t \\tValor \\t Composición\\n\";\n$plano.=\"% consultas IRA / total consultas urgencia \\t\\t\\t $val1% \\t ($totira / $toturg )\\n\";\n$plano.=\"% consultas IRA / total consultas médicas \\t \\t\\t $val2% \\t (($totira /( $totmed + $totira))\\n\";\n$plano.=\"% consultas Sind.Bron.Obs. / total consultas respirat.\\t $val3% \\t ($totsbo / $totira)\\n\";\n$plano.=\"% consultas neumonía / total consultas respiratorias \\t\\t $val4% \\t ($totneumo / $totira)\\n\";\n$plano.=\"Consultas respiratorias por grupo etario:\\n\";\n$plano.=\"\\t\\t\\t\\t\\t\\t\\t < 1 año: \\t\\t $val5% \\t ( $iram1 / $totira )\\n\";\n$plano.=\"\\t\\t\\t\\t\\t\\t\\t > 65 años: \\t $val6% \\t ( $ira65ym / $totira )\\n\";\n\n$imp= <<<EOQ\n </strong></font> \n </caption>\n <tr bgcolor=\"#DDDDDD\"> \n <td width=\"320\"><font color=\"#0000CC\" size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><strong>\n Indicador</strong></font></td>\n <td width=\"80\"> \n <div align=\"right\"><font color=\"#0000CC\" size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><strong>\n Valor</strong></font></div></td>\n <td width=\"100\">\n <div align=\"right\"><font color=\"#0000CC\" size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><strong>\n Composición\n </strong></font></div>\n <td> \n </tr>\n <tr> \n <td><strong><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">% \n consultas IRA / total consultas urgencia</font></strong></td>\n <td><div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong>$val1</strong>%</font></font></font></div>\n </td>\n <td>\n <div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong> ($totira / $toturg) </strong></font></font></font></div>\n </td>\n </tr>\n <tr> \n <td><strong><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">% \n consultas IRA / total consultas m&eacute;dicas</font></strong></td>\n <td><div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong>$val2</strong>%</font></font></font></div></td>\n <td>\n <div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong> ($totira /( $totmed + $totira) ) </strong>\n </font></font></font></div>\n </td>\n\n </tr>\n <tr> \n <td><strong><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">% \n consultas Sind.Bron.Obs. / total consultas respirat.</font></strong></td>\n <td><div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong>$val3</strong>%</font></font></font></div></td>\n <td>\n <div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong>($totsbo / $totira)</strong>\n </font></font></font></div>\n </td>\n\n </tr>\n <tr> \n <td><strong><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">% \n consultas neumon&iacute;a / total consultas respiratorias</font></strong></td>\n <td><div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong>$val4</strong>%</font></font></font></div></td>\n <td>\n <div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong> ($totneumo / $totira)</strong> </font></font></font></div>\n </td>\n\n </tr>\n <tr> \n <td><strong><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">% \n Consultas respiratorias por grupo etario:</font></strong></td>\n <td><div align=\"right\"></div></td>\n <td>&nbsp;</td>\n </tr>\n <tr> \n <td><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">&lt; \n 1 a&ntilde;o:</font></div></td>\n <td><div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$val5</strong>%</font></font></font></div></td>\n <td>\n <div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong>( $iram1 / $totira )</strong> </font></font></font></div>\n </td>\n\n </tr>\n <tr> \n <td><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">&gt; \n 65 a&ntilde;os:</font></div></td>\n <td><div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$val6</strong>%</font></font></font></div></td>\n <td>\n <div align=\"right\"><font color=\"#0000CC\"><font size=\"1\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"> \n <strong>( $ira65ym / $totira )</strong></font></font></font></div>\n </td>\n\n </tr>\nEOQ;\necho $imp;\n$data.=$imp;\n\n if(strcmp($_SESSION['tipo'],'sapu')!=0){\n\n$plano.=\"Hospitalizaciones:\\n\";\n$plano.=\"\\t\\t\\t\\t\\t\\t Pediatría:\\t\\t\\t $pediatria \\n\";\n$plano.=\"\\t\\t\\t\\t\\t\\t Medicina:\\t\\t\\t $medicina \\n\";\n$plano.=\"\\t\\t\\t\\t\\t\\t U.P.C.:\\t\\t\\t $upc \\n\";\n\n$imp= <<<EOQ\n <tr> \n <td><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>Hospitalizaciones</strong></font></td>\n <td><div align=\"right\"><font color=\"#0000CC\"><font size=\"2\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"></font></font></font></div></td>\n </tr>\n <tr> \n <td><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">Pediatría:\n </font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$pediatria</strong></font></td>\n </tr>\n <tr> \n <td><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">Medicina:\n </font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$medicina</strong></font></td>\n </tr>\n <tr> \n <td><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">U.P.C.:\n </font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$upc</strong></font></td>\n </tr>\nEOQ;\necho $imp;\n$data.=$imp;\n\n}\n$plano.=\"Fallecidos según edad:\\n\";\n$plano.=\"\\t\\t\\t\\t\\t\\t 0-14 años: \\t\\t $f0a14 \\n\";\n$plano.=\"\\t\\t\\t\\t\\t\\t 15-64 años: \\t\\t $f15a64 \\n\";\n$plano.=\"\\t\\t\\t\\t\\t\\t 65-74 años: \\t\\t $f65a74 \\n\";\n$plano.=\"\\t\\t\\t\\t\\t\\t 75 y más años: \\t\\t $f75ym \\n\";\n\n$imp= <<<EOQ\n <tr> \n <td><strong><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">Fallecidos \n seg&uacute;n edad X IRA:</font></strong></td>\n <td><div align=\"right\"></div></td>\n </tr>\n <tr> \n <td><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">0-14 años:\n </font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$f0a14ira</strong></font></td>\n </tr>\n <tr> \n <td height=\"26\"><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n 15-64años:</font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$f15a64ira</strong></font></td>\n </tr>\n <tr> \n <td height=\"26\"><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n 65-74 años:</font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$f65a74ira</strong></font></td>\n </tr>\n <tr> \n <td height=\"26\"><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n 75 años y más:</font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$f75ymira</strong></font></td>\n </tr>\n <tr> \n <td><strong><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">Fallecidos \n seg&uacute;n edad x otras causas:</font></strong></td>\n <td><div align=\"right\"></div></td>\n </tr>\n <tr> \n <td><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">0-14 años:\n </font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$f0a14</strong></font></td>\n </tr>\n <tr> \n <td height=\"26\"><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n 15-64años:</font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$f15a64</strong></font></td>\n </tr>\n <tr> \n <td height=\"26\"><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n 65-74 años:</font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$f65a74</strong></font></td>\n </tr>\n <tr> \n <td height=\"26\"><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n 75 años y más:</font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$f75ym</strong></font></td>\n </tr>\n <tr> \n <td><strong><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">IFI:</font></strong></td>\n <td><div align=\"right\"></div></td>\n </tr>\n <tr> \n <td><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">0-14 años:\n </font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$ifi0a14</strong></font></td>\n </tr>\n <tr> \n <td height=\"26\"><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n 15-64años:</font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$ifi15a64</strong></font></td>\n </tr>\n <tr> \n <td height=\"26\"><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n 65-74 años:</font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$ifi65a74</strong></font></td>\n </tr>\n <tr> \n <td height=\"26\"><div align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n 75 años y más:</font></div></td>\n <td align=\"right\"><font color=\"#0000CC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">\n <strong>$ifi75ym</strong></font></td>\n </tr>\n \n</table>\nEOQ;\necho $imp;\n$data.=$imp;\nfwrite($fp,$data); // graba archivo\nfclose($fp); // cierra\n}", "public function actionEstadistica() {\n\n $idanio = $_SESSION['anio'];\n $codigoMatricula = $_SESSION['codmatricula'];\n\n $pb1 = 0;\n $pb2 = 0;\n $pb3 = 0;\n $pb4 = 0;\n $pf = 0;\n $cuentaCurso = 0;\n\n $arrayNotasBimetres = array();\n\n $cmdpromediosxanio = \" CALL REPORTE_PROMEDIOS_BIMESTRALES_X_ALUMNO(\" . $codigoMatricula . \");\";\n $promedioBimestre = Yii::app()->db->createCommand($cmdpromediosxanio)->queryAll();\n\n foreach ($promedioBimestre as $fila) {\n\n $cuentaCurso++;\n\n $pb1 = $pb1 + $fila['b1'];\n $pb2 = $pb2 + $fila['b2'];\n $pb3 = $pb3 + $fila['b3'];\n $pb4 = $pb4 + $fila['b4'];\n $pf = $pf + $fila['pc'];\n\n array_push($arrayNotasBimetres, array('name' => $fila['Curso'], 'data' => array(intval($fila['b1']), intval($fila['b2']), intval($fila['b3']), intval($fila['b4']))));\n }\n\n $pb1 = $pb1 / $cuentaCurso;\n $pb2 = $pb2 / $cuentaCurso;\n $pb3 = $pb3 / $cuentaCurso;\n $pb4 = $pb4 / $cuentaCurso;\n $pf = $pf / $cuentaCurso;\n\n\n echo $this->renderPartial('estadistica', array('promedioBimestre' => $promedioBimestre,\n 'pb1' => $pb1, 'pb2' => $pb2, 'pb3' => $pb3, 'pb4' => $pb4, 'pf' => $pf,\n 'arrayNotasBimetres' => $arrayNotasBimetres), true);\n\n echo 'ok';\n }", "function Pedidos_Show() {\n // De sesion\n global $db;\n global $ruta_raiz;\n // Control de visualizaci�n\n global $sFileName;\n global $opcionMenu;\n global $pageAnt; // Pagina de la cual viene\n // Valores\n\n $sFileName = $_POST[\"sFileName\"];\n $opcionMenu = empty($_POST[\"opcionMenu\"]) ? $_GET[\"opcionMenu\"] : $_POST[\"opcionMenu\"];\n\n if(empty($opcionMenu)){\n $opcionMenu = 0;\n }\n // Valores\n $fechaFinal = $_POST[\"fechaFinal\"];\n $fechaInicial = $_POST[\"fechaInicial\"];\n\n $krd = $_SESSION[\"krd\"];\n $dependencia = $_SESSION[\"dependencia\"];\n $usua_doc = $_SESSION[\"usua_doc\"];\n $ps_PRES_ESTADO = strip($_POST[\"s_PRES_ESTADO\"]);\n $ps_RADI_NUME_RADI = strip(trim($_POST[\"s_RADI_NUME_RADI\"]));\n $ps_numeroExpediente = strip(trim($_POST[\"s_numeroExpediente\"]));\n $ps_USUA_LOGIN = strip($_POST['s_USUA_LOGIN']);;\n $ps_DEPE_NOMB = strip($_POST[\"s_DEPE_NOMB\"]);\n $ps_USUA_NOMB = strip($_POST[\"s_USUA_NOMB\"]);\n $ps_hora_limite = strip($_POST[\"s_hora_limite\"]);\n $ps_minuto_limite = strip($_POST[\"s_minuto_limite\"]);\n $ps_meridiano = strip($_POST[\"s_meridiano\"]);\n $ps_PRES_REQUERIMIENTO = strip($_POST[\"s_PRES_REQUERIMIENTO\"]);\n\n\n\n if (strlen($pageAnt) == 0) {\n include_once(\"$ruta_raiz/include/query/prestamo/builtSQL1.inc\");\n //se codiciona para que el prestamos filtre por distintos estados\n //del prestamos.\n // PRESTAMO_ESTADO 1 Solicitado\n // PRESTAMO_ESTADO 2 Prestado\n // PRESTAMO_ESTADO 3 Devuelto\n // PRESTAMO_ESTADO 4 Cancelado\n // PRESTAMO_ESTADO 5 Prestamo Indefinido\n // PRESTAMO_ESTADO 6 Devolver al Proveedor\n if($opcionMenu == 1 or $opcionMenu == 3){\n $sWhere .= \" AND P.PRES_ESTADO = 1 \";\n } elseif($opcionMenu == 2){\n $sWhere .= \" AND P.PRES_ESTADO = 2 \";\n }\n\n include_once(\"$ruta_raiz/include/query/prestamo/builtSQL2.inc\");\n include_once(\"$ruta_raiz/include/query/prestamo/builtSQL3.inc\");\n $iSort = strip(get_param(\"FormPedidos_Sorting\"));\n if (!$iSort)\n $iSort = 20;\n $iSorted = strip(get_param(\"FormPedidos_Sorted\"));\n $sDirection = strip(get_param(\"s_Direction\"));\n if ($iSorted != $iSort) {\n $sDirection = \" DESC \";\n } else {\n if (strcasecmp($sDirection, \" DESC \") == 0) {\n $sDirection = \" ASC \";\n } else {\n $sDirection = \" DESC \";\n }\n }\n $sOrder = \" order by \" . $iSort . $sDirection . \",PRESTAMO_ID limit 1000\";\n include_once \"inicializarRTA.inc\";\n\n $db->conn->SetFetchMode(ADODB_FETCH_ASSOC);\n $rs = $db->query($sSQL . $sOrder);\n $db->conn->SetFetchMode(ADODB_FETCH_NUM);\n // Process empty recordset\n if (!$rs || $rs->EOF) {\n ?>\n <p align=\"center\" class=\"titulosError2\">NO HAY REGISTROS SELECCIONADOS</p>\n <? return;\n }\n // Build parameters for order\n $form_params_search = \"s_RADI_NUME_RADI=\" . tourl($ps_RADI_NUME_RADI) . \"&s_USUA_LOGIN=\" . tourl($ps_USUA_LOGIN) .\n \"&s_DEPE_NOMB=\" . tourl($ps_DEPE_NOMB) . \"&s_USUA_NOMB=\" . tourl($ps_USUA_NOMB) . \"&s_PRES_REQUERIMIENTO=\" .\n tourl($ps_PRES_REQUERIMIENTO) . \"&s_PRES_ESTADO=\" . tourl($ps_PRES_ESTADO) . \"&fechaInicial=\" .\n tourl($fechaInicial) . \"&fechaFinal=\" . tourl($fechaFinal) . \"&s_hora_limite=\" . tourl($ps_hora_limite) .\n \"&s_minuto_limite=\" . tourl($ps_minuto_limite) . \"&s_meridiano=\" . tourl($ps_meridiano);\n\n\n/**/\n $form_params_page = \"&FormPedidos_Page=1&FormStarPage=1&FormSiguiente=0\";\n $form_params = $form_params_search . $form_params_page . \"&opcionMenu=\" . tourl($opcionMenu) . \"&krd=\" . tourl($krd) .\n \"&FormPedidos_Sorted=\" . tourl($iSort) . \"&s_Direction=\" . tourl($sDirection) . \"&FormPedidos_Sorting=\";\n\n // HTML column prestamo headers\n ?>\n <form method=\"post\" action=\"prestamo.php\" id=\"form1\" name=\"rta\">\n <input type=\"hidden\" value='<?= $krd ?>' name=\"krd\">\n <input type=\"hidden\" value=\" \" name=\"radicado\">\n <input type=\"hidden\" value=\"\" name=\"prestado\">\n <input type=\"hidden\" value=\"<?= $ps_numeroExpediente ?>\" name=\"ps_numeroExpediente\">\n <input type=\"hidden\" name=\"opcionMenu\" value=\"<?= $opcionMenu ?>\">\n <!-- orden de presentacion del resultado en el formulario de envio !-->\n <input type=\"hidden\" name=\"FormPedidos_Sorting\" value=\"<?= $iSort ?>\">\n <input type=\"hidden\" name=\"FormPedidos_Sorted\" value=\"<?= $iSorted ?>\">\n <input type=\"hidden\" name=\"s_Direction\" value=\"<?= $sDirection ?>\">\n <table class='table table-striped table-bordered table-hover dataTable no-footer smart-form'>\n <thead>\n <tr role=\"row\">\n <th colspan=\"<?= $numCol ?>\"><a name=\"Search\"><?= $tituloRespuesta[$opcionMenu] ?></a></th>\n </tr>\n </thead>\n <?PHP // Titulos de las columnas\n include_once \"inicializarTabla.inc\";\n\n //----------------------\n // Process page scroller\n //----------------------\n // Initialize records per page\n $iRecordsPerPage = 15;\n // Inicializa el valor de la pagina actual\n $iPage = intval(get_param(\"FormPedidos_Page\"));\n // Inicializa los registros a presentar seg�n la p�gina actual\n $iCounter = 0;\n $ant = \"\";\n if ($iPage > 1) {\n do {\n $new = $rs->fields[\"PRESTAMO_ID\"];\n if ($new != $ant) {\n $iCounter++;\n $ant = $new;\n }\n $rs->MoveNext();\n } while ($iCounter < ($iPage - 1) * $iRecordsPerPage && !$rs->EOF);\n }\n $iCounterIni = $iCounter;\n // Display grid based on recordset\n $y = 1; // Cantidad de registros presentados\n include_once \"getRtaSQLAntIn.inc\"; //Une en un solo campo los expedientes\n while ($rs && !$rs->EOF) {\n // Inicializa las variables con los resultados\n include \"getRtaSQL.inc\";\n\n // Fila de la tabla con los resultados\n include \"getRtaSQLAnt.inc\";\n\n /* */ if ($fldARCH != 'SI') {\n $encabARCH = session_name() . \"=\" . session_id() . \"&buscar_exp=\" . tourl($fldEXP) . \"&krd=$krd&tipo_archivo=&nomcarpeta=\";\n }\n\n $y++;\n include \"cuerpoTabla.inc\";\n $rs->MoveNext();\n }\n\n // Fila de la tabla con lso resultados\n $cantRegPorPagina = $y;\n $iCounter = $iCounter + $y;\n ?>\n <script>\n // Inicializa el arreglo con los radicados a procesar\n var cantRegPorPagina =<?=$cantRegPorPagina-1?>;\n // Marca todas las casillas si la del titulo es marcada\n function seleccionarRta() {\n if(document.rta.rta_.checked) {\n for(i=2;i<document.rta.elements.length;i++)\n document.rta.elements[i].checked=1;\n } else {\n for(i=2;i<document.rta.elements.length;i++)\n document.rta.elements[i].checked=0;\n }\n }\n\n // Valida y envia el formulario\n function enviar() {\n var cant = 0;\n var kk = 1;\n\n for (i = 1; i < document.rta.elements.length; i++) {\n if (document.rta.elements[i].type == \"checkbox\") {\n if (eval(document.rta.elements[i].checked) == true) {\n cant = 1;\n }\n kk++;\n }\n }\n if (cant == 0) {\n alert(\"Debe seleccionar al menos un radicado\");\n } else {\n document.rta.prestado.value = cantRegPorPagina;\n //alert (document.getElementById(\"use_paswor_dmd5\").html);\n document.rta.action = \"formEnvio.php\";\n document.rta.submit();\n }\n }\n\n // Regresa al menu de prestamos\n function regresar() {\n document.rta.opcionMenu.value = \"\";\n document.rta.action = \"menu_prestamo.php\";\n document.rta.submit();\n }\n </script>\n <?\n // Build parameters for page\n if (strcasecmp($sDirection, \" DESC \") == 0) {\n $sDirectionPages = \" ASC \";\n } else {\n $sDirectionPages = \" DESC \";\n }\n $form_params_page = $form_params_search . \"&opcionMenu=\" . tourl($opcionMenu) . \"&FormPedidos_Sorted=\" . tourl($iSort) .\n \"&s_Direction=\" . tourl($sDirectionPages) . \"&krd=\" . tourl($krd) . \"&FormPedidos_Sorting=\" . tourl($iSort);\n // Numero total de registros\n $ant = $antfldPRESTAMO_ID;\n while ($rs && !$rs->EOF) {\n $new = $rs->fields[\"PRESTAMO_ID\"]; //para el manejo de expedientes\n if ($new != $ant) {\n $ant = $new;\n $iCounter++;\n }\n $rs->MoveNext();\n }\n $iCounter--;\n // Inicializa paginas visualizables\n $iNumberOfPages = 10;\n // Inicializa cantidad de p�ginas\n $iHasPages = intval($iCounter / $iRecordsPerPage);\n if ($iCounter % $iRecordsPerPage != 0) {\n $iHasPages++;\n }\n // Determina la p�gina inicial del intervalo\n $iStartPages = 1;\n $FormSiguiente = get_param(\"FormSiguiente\"); //Indica si (1) el n�mero de p�ginas es mayor al visualizable\n if ($FormSiguiente == 0) {\n $iStartPages = get_param(\"FormStarPage\");\n } elseif ($FormSiguiente == -1) {\n $iStartPages = $iPage;\n } else {\n if ($iPage > $iNumberOfPages) {\n $iStartPages = $iPage - $iNumberOfPages + 1;\n }\n }\n // Genera las paginas visualizables\n $sPages = \"\";\n if ($iHasPages > $iNumberOfPages) {\n if ($iStartPages == 1) {\n $sPages .= \"|< << \";\n } else {\n $sPages .= \"<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=1&FormStarPage=1&FormSiguiente=0&\\\">\n <font class=\\\"ColumnFONT\\\" title=\\\"Ver la primera p&aacute;gina\\\">|<</font></a>&nbsp;\";\n $sPages .= \"&nbsp;<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=\" . tourl($iStartPages - 1) . \"&FormStarPage=\" .\n tourl($iStartPages - 1) . \"&FormSiguiente=-1&\\\"><font class=\\\"ColumnFONT\\\" title=\\\"Ver la p&aacute;gina \" .\n ($iStartPages - 1) . \"\\\"><<</font></a>&nbsp;&nbsp;&nbsp;\";\n }\n }\n for ($iPageCount = $iStartPages; $iPageCount < ($iStartPages + $iNumberOfPages); $iPageCount++) {\n if ($iPageCount <= $iHasPages) {\n $sPages .= \"<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=$iPageCount&FormStarPage=\" . tourl($iStartPages) . \"&FormSiguiente=0&\\\">\n <font class=\\\"ColumnFONT\\\" title=\\\"Ver la p&aacute;gina \" . $iPageCount . \"\\\">\" . $iPageCount . \"</font></a>&nbsp;\";\n } else {\n break;\n }\n }\n if ($iHasPages > $iNumberOfPages) {\n if ($iPageCount - 1 < $iHasPages) {\n $sPages .= \"...&nbsp;&nbsp;<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=$iPageCount&FormStarPage=\" . tourl($iStartPages) .\n \"&FormSiguiente=1&\\\"><font class=\\\"ColumnFONT\\\" title=\\\"Ver la p&aacute;gina \" . $iPageCount . \"\\\">>></font></a>&nbsp;&nbsp;\";\n $sPages .= \"&nbsp;<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=$iHasPages&FormStarPage=tourl($iStartPages)\n &FormSiguiente=1&\\\"><font class=\\\"ColumnFONT\\\" title=\\\"Ver la &uacute;ltima p&aacute;gina\\\">>|</font></a>\";\n } else {\n $sPages .= \" >> |\";\n }\n }\n ?>\n <tr class=\"titulos5\" align=\"center\">\n <td colspan=\"<?= ($numCol + 1); ?>\">\n <small>\n <center><br><?= $sPages ?> (P&aacute;gina <?= $iPage ?>/<?= $iHasPages ?>)</center>\n </small>\n </td>\n </tr>\n <?php if ($_POST['genearreporte']!=\"Generar\") { ?>\n\n <? if ($opcionMenu == 1) { ?>\n <tr align=\"center\">\n <td colspan=\"11\" align=\"center\">\n <input type=\"button\" class=\"btn btn-primary\" value=\"Prestar\" onclick=\"enviar();\">\n <input type=\"button\" class=\"btn btn-primary\" value=\"Cancelar\" title=\"Regresa al menú de préstamo y control de documentos\" onclick=\"javascript:regresar();\"></center>\n </td>\n </tr>\n </table>\n <?php } else { #SI el documento se va a devolver\n if ($opcionMenu == 2) { ?>\n <tr align=\"center\">\n <td colspan=\"11\" align=\"center\">\n <input type=\"button\" class=\"botones\" value=\"Devolver\" onclick=\"enviar();\">\n <input type=\"button\" class=\"botones\" value=\"Cancelar\" title=\"Regresa al menú de préstamo y control de documentos\" onclick=\"javascript:regresar();\"></center>\n </td>\n </tr>\n <?php } } } ?>\n <?php if ($_POST['genearreporte']==\"Generar\") { ?>\n <table align=\"center\" class=\"table table-bordered table-striped\"><tr>\n <td align=\"center\">\n <?\n $xsql = serialize ( $sSQL ); // SERIALIZO EL QUERY CON EL QUE SE QUIERE GENERAR EL REPORTE\n $_SESSION ['xheader'] = \"<center><b>$titulo</b></center><br><br>\"; // ENCABEZADO DEL REPORTE\n $_SESSION ['xsql'] = $xsql; // SUBO A SESION EL QUERY// CREO LOS LINKS PARA LOS REPORTES\n echo \"<a href='$ruta_raiz/adodb/adodb-xls.inc.php' target='_blank'><img src='$ruta_raiz/adodb/spreadsheet.png' width='40' heigth='40' border='0'></a>\";\n ?>\n </td>\n </tr>\n </table>\n <?php } ?>\n\n </form>\n <?\n } //fin if\n}", "function facturarApiBol($ids_Ventas, $datosFacturables, $link)\n{\n $linkWeb = \"http://devfactura.in\";\n //PRINT_R($datosFacturables);\n $tipoMoneda = \"MXN\";\n $userReg = $_SESSION['LZFident'];\n //------------------------------------LISTA DE PRODUCTOS A FACTURAR--------------------------------------------------\n $ArrayIdsVentas = array();\n $ArrayIdsVentas = array_merge($ArrayIdsVentas, $ids_Ventas);\n $busqVentas = implode(',', $ArrayIdsVentas);\n $sql = \"SELECT\n clvprod.codigo AS claveprod,\n clvuni.id AS claveUnidad,\n dtvta.cantidad,\n clvuni.nombre claveUniNombre,\n dtvta.precioVenta,\n prod.descripcion AS producto,\n (dtvta.cantidad*dtvta.precioVenta) AS subtotal\n\n FROM\n ventas vta INNER JOIN detventas dtvta ON dtvta.idVenta = vta.id\n INNER JOIN productos prod ON dtvta.idProducto=prod.id\n INNER JOIN sat_claveproducto clvprod ON prod.idClaveProducto =clvprod.codigo\n INNER JOIN sat_claveunidad clvuni ON clvuni.id=prod.idClavUniProducto\n WHERE vta.id IN($busqVentas)\";\n\n\n $resultXprod = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => \"Error al Producto de Ventas por Facturar, notifica a tu Administrador\", 'idsErroneos' => mysqli_error($link))));\n $conceptos = array();\n $monto = 0;\n while ($dat = mysqli_fetch_array($resultXprod)) {\n array_push($conceptos, array(\n 'ClaveProdServ' => $dat['claveprod'],\n 'Cantidad' => $dat['cantidad'],\n 'ClaveUnidad' => $dat['claveUnidad'],\n 'Unidad' => $dat['claveUniNombre'],\n 'ValorUnitario' => $dat['precioVenta'],\n 'Descripcion' => $dat['producto'],\n ));\n $monto = $monto + $dat['subtotal'];\n }\n\n //-----------------------------------------------INTERACCION CON LA API-----------------------------------------------------\n $ch = curl_init();\n //print_r($datosFacturables);\n $fields = [\n \"Receptor\" => [\"UID\" => $datosFacturables['uid']],\n \"TipoDocumento\" => \"factura\",\n \"UsoCFDI\" => $datosFacturables['usoCFDI'],\n \"Redondeo\" => 2,\n \"Conceptos\" => $conceptos,\n \"FormaPago\" => $datosFacturables['formaPago'],\n \"MetodoPago\" => $datosFacturables['metodosPago'],\n \"Moneda\" => $tipoMoneda,\n \"CondicionesDePago\" => $datosFacturables['descMetPgo'],\n \"Serie\" => $datosFacturables['idSerieFact'],\n //\"Serie\" => 11739,\n //\"EnviarCorreo\" => 'false',\n \"Comentarios\" => \"Folio Ventas: \" . $busqVentas\n ];\n //print_r($fields);\n $jsonfield = json_encode($fields);\n //print_r($jsonfield);\n curl_setopt($ch, CURLOPT_URL, $linkWeb . \"/api/v3/cfdi33/create\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonfield);\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n \"Content-Type: application/json\",\n \"F-PLUGIN: \" . '9d4095c8f7ed5785cb14c0e3b033eeb8252416ed',\n \"F-API-KEY: \" . $datosFacturables['apiKey'],\n \"F-SECRET-KEY: \" . $datosFacturables['secretKey']\n ));\n\n $response = curl_exec($ch);\n // print_r(\"Respuesta\".$response);\n\n curl_close($ch);\n $JSON_FACTURA_PHP = json_decode($response); //creo respuesta de API a un Array\n $estatusApi = $JSON_FACTURA_PHP->response; //guardo el estatus*/\n //print_r (\"Estatus: \".$response);\n\n //-----------------------------------------------MANEJO DE RESULTADOS-----------------------------------------------------\n switch ($estatusApi) {\n case 'success':\n $uid = $JSON_FACTURA_PHP->uid;\n $UUID = $JSON_FACTURA_PHP->SAT->UUID;\n $mensaje = $JSON_FACTURA_PHP->message;\n $uid = $JSON_FACTURA_PHP->uid;\n $fechaTimbrado = $JSON_FACTURA_PHP->SAT->FechaTimbrado;\n $noCertSat = $JSON_FACTURA_PHP->SAT->NoCertificadoSAT;\n $selloSat = $JSON_FACTURA_PHP->SAT->SelloSAT;\n $selloCfd = $JSON_FACTURA_PHP->SAT->SelloCFD;\n $serie = $JSON_FACTURA_PHP->INV->Serie;\n $folio = $JSON_FACTURA_PHP->INV->Folio;\n $formaPago = $datosFacturables[\"formaPago\"];\n $metodoPago = trim($datosFacturables[\"metodosPago\"]);\n $rfcRe = $datosFacturables[\"rfcRe\"];\n $rfcEm = $datosFacturables[\"rfcEmp\"];\n $idEmpresa = $datosFacturables[\"idEmpresa\"];\n $correo = $datosFacturables[\"correo\"];\n $uidDatosFisc = $datosFacturables['uid'];\n $complemento = $datosFacturables['complemento'];\n //$idDatosF=$datosFacturables[\"idDatosAct\"];\n //------------------------------------------REGISTRO EN LA TABLA FACTURAS ---------------------------------------------------------\n $sql = \"INSERT INTO facturas (uuid,uid, mensaje, rfcEm, rfcRe, monto, portalCarga, fechaTimbrado, noCertSat, selloSat, selloCfd, serie, folio, fechaReg,\n estatus, idUserReg, tipo, formaPago, metodoPago) VALUES ('$UUID','$uid', '$mensaje','$rfcEm','$rfcRe','$monto','1','$fechaTimbrado','$noCertSat','$selloSat',' $selloCfd', '$serie', '$folio',\n NOW(),'1', $userReg, '1', '$formaPago','$metodoPago')\";\n $resultXFact = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => \"Error al guardar factura, notifica a tu Administrador\", 'idsErroneos' => mysqli_error($link))));\n $facturaIng = mysqli_insert_id($link);\n //--------------------------------------------REGISTRO EN LA TABLA FACTURASGENERADAS ---------------------------------------------------------\n $sql = \"INSERT INTO facturasgeneradas(uuidFact, uidDatosFisc, portalCarga, idUserReg, fechaReg, idEmpresa) VALUES ('$UUID', '$uidDatosFisc','1', '$userReg', NOW(),'$idEmpresa')\";\n $resultXFactGen = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => \"Error al guardar factura generada, notifica a tu Administrador\", 'idsErroneos' => mysqli_error($link))));\n $facturaGen = mysqli_insert_id($link);\n //--------------------------------------------REGISTRO EN LA TABLA FACTVTAS ---------------------------------------------------------\n\n for ($i = 0; $i < count($ids_Ventas); $i++) {\n $idVenta = $ids_Ventas[$i];\n $sql = \"INSERT INTO vtasfact(idVenta, idFactgen) VALUES ('$idVenta', '$facturaGen')\";\n $resultXFactVta = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => \"Error al guardar factura en Ventas, notifica a tu Administrador\", 'idsErroneos' => mysqli_error($link))));\n }\n //--------------------------------------------COMPLEMENTO DE PAGO---------------------------------------------------------\n if ($complemento == '1') {\n\n $datosFactura = array(\n \"UUID\" => $UUID, \"UID\" => $datosFacturables['uid'], \"serie\" => $serie, \"folio\" => $folio, \"monto\" => $monto, \"secretKey\" => $datosFacturables['secretKey'], \"apiKey\" => $datosFacturables['apiKey'], 'idSerieComPgo' => $datosFacturables[\"idSerieComPgo\"],\n \"rfcRe\" => $rfcRe, \"rfcEm\" => $rfcEm, \"empresa\" => $datosFacturables['empresa'], \"sucursal\" => $datosFacturables['sucursal']\n );\n $responseComp = complementosFact($datosFactura, $ids_Ventas, $link);\n $estatusComp = $responseComp[\"estatus\"];\n $fileXMLComp = '';\n $filePDFComp = '';\n $archivoComp = \"\";\n switch ($estatusComp) {\n case '1':\n $fileXMLComp = $responseComp[\"result\"][1];\n $filePDFComp = $responseComp[\"result\"][0];\n $archivoComp = 'ComplPgo_' . $serie . '-' . $folio;\n\n break;\n case '0':\n $fileXMLComp = '';\n $filePDFComp = '';\n $archivoComp = \"\";\n $resp = array('estatus' => '0', 'mensaje' => 'Factura Emitida, Error Al Crear Complemento de Pago.', 'idsErroneos' => $responseComp[\"idsErroneos\"]);\n return $resp;\n break;\n default:\n $fileXMLComp = '';\n $filePDFComp = '';\n $archivoComp = \"\";\n break;\n }\n }\n // ========================================= Descargar PDF y XML =========================================================\n $anioCoriente = date(\"Y\");\n $numMes = date(\"m\");\n $empresa = $datosFacturables['empresa'];\n $nameSuc = $datosFacturables['sucursal'];\n $carpeta = 'FacturasEmitidas/' . $empresa . '/' . $nameSuc . '/' . $anioCoriente . '/' . $numMes . '/';\n $carpetaOrig = '../FacturasEmitidas/' . $empresa . '/' . $nameSuc . '/' . $anioCoriente . '/' . $numMes . '/';\n if (!file_exists($carpetaOrig)) {\n mkdir($carpetaOrig, 0755, true);\n }\n $nameFile = $carpetaOrig . $UUID;\n $nameFileSave = $carpeta . $UUID;\n // ------------------------------------ DESCARGA DE PDF ---------------------------------\n $ch = curl_init();\n $ruta = $linkWeb.\"/api/v3/cfdi33/\" . $uid . '/pdf';\n curl_setopt($ch, CURLOPT_URL, \"$ruta\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n \"Content-Type: application/json\",\n \"F-PLUGIN: \" . '9d4095c8f7ed5785cb14c0e3b033eeb8252416ed',\n \"F-API-KEY: \" . $datosFacturables['apiKey'],\n \"F-SECRET-KEY: \" . $datosFacturables['secretKey']\n ));\n $response = curl_exec($ch);\n curl_close($ch);\n file_put_contents($nameFile . '.PDF', $response);\n\n // ------------------------------------ DESCARGA DE XML ---------------------------------\n $ch = curl_init();\n $ruta = $linkWeb . \"/api/v3/cfdi33/\" . $uid . '/xml';\n curl_setopt($ch, CURLOPT_URL, \"$ruta\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n \"Content-Type: application/json\",\n \"F-PLUGIN: \" . '9d4095c8f7ed5785cb14c0e3b033eeb8252416ed',\n \"F-API-KEY: \" . $datosFacturables['apiKey'],\n \"F-SECRET-KEY: \" . $datosFacturables['secretKey']\n ));\n $response = curl_exec($ch);\n curl_close($ch);\n file_put_contents($nameFile . '.XML', $response);\n\n // ------------------------------------ COMPROBACION DE ARCHIVOS ---------------------------------\n $filePDF = (file_exists($nameFile . '.PDF')) ? $nameFileSave . '.PDF' : '';\n $fileXML = (file_exists($nameFile . '.XML')) ? $nameFileSave . '.XML' : '';\n\n # echo '<br>* link de PDF: '.$filePDF.'<br>* link de XML: '.$fileXML;\n\n $sqlUpdateFiles = \"UPDATE facturas SET doctoPDF = '$filePDF', doctoXML = '$fileXML' WHERE uuid = '$UUID' \";\n # echo '<br>Consulta actualizar doctos: '.$sqlUpdateFiles;\n mysqli_query($link, $sqlUpdateFiles) or die('0|E8.- Tuvimos Problemas al actualizar los Archivos:' . mysqli_error($link) . '<br> ' . $sqlUpdateFiles);\n //=================================== LANZANDO CORREO ===========================================================\n\n $mail = new PHPMailer();\n // Passing `true` enables exceptions\n $mail->setLanguage('es', 'PHPMailer/language/');\n try {\n //Server settings\n $mail->SMTPDebug = 0; // Enable verbose debug output\n $mail->isSMTP(); // Set mailer to use SMTP\n $mail->Host = 'smtp.hostinger.mx';\n $mail->SMTPAuth = true; // Enable SMTP authentication\n $mail->Username = '[email protected]'; // SMTP username\n $mail->Password = '@[email protected]@z@fr@'; // SMTP password\n $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted\n $mail->Port = 587; // TCP port to connect to\n # echo 'Correos enviados a: ';\n //Recipients\n $mail->setFrom('[email protected]', 'Por Favor no responda este correo.');\n //PRINT_R(\"este es el correo-->\".$correo);\n $mail->addAddress($correo); // Add a recipient\n // $mail->addBCC('[email protected]');\n\n //$mail->addReplyTo('[email protected]', 'No Responder');\n\n //Content\n $mail->isHTML(true); // Set email format to HTML\n $mail->Subject = 'Nueva Factura creada con Folio: ' . $serie . '' . $folio . ' de la Venta: ' . $busqVentas;\n $mail->Body = ' <h2>Venta con Folio: ' . $busqVentas . '</h2> <br>';\n $mail->Body .= ' <p><b>Factura emitida por ' . $empresa . ' en la Sucursal ' . $nameSuc . '.</b><br>';\n $mail->Body .= ' <p>Folio Fiscal: <b>' . $UUID . '</b></p>';\n $mail->Body .= ' <p><b>NOTA:</b><br>\n Cualquier duda o aclaración, contactese con la sucursal donde realizó su compra.<br>';\n $mensajeFactura = \"\";\n // $mail->Body ='la mamada';\n $mail->CharSet = 'UTF-8';\n $archivo = 'Factura_' . $serie . '-' . $folio;\n //----------------------------------------------AGREGAR COMPLEMENTO DE PAGO-------------------------------------\n $filePDFComp = (isset($filePDFComp)) ? $filePDFComp : '';\n if ($filePDFComp != '' and $fileXMLComp != '') {\n $mail->addAttachment('../' . $filePDFComp, $archivoComp . '.PDF');\n $mail->addAttachment('../' . $fileXMLComp, $archivoComp . '.XML');\n }\n $mail->addAttachment('../' . $filePDF, $archivo . '.PDF');\n $mail->addAttachment('../' . $fileXML, $archivo . '.XML');\n\n $mail->send();\n $mensajeFactura .= ' y se envió copia a la sucursal';\n } catch (Exception $e) {\n echo '0|E8b.- ' . $mensajeFactura . ', pero tuvimos Problemas al Mandar el correo a la Sucursal, Notifica a tu Administrador';\n }\n //====================================== FINALIZA CORREO =====================================================\n $resp = array('estatus' => '1', 'mensaje' => 'Facturación correcta', 'result' => '');\n return $resp;\n\n break;\n case 'error':\n\n $resp = array('estatus' => '0', 'mensaje' => 'Error Al Facturar.', 'idsErroneos' => array(\"message\" => $JSON_FACTURA_PHP->message));\n return $resp;\n break;\n default:\n $resp = array('estatus' => '0', 'mensaje' => 'Error Inesperado al Guardar Factura', 'idsErroneos' => \"\");\n\n break;\n }\n}", "function TablaVentasProductos()\n {\n //Logo\n $this->Image(\"./assets/img/logo.png\" , 15 ,10, 55 , 18 , \"PNG\"); \n //Arial bold 15\n $this->SetFont('Courier','B',15);\n //Movernos a la derecha\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$ve = new Login();\n $ve = $ve->VentasPorId();\n\t\n################################################# BLOQUE N° 1 ###################################################\t\n\n //Bloque de membrete principal\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 10, 190, 20, '1.5', '');\n\t\n\t//Bloque de membrete principal\n $this->SetFillColor(199);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(98, 14, 12, 12, '1.5', 'F');\n\t//Bloque de membrete principal\n $this->SetFillColor(199);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(98, 14, 12, 12, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',16);\n $this->SetXY(101, 14);\n $this->Cell(20, 5, 'V', 0 , 0);\n\t$this->SetFont('courier','B',8);\n $this->SetXY(98, 19);\n $this->Cell(20, 5, 'Venta', 0 , 0);\n\t\n\t\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 10);\n $this->Cell(20, 5, 'N° VENTA ', 0 , 0);\n\t$this->SetFont('courier','B',8);\n $this->SetXY(165, 10);\n $this->Cell(20, 5,utf8_decode($ve[0]['codventa']), 0 , 0);\n\t\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 13);\n $this->Cell(20, 5, 'N° SERIE ', 0 , 0);\n\t$this->SetFont('courier','B',8);\n $this->SetXY(165, 13);\n $this->Cell(20, 5,utf8_decode($ve[0]['codserieve']), 0 , 0);\n\t\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 16);\n $this->Cell(20, 5, 'N° AUTORIZACIÓN ', 0 , 0);\n\t$this->SetFont('courier','B',8);\n $this->SetXY(165, 16);\n $this->Cell(20, 5,utf8_decode($ve[0]['codautorizacionve']), 0 , 0);\n\t\n\t//Linea de membrete Nro 4\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 19);\n $this->Cell(20, 5, 'FECHA VENTA ', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(165, 19);\n $this->Cell(20, 5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($ve[0]['fechaventa']))), 0 , 0);\n\t\n\t//Linea de membrete Nro 5\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 22);\n $this->Cell(20, 5, 'FECHA EMISIÓN', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(165, 22);\n $this->Cell(20, 5,utf8_decode(date(\"d-m-Y h:i:s\")), 0 , 0);\n\t\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 25);\n $this->Cell(20, 5, 'STATUS VENTA', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(165, 25);\n\t\n\tif($ve[0]['fechavencecredito']== '0000-00-00') { \n\t$this->Cell(20, 5,utf8_decode($ve[0]['statusventa']), 0 , 0);\n\t} elseif($ve[0]['fechavencecredito'] >= date(\"Y-m-d\")) { \n\t$this->Cell(20, 5,utf8_decode($ve[0]['statusventa']), 0 , 0);\n\t} elseif($ve[0]['fechavencecredito'] < date(\"Y-m-d\")) { \n\t$this->Cell(20, 5,utf8_decode(\"VENCIDA\"), 0 , 0);\n\t}\t\n\t\n################################################# BLOQUE N° 2 ###################################################\t\n\n\t//Bloque de datos de empresa\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 32, 190, 18, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(15, 32);\n $this->Cell(20, 5, 'DATOS DE LA EMPRESA ', 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 36);\n $this->Cell(20, 5, 'RAZÓN SOCIAL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(40, 36);\n $this->Cell(20, 5,utf8_decode($con[0]['nomempresa']), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',7);\n $this->SetXY(147, 36);\n $this->Cell(90, 5, 'RIF :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(156, 36);\n $this->Cell(90, 5,utf8_decode($con[0]['rifempresa']), 0 , 0);\n\t//Linea de membrete Nro 4\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 40);\n $this->Cell(20, 5, 'DIRECCIÓN :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(32, 40);\n $this->Cell(20, 5,utf8_decode($con[0]['direcempresa']), 0 , 0);\n\t//Linea de membrete Nro 5\n\t$this->SetFont('courier','B',7);\n $this->SetXY(140, 40);\n $this->Cell(20, 5, 'TELÉFONO :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(156, 40);\n $this->Cell(20, 5,utf8_decode($con[0]['tlfempresa']), 0 , 0);\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 44);\n $this->Cell(20, 5, 'GERENTE :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(30, 44);\n $this->Cell(20, 5,utf8_decode($con[0]['nomresponsable']), 0 , 0);\n\t//Linea de membrete Nro 7\n\t$this->SetFont('courier','B',7);\n $this->SetXY(94, 44);\n $this->Cell(20, 5, 'CÉDULA :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(108, 44);\n $this->Cell(20, 5,utf8_decode($con[0]['cedresponsable']), 0 , 0);\n\t//Linea de membrete Nro 8\n\t$this->SetFont('courier','B',7);\n $this->SetXY(130, 44);\n $this->Cell(20, 5, 'EMAIL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(142, 44);\n $this->Cell(20, 5,utf8_decode($con[0]['correoresponsable']), 0 , 0);\n\t\n################################################# BLOQUE N° 3 ###################################################\t\n\n\t//Bloque de datos de cliente\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 52, 190, 14, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(15, 52);\n $this->Cell(20, 5, 'DATOS DEL CLIENTE ', 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 56);\n $this->Cell(20, 5, 'RAZÓN SOCIAL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(38, 56);\n $this->Cell(20, 5,utf8_decode($ve[0]['nomcliente']), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',7);\n $this->SetXY(112, 56);\n $this->Cell(74, 5, 'RIF :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(122, 56);\n $this->Cell(75, 5,utf8_decode($ve[0]['cedcliente']), 0 , 0);\n\t//Linea de membrete Nro 4\n\t$this->SetFont('courier','B',7);\n $this->SetXY(150, 56);\n $this->Cell(90, 5, 'TELÉFONO :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(166, 56);\n $this->Cell(90, 5,utf8_decode($ve[0]['tlfcliente']), 0 , 0);\n\t//Linea de membrete Nro 5\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 60);\n $this->Cell(20, 5, 'DIRECCIÓN :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(33, 60);\n $this->Cell(20, 5,utf8_decode($ve[0]['direccliente']), 0 , 0);\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',7);\n $this->SetXY(116, 60);\n $this->Cell(20, 5, 'EMAIL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(128, 60);\n $this->Cell(20, 5,utf8_decode($ve[0]['emailcliente']), 0 , 0);\n\t\n\t$this->Ln(8);\n\t$this->SetFont('courier','B',10);\n\t$this->SetTextColor(3, 3, 3); // Establece el color del texto (en este caso es Negro)\n $this->SetFillColor(229, 229, 229); // establece el color del fondo de la celda (en este caso es GRIS)\n\t$this->Cell(8,8,'N°',1,0,'C', True);\n\t$this->Cell(17,8,'CÓDIGO',1,0,'C', True);\n\t$this->Cell(67,8,'DESCRIPCIÓN DE PRODUCTO',1,0,'C', True);\n\t$this->Cell(25,8,'CATEGORIA',1,0,'C', True);\n\t$this->Cell(25,8,'PRECIO',1,0,'C', True);\n\t$this->Cell(23,8,'CANTIDAD',1,0,'C', True);\n\t$this->Cell(25,8,'IMPORTE',1,1,'C', True);\n\t\n\t################################################# BLOQUE N° 4 DE DETALLES DE PRODUCTOS ###################################################\t\n\t//Bloque de datos de empresa\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 78, 190, 170, '1.5', '');\n\t\n\t$this->Ln(3);\n $tra = new Login();\n $reg = $tra->VerDetallesVentas();\n\t$cantidad=0;\n\t$a=1;\n for($i=0;$i<sizeof($reg);$i++){\n\t$cantidad+=$reg[$i]['cantventa'];\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(8,4,$a++,0,0,'C');\n\t$this->CellFitSpace(17,4,utf8_decode($reg[$i][\"codproducto\"]),0,0,'C');\n $this->CellFitSpace(67,4,utf8_decode($reg[$i][\"producto\"]),0,0,'C');\n $this->CellFitSpace(25,4,utf8_decode($reg[$i][\"nomcategoria\"]),0,0,'C');\n\t$this->CellFitSpace(25,4,utf8_decode(number_format($reg[$i][\"precioventa\"], 2, '.', ',')),0,0,'C');\n\t$this->CellFitSpace(23,4,utf8_decode($reg[$i][\"cantventa\"]),0,0,'C');\n\t$this->CellFitSpace(25,4,utf8_decode(number_format($reg[$i][\"importe\"], 2, '.', ',')),0,0,'C');\n $this->Ln();\n }\n \n################################################# BLOQUE N° 5 DE TOTALES ###################################################\t\n\t//Bloque de Informacion adicional\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 250, 110, 28, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',10);\n $this->SetXY(44, 250);\n $this->Cell(20, 5, 'INFORMACIÓN ADICIONAL', 0 , 0);\n\t\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',8);\n $this->SetXY(12, 254);\n $this->Cell(20, 5, 'CANTIDAD DE PRODUCTOS :', 0 , 0);\n $this->SetXY(60, 254);\n\t$this->SetFont('courier','',8);\n $this->Cell(20, 5,utf8_decode($cantidad), 0 , 0);\n\t\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',8);\n $this->SetXY(12, 257.2);\n $this->Cell(20, 5, 'TIPO DE DOCUMENTO :', 0 , 0);\n $this->SetXY(60, 257.2);\n\t$this->SetFont('courier','',8);\n $this->Cell(20, 5,utf8_decode(\"FACTURA\"), 0 , 0);\n\t\n\t//Linea de membrete Nro 4\n\t$this->SetFont('courier','B',8);\n $this->SetXY(12, 260.5);\n $this->Cell(20, 5, 'TIPO DE PAGO :', 0 , 0);\n $this->SetXY(60, 260.5);\n\t$this->SetFont('courier','',8);\n $this->Cell(20, 5,utf8_decode($ve[0]['tipopagove'].\" - \".$ve[0]['formapagove']), 0 , 0);\n\t\n\t//Linea de membrete Nro 5\n\t$this->SetFont('courier','B',8);\n $this->SetXY(12, 263.5);\n $this->Cell(20, 5, 'FECHA DE VENCIMIENTO :', 0 , 0);\n $this->SetXY(60, 263.5);\n\t$this->SetFont('courier','',8);\n $this->Cell(20, 5,utf8_decode($vence = ( $ve[0]['fechavencecredito'] == '0000-00-00' ? \"0\" : date(\"d-m-Y\",strtotime($ve[0]['fechavencecredito'])))), 0 , 0);\n\t\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',8);\n $this->SetXY(12, 266.5);\n $this->Cell(20, 5, 'DIAS VENCIDOS :', 0 , 0);\n $this->SetXY(60, 266.5);\n\t$this->SetFont('courier','',8);\n\t\n if($ve[0]['fechavencecredito']== '0000-00-00') { \n\t$this->Cell(20, 5,utf8_decode(\"0\"), 0 , 0);\n\t} elseif($ve[0]['fechavencecredito'] >= date(\"Y-m-d\")) { \n\t$this->Cell(20, 5,utf8_decode(\"0\"), 0 , 0);\n\t} elseif($ve[0]['fechavencecredito'] < date(\"Y-m-d\")) { \n\t$this->Cell(20, 5,utf8_decode(Dias_Transcurridos(date(\"Y-m-d\"),$ve[0]['fechavencecredito'])), 0 , 0);\n\t}\n\t\n\t//Linea de membrete Nro 7\n\t$this->SetXY(52, 33);\n\t$this->Codabar(13,271,utf8_decode(\"133923786899444489448576556789\"));\n\t//Linea de membrete Nro 2\n $this->SetFont('courier','B',6.5); \n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->SetXY(48, 271);\n $this->Cell(20, 5, 'Este documento no constituye un comprobante de pago', 0 , 0);\n\t\n\t//Bloque de Totales de factura\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(122, 250, 78, 28, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(124, 252);\n $this->Cell(20, 5, 'SUBTOTAL IVA '.$ve[0][\"ivave\"].'% :', 0 , 0);\n $this->SetXY(167, 252);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(number_format($ve[0][\"subtotalivasive\"], 2, '.', ',')), 0 , 0);\n\t\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(124, 256);\n $this->Cell(20, 5, 'SUBTOTAL IVA 0% :', 0 , 0);\n $this->SetXY(167, 256);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(number_format($ve[0][\"subtotalivanove\"], 2, '.', ',')), 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',9);\n $this->SetXY(124, 260);\n $this->Cell(20, 5, 'IVA '.$ve[0][\"ivave\"].'% :', 0 , 0);\n $this->SetXY(167, 260);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(number_format($ve[0][\"totalivave\"], 2, '.', ',')), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',9);\n $this->SetXY(124, 264);\n $this->Cell(20, 5, 'DESC '.$ve[0][\"descuentove\"].'% :', 0 , 0);\n $this->SetXY(167, 264);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(number_format($ve[0][\"totaldescuentove\"], 2, '.', ',')), 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',9);\n $this->SetXY(124, 268);\n $this->Cell(20, 5, 'TOTAL PAGO :', 0 , 0);\n $this->SetXY(167, 268);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(number_format($ve[0][\"totalpago\"], 2, '.', ',')), 0 , 0);\n}", "function preguntasRealizadasAction () \r\n {\r\n// require_once 'TransaccionCierre.php';\r\n require_once 'Aviso.php';\r\n \r\n $this->view->headTitle('Preguntas realizadas | Kotear.pe');\r\n \r\n if (!isset($this->identity)) {\r\n $this->session->requiereLoginUrl = $_SERVER['REQUEST_URI'];\r\n $this->_redirect($this->view->baseUrl() . '/usuario/acceso');\r\n } else {\r\n $mAviso = new Aviso();\r\n $arrRender = new stdClass();\r\n \r\n $arrRender->tab = 'cuenta';\r\n $arrRender->page = 'compra/_preguntas-realizadas';\r\n $arrRender->active = $this->getRequest()->getActionName();\r\n $fileshare = $this->getConfig()->fileshare->toArray(); \r\n $question = $this->_request->getParam('pregunta', '');\r\n $page = $this->_request->getParam('page', '');\r\n $this->session->pageHistory = $_SERVER['REQUEST_URI'];\r\n $input['K_ID_USR'] = $this->identity->ID_USR;\r\n $input['K_PARAM'] = $question;\r\n $input['K_NUM_REGISTROS'] = $this->_nroPagMin;\r\n $input['K_NUM_PAGINA'] = $page;\r\n $data = $mAviso->listarPreguntasRealizadas($input);\r\n //var_dump($data);exit;\r\n $paginador = $this->_paginador($data[0]->TOTAL, $page);\r\n\r\n $this->view->filter = $input;\r\n $this->view->paginador = $paginador;\r\n // $this->view->nroRanMin = $this->_nroPagMin;\r\n $this->view->data = $data;\r\n $this->view->arrRender = $arrRender;\r\n $this->view->ruta=$fileshare['url'].'/'.$fileshare['thumbnails'].'/';\r\n }\r\n }", "function getEstadisticaDetallado() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\t\tglobal $usr;\n\n\t\t# Variables para eventos especiales marcados por el cliente codigo 9.\n\t\t$event = new Event;\n\t\t$usr = new Usuario($current_usuario_id);\n\t\t$usr->__Usuario();\n\t\t$graficoSvg = new GraficoSVG();\n\n\n\t\t$timeZoneId = $usr->zona_horaria_id;\n\t\t$arrTime = Utiles::getNameZoneHor($timeZoneId); \t\t\n\t\t$timeZone = $arrTime[$timeZoneId];\n\t\t$tieneEvento = 'false';\n\t\t$arrayDateStart = array();\t\t\n\t\t$nameFunction = 'EstadisticaDet';\n\t\t$data = null;\n\t\t$ids = null;\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(($this->extra[\"imprimir\"])?REP_PATH_PRINTTEMPLATES:REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'comparativo_resumen.tpl');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_TITULO_HORARIOS', 'bloque_titulo_horarios');\n\t\t$T->setBlock('tpl_tabla', 'ES_PRIMERO_MONITOR', 'es_primero_monitor');\n\t\t$T->setBlock('tpl_tabla', 'ES_PRIMERO_TOTAL', 'es_primero_total');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_PASOS', 'lista_pasos');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_TABLA', 'bloque_tabla');\n\n\t\t$T->setVar('__item_orden', $this->extra[\"item_orden\"]);\n\t\t# Variables para mantenimiento.\n\t\t$T->setVar('__path_jquery_ui', REP_PATH_JQUERY_UI);\n\t\n\t\t$horarios = array($usr->getHorario($this->horario_id));\n\t\tif ($this->horario_id != 0) {\n\t\t\t$horarios[] = $usr->getHorario(0);\n\t\t}\n\n\t\t$orden = 1;\n\t\t$T->setVar('bloque_titulo_horarios', '');\n\t\tforeach ($horarios as $horario) {\n\n\t\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t\t$sql = \"SELECT * FROM reporte.comparativo_resumen_parcial(\".\n\t\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\t\tpg_escape_string($this->objetivo_id).\", \".\n\t\t\t\t\tpg_escape_string($horario->horario_id).\",' \".\n\t\t\t\t\tpg_escape_string($this->timestamp->getInicioPeriodo()).\"', '\".\n\t\t\t\t\tpg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\t\t\t$res =& $mdb2->query($sql);\n// \t\t\tprint($sql);\n\t\t\tif (MDB2::isError($res)) {\n\t\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t$row = $res->fetchRow();\n\t\t\t$dom = new DomDocument();\n\t\t\t$dom->preserveWhiteSpace = false;\n\t\t\t$dom->loadXML($row[\"comparativo_resumen_parcial\"]);\n\t\t\t$xpath = new DOMXpath($dom);\n\t\t\tunset($row[\"comparativo_resumen_parcial\"]);\n\n\t\t\tif ($xpath->query('//detalle[@paso_orden]/estadisticas/estadistica')->length == 0) {\n\t\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$conf_objetivo = $xpath->query('/atentus/resultados/propiedades/objetivos/objetivo')->item(0);\n\t\t\t$conf_pasos = $xpath->query(\"paso[@visible=1]\", $conf_objetivo);\n\t\t\t$conf_nodos = $xpath->query('//nodos/nodo');\n\n\t\t\tif(count($horarios) > 1) {\n\t\t\t\t$T->setVar('__item_horario', $this->extra[\"item_orden\"]);\n\t\t\t\t$T->setVar('__horario_orden', $orden);\n\t\t\t\t$T->setVar('__horario_nombre',$horario->nombre);\n\t\t\t\t$T->parse('bloque_titulo_horarios', 'BLOQUE_TITULO_HORARIOS', false);\n\t\t\t}\n\n\t\t\t\n\t\t\t# Obtención de los eventos especiales marcados por el cliente\n\t\t\tforeach ($xpath->query(\"/atentus/resultados/detalles_marcado/detalle/marcado\") as $tag_marcado) {\n\t\t\t$ids = $ids.','.$tag_marcado->getAttribute('mantenimiento_id');\n\t\t\t$marcado = true;\n\t\t\t}\t\t\n\t\t\t\n\t\t\t# Verifica que exista marcado evento cliente.\n\t\t\tif ($marcado == true) {\n\n\t\t\t\t$dataMant = $event->getData(substr($ids, 1), $timeZone);\n\t\t\t\t$character = array(\"{\", \"}\");\n\t\t\t\t$objetives = explode(',',str_replace($character,\"\",($dataMant[0]['objetivo_id'])));\n\t\t\t\t$tieneEvento = 'true';\n\t\t\t\t$encode = json_encode($dataMant);\n\t\t\t\t$nodoId = (string)0;\n\t\t\t\t$T->setVar('__tiene_evento', $tieneEvento);\n\t\t\t\t$T->setVar('__name', $nameFunction);\n\n\t\t\t}\n\n\t\t\t/* LISTA DE MONITORES */\n\t\t\t$linea = 1;\n\t\t\t$T->setVar('lista_pasos', '');\n\t\t\tforeach($conf_nodos as $conf_nodo) {\n\t\t\t\t$primero = true;\n\t\t\t\t$tag_nodo = $xpath->query('//detalle[@nodo_id='.$conf_nodo->getAttribute('nodo_id').']/estadisticas/estadistica')->item(0);\n\n\t\t\t\t/* LISTA DE PASOS */\n\t\t\t\tforeach($conf_pasos as $conf_paso) {\n\t\t\t\t\t$tag_dato = $xpath->query('//detalle[@nodo_id='.$conf_nodo->getAttribute('nodo_id').']/detalles/detalle[@paso_orden='.$conf_paso->getAttribute('paso_orden').']/estadisticas/estadistica')->item(0);\n\t\t\t\t\tif($tag_dato != null) {\n\t\t\t\t\t\t$T->setVar('__print_class', ($linea % 2 == 0)?\"celdaIteracion2\":\"celdaIteracion1\");\n\t\t\t\t\t\t$T->setVar('__class', ($linea % 2 == 0)?\"celdanegra15\":\"celdanegra10\");\n\n\t\t\t\t\t\t$T->setVar('es_primero_monitor', '');\n\t\t\t\t\t\t$T->setVar('es_primero_total', '');\n\t\t\t\t\t\tif ($primero) {\n\t\t\t\t\t\t\t$T->setVar('__monitor_nombre', $conf_nodo->getAttribute('nombre'));\n\t\t\t\t\t\t\t$T->setVar('__monitor_rowspan', $conf_pasos->length);\n\t\t\t\t\t\t\t$T->setVar('__monitor_total_monitoreo', $tag_nodo->getAttribute('cantidad'));\n\t\t\t\t\t\t\t$T->parse('es_primero_monitor', 'ES_PRIMERO_MONITOR', false);\n\t\t\t\t\t\t\t$T->parse('es_primero_total', 'ES_PRIMERO_TOTAL', false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$T->setVar('__paso_nombre', $conf_paso->getAttribute(\"nombre\"));\n\t\t\t\t\t\t$T->setVar('__paso_minimo', number_format($tag_dato->getAttribute('tiempo_min'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_maximo', number_format($tag_dato->getAttribute('tiempo_max'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_promedio', number_format($tag_dato->getAttribute('tiempo_prom'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_uptime', number_format($tag_dato->getAttribute('uptime'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_downtime', number_format($tag_dato->getAttribute('downtime'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_no_monitoreo', number_format($tag_dato->getAttribute('sin_monitoreo'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_evento_especial', number_format($tag_dato->getAttribute('marcado_cliente'), 3, ',', ''));\n\n\t\t\t\t\t\t$T->parse('lista_pasos', 'LISTA_PASOS', true);\n\t\t\t\t\t\t$primero = false;\n\t\t\t\t\t\t$linea++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$T->parse('bloque_tabla', 'BLOQUE_TABLA', true);\n\t\t\t$orden++;\n\t\t}\n\t\t$this->tiempo_expiracion = (strtotime($xpath->query(\"//fecha_expiracion\")->item(0)->nodeValue) - strtotime($xpath->query(\"//fecha\")->item(0)->nodeValue));\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\n\t\t# Agrega el acordeon cuando existan eventos.\n\t\tif (count($dataMant)>0){\n\t\t\t$this->resultado.= $graficoSvg->getAccordion($encode,$nameFunction);\n\t\t}\n\t\treturn $this->resultado;\n\t}", "static public function ctrHistorial(){\n\n\t\t// FACTURAS\n\t\t$tabla = \"cta\";\n\t\t$respuesta = ModeloVentas::mdlHistorial($tabla);\n\t\t\n\n\t\tforeach ($respuesta as $key => $value) {\n\n\t\t\t// veo los items de la factura\n\t\t\t$tabla = \"ctaart\";\n\t\t\t$repuestos = ModeloVentas::mdlHistorialCta_art($tabla,$value['idcta']);\n\t\t\t\n\t\t\t$productos='';\n\n\t\t\tfor($i = 0; $i < count($repuestos)-1; $i++){\n\t\t\t\t\n\t\t\t\t$productos = '{\"id\":\"'.$repuestos[$i][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[$i][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[$i][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[$i][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[$i][\"precio\"].'\"},';\n\t\t\t}\n\n\t\t\t$productos = $productos . '{\"id\":\"'.$repuestos[count($repuestos)-1][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[count($repuestos)-1][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[count($repuestos)-1][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\"}';\n\n\t\t\t$productos =\"[\".$productos.\"]\";\n\t\t\t\n\t\t\techo '<pre>'; print_r($productos); echo '</pre>';\n\t\t\t\n\t\t\t// datos para cargar la factura\n\t\t\t$tabla = \"ventas\";\n\t\t\t$datos = array(\"id_vendedor\"=>1,\n\t\t\t\t\t\t \"fecha\"=>$value['fecha'],\n\t\t\t\t\t\t \"id_cliente\"=>$value[\"idcliente\"],\n\t\t\t\t\t\t \"codigo\"=>$key,\n\t\t\t\t\t\t \"nrofc\"=>$value[\"nrofc\"],\n\t\t\t\t\t\t \"detalle\"=>strtoupper($value[\"obs\"]),\n\t\t\t\t\t\t \"productos\"=>$productos,\n\t\t\t\t\t\t \"impuesto\"=>0,\n\t\t\t\t\t\t \"neto\"=>0,\n\t\t\t\t\t\t \"total\"=>$value[\"importe\"],\n\t\t\t\t\t\t \"adeuda\"=>$value[\"adeuda\"],\n\t\t\t\t\t\t \"obs\"=>\"\",\n\t\t\t\t\t\t \"metodo_pago\"=>$value[\"detallepago\"],\n\t\t\t\t\t\t \"fechapago\"=>$value['fecha']);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\t\t\t\n\n\t\t}\n\t\t\n\t\treturn $respuesta;\n\n\t\t\n\t\t\n\t}", "function EstadoCuenta(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_SALAT_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n $this->setParametro('id_agencia','id_agencia','int4');\n //Definicion de la lista del resultado del query\n $this->captura('id_agencia','int4');\n $this->captura('id_periodo_venta','int4');\n $this->captura('nombre','varchar');\n $this->captura('mes','varchar');\n $this->captura('fecha_ini','date');\n $this->captura('fecha_fin','date');\n $this->captura('credito','varchar');\n $this->captura('total_credito','numeric');\n $this->captura('debito','varchar');\n $this->captura('total_debito','numeric');\n $this->captura('saldo','numeric');\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n // var_dump($this->respuesta);exit;\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function OCLSalida($oc_id=0,$empresa_id=0){\n $reg=oc::edit('S',$oc_id); \n $search=array(\"<\",\">\");\n $replace=array(\"\",\"\");\n $lbl_id='Id';\n $lbl_prod_nombre='Descripción';\n $lbl_cantidad='Cantidad';\n $lbl_precio='Precio';\n $lbl_st='Sub Total'; \n \n \n $items=oc::edit(\"D\",$reg['oc_id']);\n $detalle='<table class=\"list\" >';\n $detalle.='<thead>\n <tr>\n <td width=\"10%\" align=\"center\">'.$lbl_id.'</td>\n <td width=\"50%\" align=\"center\">'.$lbl_prod_nombre.'</td>\n <td width=\"10%\" align=\"center\">'.$lbl_cantidad.'</td>\n <td width=\"15%\" align=\"center\">'.$lbl_precio.'</td>\n <td width=\"15%\" align=\"center\">'.$lbl_st.'</td>\n </tr></thead><tbody>';\n $c=0;\n $sub=0;\n $total=0;\n foreach($items as $item){\n $c++;\n $sub=round($item['pro_cantidad']*$item['pro_precio_compra'],2);\n $total+=$sub;\n $detalle.='<tr>\n <td align=\"center\">'.$c.'</td>\n <td>'.$item['producto'].'<br>'.$item['pro_descripcion'].'</td>\n <td align=\"center\">&nbsp;'.$item['pro_cantidad'].'</td>\n <td align=\"right\">'.$item['pro_precio_compra'].'&nbsp;</td>\n <td align=\"right\">'.($sub).'&nbsp;</td>\n </tr>';\n }\n $detalle.='<tr><td colspan=\"4\" align=\"right\">Total US$ </td><td align=\"right\">'.$total.'</td></tr>';\n $detalle.='</tbody></table>';\n \n $condiciones='<table><tbody><tr><td colspan=\"2\"><b>&nbsp;Indicaciones:</b></td></tr>';\n $condiciones.=($reg['oc_cond_precios']>'')?'<tr><td width=\"25%\">&nbsp;Precios</td><td width=\"7%\">'.$reg['oc_cond_precios'].'</td></tr>':'';\n $condiciones.=($reg['oc_cond_plazo_ent']>'')?'<tr><td>&nbsp;Plazo Entrega</td><td>'.$reg['oc_cond_plazo_ent'].'</td></tr>':'';\n $condiciones.=($reg['oc_cond_lugar_ent']>'')?'<tr><td>&nbsp;Lugar Entrega</td><td>'.$reg['oc_cond_lugar_ent'].'</td></tr>':'';\n $condiciones.=($reg['oc_cond_forma_pago']>'')?'<tr><td>&nbsp;Forma Pago</td><td>'.$reg['oc_cond_forma_pago'].'</td></tr>':'';\n $condiciones.=($reg['oc_cond_garantia']>'')?'<tr><td>&nbsp;Garantia</td><td>'.$reg['oc_cond_garantia'].'</td></tr>':'';\n $condiciones.=($reg['oc_cond_validez']>'')?'<tr><td>&nbsp;Validez</td><td>'.$reg['oc_cond_validez'].'</td></tr>':'';\n $condiciones.=($reg['oc_cond_penalidad']>'')?'<tr><td>&nbsp;Penalidad</td><td>'.$reg['oc_cond_penalidad'].'</td></tr>':'';\n $condiciones.=($reg['oc_cond_carta_fianza']>'')?'<tr><td>&nbsp;Canta Fianza</td><td>'.$reg['oc_cond_carta_fianza'].'</td></tr>':'';\n $condiciones.='</tbody></table>'; \n \n $search=array('[NRO]','[PROVEEDOR]','[EMPRESA]','[PROYECTO]','[REFERENCIA]','[FECHA]','[DETALLE]','[CONDICIONES]');\n $replace=array($reg['oc_nro'],$reg['cliente'],$reg['empresa'],$reg['proyecto'],'',$reg['fecha'],$detalle,$condiciones);\n $str=file_get_contents('plantillas/ocl_formato.html');\n $str=str_replace($search,$replace,$str);\n\n \n $valor=array('html'=>$str,'codigo'=>$reg['oc_nro']); \n \n return $valor;\n}", "function gerar(){\r\n\t\tif(strlen($this->estabelecimento->getdircontabil()) == 0){\r\n\t\t\t$_SESSION[\"ERROR\"] = \"Informe o diret&oacute;rio de integra&ccedil;&atilde;o cont&aacute;bil para o estabelecimento.<br><a onclick=\\\"$.messageBox('close'); openProgram('Estabel','codestabelec=\".$this->estabelecimento->getcodestabelec().\"')\\\">Clique aqui</a> para abrir o cadastro de estabelecimento.\";\r\n\t\t\techo messagebox(\"error\", \"\", $_SESSION[\"ERROR\"]);\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\tif($this->gerar_financeiro){\r\n\t\t\t$query = \"SELECT codlancto, data, debito, credito, LPAD(valorliquido::text,17,'0') AS valorliquido, historicopadrao, complemento, ccdb, cccr, pagrec FROM \";\r\n\r\n\t\t\t$query .= \"( \";\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"contaparceiro.contacontabil as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valorparcela AS valorliquido, historicopadrao.descricao AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contaparceiro on (v_parceiro.codconta = contaparceiro.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao ON (contaparceiro.codhistorico = historicopadrao.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' AND (SUBSTR(lancamento.serie,1,3) != 'TRF' OR lancamento.serie is null) \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT codlancto AS codlancto, \tlpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"(SELECT contacontabil FROM planocontas WHERE codconta=(SELECT codconta FROM banco WHERE codbanco=(SELECT codbanco FROM lancamento AS lanc_aux WHERE lanc_aux.dtliquid=lancamento.dtliquid AND serie='TRF' AND lanc_aux.horalog=lancamento.horalog AND pagrec='R' limit 1))) AS debito, \";\r\n\t\t\t$query .= \"(CASE WHEN pagrec='P' THEN contabanco.contacontabil END) AS credito, \";\r\n\t\t\t$query .= \"lancamento.valorparcela AS valorliquido, \";\r\n\t\t\t$query .= \"historicopadrao.descricao AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, \";\r\n\t\t\t$query .= \"'' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR, \";\r\n\t\t\t$query .= \"'T' AS pagrec \";\r\n\t\t\t$query .= \"FROM lancamento INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contaparceiro on (v_parceiro.codconta = contaparceiro.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao ON (contaparceiro.codhistorico = historicopadrao.codhistorico) \";\r\n\t\t\t$query .= \"WHERE SUBSTR(lancamento.serie,1,3)='TRF' AND lancamento.pagrec = 'P' \";\r\n\t\t\t$query .= \" AND EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\t\t\t$query .= \"GROUP BY 1,2,3,4,5,6,7,8 \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"CASE WHEN lancamento.pagrec = 'P' THEN conta_p.contacontabil ELSE conta_r.contacontabil END as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valorjuros AS valorliquido, CASE WHEN lancamento.pagrec = 'P' THEN h_p.descricao ELSE h_r.descricao END AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN paramplanodecontas ON (paramplanodecontas.codestabelec = lancamento.codestabelec) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_p on (paramplanodecontas.codconta_valorjuros_pag = conta_p.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_r on (paramplanodecontas.codconta_valorjuros_rec = conta_r.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_p ON (conta_p.codhistorico = h_p.codhistorico) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_r ON (conta_r.codhistorico = h_r.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} AND lancamento.valorjuros > 0 \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"CASE WHEN lancamento.pagrec = 'P' THEN conta_p.contacontabil ELSE conta_r.contacontabil END as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valordescto AS valorliquido, CASE WHEN lancamento.pagrec = 'P' THEN h_p.descricao ELSE h_r.descricao END AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN paramplanodecontas ON (paramplanodecontas.codestabelec = lancamento.codestabelec) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_p on (paramplanodecontas.codconta_valordescto_pag = conta_p.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_r on (paramplanodecontas.codconta_valordescto_rec = conta_r.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_p ON (conta_p.codhistorico = h_p.codhistorico) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_r ON (conta_r.codhistorico = h_r.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} AND lancamento.valordescto > 0 \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"CASE WHEN lancamento.pagrec = 'P' THEN conta_p.contacontabil ELSE conta_r.contacontabil END as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valoracresc AS valorliquido, CASE WHEN lancamento.pagrec = 'P' THEN h_p.descricao ELSE h_r.descricao END AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN paramplanodecontas ON (paramplanodecontas.codestabelec = lancamento.codestabelec) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_p on (paramplanodecontas.codconta_valordescto_pag = conta_p.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_r on (paramplanodecontas.codconta_valordescto_rec = conta_r.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_p ON (conta_p.codhistorico = h_p.codhistorico) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_r ON (conta_r.codhistorico = h_r.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} AND lancamento.valoracresc > 0 \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\t\t\t$query .= \")AS tmp ORDER BY tmp.data, tmp.complemento, tmp.historicopadrao ASC \";\r\n\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\r\n\t\t\t$arr_linha_contimatic = array();\r\n\t\t\t$cont = 1;\r\n\t\t\tforeach($arr as $row){\r\n\r\n\t\t\t\t$linha = $this->valor_numerico($cont, 0, 7); //\r\n\t\t\t\t$linha .= $this->valor_texto($row[\"data\"], 5); //\r\n\r\n\t\t\t\tif($row[\"pagrec\"] == \"R\"){\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"credito\"], 0, 7);\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"debito\"], 0, 7);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"debito\"], 0, 7);\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"credito\"], 0, 7);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$linha .= $row[\"valorliquido\"]; //\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"historicopadrao\"],0,5);\r\n\t\t\t\t$linha .= $this->valor_texto(removespecial($row[\"complemento\"].\" Chave:\".$row[\"codlancto\"]), 200); //\r\n\t\t\t\tif($row[\"pagrec\"] == \"R\"){\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"cccr\"], 42);\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"ccdb\"], 42);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"ccdb\"], 42);\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"cccr\"], 42);\r\n\t\t\t\t}\r\n\t\t\t\t$cont++;\r\n\t\t\t\t$arr_linha_contimatic[] = $linha;\r\n\t\t\t}\r\n\r\n\t\t\tif(strlen($this->apelidocontimatic) > 0){\r\n\t\t\t\t$nomearq = $this->estabelecimento->getdircontabil().$this->apelidocontimatic.\".\".\"M\".substr($this->ano,-2);\r\n\t\t\t}else{\r\n\t\t\t\t$nomearq = $this->estabelecimento->getdircontabil().$this->estabelecimento->getnome().\"_financeiro_\".$this->mes.\".txt\";\r\n\t\t\t}\r\n\t\t\t$arquivo = fopen($nomearq, \"w\");\r\n\t\t\tforeach($arr_linha_contimatic as $linha){\r\n\t\t\t\tfwrite($arquivo, $linha.\"\\r\\n\");\r\n\t\t\t}\r\n\t\t\tfclose($arquivo);\r\n\t\t\techo messagebox(\"success\", \"\", \"Arquivo gerado com sucesso!\");\r\n\t\t\techo download($nomearq);\r\n\t\t}\r\n\r\n\t\t// Gera o planod e contas\r\n\t\tif($this->gerar_planodecontas){\r\n\t\t\t//******************************************************************\r\n\t\t\t//\t\t\t\t\t\tRegistro Plano de Contas\r\n\t\t\t//******************************************************************\r\n\t\t\t$where = array();\r\n\t\t\t$this->setprevreal(\"R\");\r\n\t\t\t$this->setstatus(\"L\");\r\n\r\n\t\t\t$query = \"SELECT lancamento.codlancto, lancamento.dtlancto, lancamento.valorliquido, \";\r\n\t\t\t$query .= \"(SELECT numconta FROM planocontas WHERE lancamento.codcontadeb = codconta AND tpconta IN ('D','A')) AS numcontadeb, \";\r\n\t\t\t$query .= \"(SELECT numconta FROM planocontas WHERE lancamento.codcontacred = codconta AND tpconta IN ('C','A')) AS numcontacred, \";\r\n\t\t\t$query .= \"lancamento.numnotafis, lancamento.serie, v_parceiro.nome as parceiro \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\tif(strlen($this->ano) > 0){\r\n\t\t\t\t$where[] = \"EXTRACT(YEAR FROM dtliquid) = '{$this->ano}'\";\r\n\t\t\t}\r\n\t\t\tif(strlen($this->mes) > 0){\r\n\t\t\t\t$where[] = \"EXTRACT(MONTH FROM dtliquid) ='\".$this->mes.\"'\";\r\n\t\t\t}\r\n\t\t\tif(strlen($this->codestabelec) > 0){\r\n\t\t\t\t$where[] = \"codestabelec = \".$this->codestabelec;\r\n\t\t\t}\r\n\t\t\tif(strlen($this->prevreal) > 0){\r\n\t\t\t\t$where[] = \"prevreal = '\".$this->prevreal.\"'\";\r\n\t\t\t}\r\n\t\t\tif(strlen($this->status) > 0){\r\n\t\t\t\t$where[] = \"status = '\".$this->status.\"'\";\r\n\t\t\t}\r\n\t\t\tif(sizeof($where) > 0){\r\n\t\t\t\t$query .= \"WHERE (lancamento.codcontacred > 0 OR lancamento.codcontadeb > 0) AND \".implode(\" AND \", $where).\" \";\r\n\t\t\t}\r\n\t\t\techo $query;\r\n\t\t\t$arr_linha_contimatic = array();\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\r\n\t\t\tif(count($arr) == 0){\r\n\t\t\t\tdie(messagebox(\"error\", \"\", \"Nenhum lancamento encontrado.\"));\r\n\t\t\t}\r\n\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$linha = $this->valor_numerico($row[\"codlancto\"], 0, 7); // Codigo do lancamento\r\n\t\t\t\t$linha .= $this->valor_data_planodecontas($row[\"dtlancto\"]); // Data do lancamento\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"numcontadeb\"], 0, 7); // Codigo reduzido da conta a ser debitada\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"numcontacred\"], 0, 7); // Codigo reduzido da conta a ser creditada\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"valorliquido\"], 2, 17); // Valor\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"codcontacred\"], 0, 5); // Historico padrao\r\n\t\t\t\t$linha .= $this->valor_texto(\"{$row[\"numnotafis\"]} {$row[\"serie\"]} - {$row[\"parceiro\"]}\", 200); // Complemento\r\n\t\t\t\t$arr_linha_contimatic[] = $linha;\r\n\t\t\t}\r\n\r\n\t\t\t$nomearq = $this->estabelecimento->getdircontabil().$this->estabelecimento->getnome().$this->mes.\".txt\";\r\n\t\t\t$arquivo = fopen($nomearq, \"w\");\r\n\t\t\tforeach($arr_linha_contimatic as $linha){\r\n\t\t\t\tfwrite($arquivo, $linha.\"\\r\\n\");\r\n\t\t\t}\r\n\t\t\tfclose($arquivo);\r\n\t\t\techo download($nomearq);\r\n\t\t\t//******************************************************************\r\n\t\t}\r\n\r\n\t\t// Busca os mapas resumo\r\n\t\t$this->arr_maparesumo = array();\r\n\t\tif($this->gerar_cupomfiscal){\r\n\t\t\tsetprogress(0, \"Carregando mapas resumo\", TRUE);\r\n\t\t\t$res = $this->con->query(\"SELECT codmaparesumo FROM maparesumo WHERE codestabelec = \".$this->estabelecimento->getcodestabelec().\" AND EXTRACT(YEAR FROM dtmovto) = \".$this->ano.\" AND EXTRACT(MONTH FROM dtmovto) = \".$this->mes.\" ORDER BY dtmovto, caixa\");\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\t$arr_codmaparesumo = array();\r\n\t\t\tforeach($arr as $i => $row){\r\n\t\t\t\t$arr_codmaparesumo[] = $row[\"codmaparesumo\"];\r\n\t\t\t}\r\n\t\t\t$this->arr_maparesumo = object_array_key(objectbytable(\"maparesumo\", NULL, $this->con), $arr_codmaparesumo);\r\n\t\t}\r\n\r\n\t\t// Busca os impostos dos mapas resumo\r\n\t\t$this->arr_maparesumoimposto = array();\r\n\t\t$i = 1;\r\n\t\t$n = sizeof($this->arr_maparesumo);\r\n\t\tforeach($this->arr_maparesumo as $maparesumo){\r\n\t\t\tsetprogress(($i / $n * 100), \"Carregando impostos dos mapas resumo: \".$i.\" de \".$n);\r\n\t\t\t$query = \"SELECT tptribicms, aliqicms, SUM(totalliquido) AS totalliquido, SUM(totalicms) AS totalicms \";\r\n\t\t\t$query .= \"FROM maparesumoimposto \";\r\n\t\t\t$query .= \"WHERE codmaparesumo = \".$maparesumo->getcodmaparesumo().\" \";\r\n\t\t\t$query .= \"\tAND totalliquido > 0 \";\r\n\t\t\t$query .= \"GROUP BY tptribicms, aliqicms \";\r\n\t\t\t$query .= \"ORDER BY tptribicms, aliqicms \";\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$maparesumoimposto = objectbytable(\"maparesumoimposto\", NULL, $this->con);\r\n\t\t\t\t$maparesumoimposto->setcodmaparesumo($maparesumo->getcodmaparesumo());\r\n\t\t\t\t$maparesumoimposto->settptribicms($row[\"tptribicms\"]);\r\n\t\t\t\t$maparesumoimposto->setaliqicms($row[\"aliqicms\"]);\r\n\t\t\t\t$maparesumoimposto->settotalliquido($row[\"totalliquido\"]);\r\n\t\t\t\t$maparesumoimposto->settotalicms($row[\"totalicms\"]);\r\n\t\t\t\t$this->arr_maparesumoimposto[$maparesumo->getcodmaparesumo()][] = $maparesumoimposto;\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\r\n\t\t// Busca operacoes de nota fiscal\r\n\t\t$this->arr_operacaonota = array();\r\n\t\tsetprogress(0, \"Buscando operacoes de nota fiscal\", TRUE);\r\n\t\t$operacaonota = objectbytable(\"operacaonota\", NULL, $this->con);\r\n\t\t$arr_operacaonota = object_array($operacaonota);\r\n\t\tforeach($arr_operacaonota as $operacaonota){\r\n\t\t\t$this->arr_operacaonota[$operacaonota->getoperacao()] = $operacaonota;\r\n\t\t}\r\n\r\n\t\t// Busca as notas fiscais\r\n\t\t$this->arr_notafiscal = array();\r\n\t\tif($this->gerar_notafiscal){\r\n\t\t\tsetprogress(0, \"Carregando notas fiscais\", TRUE);\r\n\t\t\t$res = $this->con->query(\"SELECT idnotafiscal FROM notafiscal WHERE codestabelec = \".$this->estabelecimento->getcodestabelec().\" AND EXTRACT(YEAR FROM dtentrega) = \".$this->ano.\" AND EXTRACT(MONTH FROM dtentrega) = \".$this->mes);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\t$arr_idnotafiscal = array();\r\n\t\t\tforeach($arr as $i => $row){\r\n\t\t\t\t$arr_idnotafiscal[] = $row[\"idnotafiscal\"];\r\n\t\t\t}\r\n\t\t\t$this->arr_notafiscal = object_array_key(objectbytable(\"notafiscal\", NULL, $this->con), $arr_idnotafiscal);\r\n\t\t}\r\n\r\n\t\t// Busca os impostos das notas fiscais\r\n\t\t$this->arr_notafiscalimposto = array();\r\n\t\t$i = 1;\r\n\t\t$n = sizeof($this->arr_notafiscal);\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\tsetprogress(($i / $n * 100), \"Carregando impostos das notas fiscais: \".$i.\" de \".$n);\r\n\t\t\t$this->arr_notafiscalimposto[$notafiscal->getidnotafiscal()] = array();\r\n\t\t\t$query = \"SELECT idnotafiscal, aliquota, SUM(base) AS base, SUM(valorimposto) AS valorimposto, SUM(reducao) AS reducao, SUM(isento) AS isento \";\r\n\t\t\t$query .= \"FROM notafiscalimposto \";\r\n\t\t\t$query .= \"WHERE idnotafiscal = \".$notafiscal->getidnotafiscal().\" \";\r\n\t\t\t$query .= \"\tAND tipoimposto LIKE 'ICMS%' \";\r\n\t\t\t$query .= \"\tAND tipoimposto != 'ICMS_F' \";\r\n\t\t\t$query .= \"GROUP BY idnotafiscal, aliquota \";\r\n\t\t\t$query .= \"ORDER BY aliquota \";\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$notafiscalimposto = objectbytable(\"notafiscalimposto\", NULL, $this->con);\r\n\t\t\t\t$notafiscalimposto->setidnotafiscal($notafiscal->getidnotafiscal());\r\n\t\t\t\t$notafiscalimposto->settipoimposto(\"ICMS\");\r\n\t\t\t\t$notafiscalimposto->setaliquota($row[\"imposto\"]);\r\n\t\t\t\t$notafiscalimposto->setbase($row[\"base\"]);\r\n\t\t\t\t$notafiscalimposto->setvalorimposto($row[\"valorimposto\"]);\r\n\t\t\t\t$notafiscalimposto->setreducao($row[\"reducao\"]);\r\n\t\t\t\t$notafiscalimposto->setisento($row[\"isento\"]);\r\n\t\t\t\t$this->arr_notafiscalimposto[$notafiscal->getidnotafiscal()][] = $notafiscalimposto;\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\t// Busca os cliente\r\n\t\t$this->arr_cliente = array();\r\n\t\tsetprogress(0, \"Buscando clientes\", TRUE);\r\n\t\t$arr_codcliente = array();\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$operacaonota = $this->arr_operacaonota[$notafiscal->getoperacao()];\r\n\t\t\tif($operacaonota->getparceiro() == \"C\"){\r\n\t\t\t\t$arr_codcliente[] = $notafiscal->getcodparceiro();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$arr_codcliente = array_merge(array_unique($arr_codcliente));\r\n\t\tforeach($arr_codcliente as $i => $codcliente){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codcliente) * 100), \"Carregando clientes: \".($i + 1).\" de \".sizeof($arr_codcliente));\r\n\t\t\t$this->arr_cliente[$codcliente] = objectbytable(\"cliente\", $codcliente, $this->con);\r\n\t\t}\r\n\r\n\t\t// Busca os estabelecimentos\r\n\t\t$this->arr_estabelecimento = array();\r\n\t\tsetprogress(0, \"Buscando estabelecimentos\", TRUE);\r\n\t\t$arr_codestabelec = array();\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$operacaonota = $this->arr_operacaonota[$notafiscal->getoperacao()];\r\n\t\t\tif($operacaonota->getparceiro() == \"E\"){\r\n\t\t\t\t$arr_codestabelec[] = $notafiscal->getcodparceiro();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$arr_codestabelec = array_merge(array_unique($arr_codestabelec));\r\n\t\tforeach($arr_codestabelec as $i => $codestabelec){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codestabelec) * 100), \"Carregando estabelecimentos: \".($i + 1).\" de \".sizeof($arr_codestabelec));\r\n\t\t\t$this->arr_estabelecimento[$codestabelec] = objectbytable(\"estabelecimento\", $codestabelec, $this->con);\r\n\t\t}\r\n\r\n\t\t// Busca os fornecedores\r\n\t\t$this->arr_fornecedor = array();\r\n\t\tsetprogress(0, \"Buscando fornecedores\", TRUE);\r\n\t\t$arr_codfornec = array();\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$operacaonota = $this->arr_operacaonota[$notafiscal->getoperacao()];\r\n\t\t\tif($operacaonota->getparceiro() == \"F\"){\r\n\t\t\t\t$arr_codfornec[] = $notafiscal->getcodparceiro();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$arr_codfornec = array_merge(array_unique($arr_codfornec));\r\n\t\tforeach($arr_codfornec as $i => $codfornec){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codfornec) * 100), \"Carregando fornecedores: \".($i + 1).\" de \".sizeof($arr_codfornec));\r\n\t\t\t$this->arr_fornecedor[$codfornec] = objectbytable(\"fornecedor\", $codfornec, $this->con);\r\n\t\t}\r\n\r\n\t\t// Busca as cidades\r\n\t\t$this->arr_cidade = array();\r\n\t\tsetprogress(0, \"Buscando cidades\", TRUE);\r\n\t\t$arr_codcidade = array();\r\n\t\t$arr_codcidade[] = $this->estabelecimento->getcodcidade();\r\n\t\tforeach($this->arr_cliente as $cliente){\r\n\t\t\t$arr_codcidade[] = $cliente->getcodcidaderes();\r\n\t\t}\r\n\t\tforeach($this->arr_estabelecimento as $estabelecimento){\r\n\t\t\t$arr_codcidade[] = $estabelecimento->getcodcidade();\r\n\t\t}\r\n\t\tforeach($this->arr_fornecedor as $fornecedor){\r\n\t\t\t$arr_codcidade[] = $fornecedor->getcodcidade();\r\n\t\t}\r\n\t\t$arr_codcidade = array_merge(array_unique($arr_codcidade));\r\n\t\tforeach($arr_codcidade as $i => $codcidade){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codcidade) * 100), \"Carregando cidades: \".($i + 1).\" de \".sizeof($arr_codcidade));\r\n\t\t\t$this->arr_cidade[$codcidade] = objectbytable(\"cidade\", $codcidade, $this->con);\r\n\t\t}\r\n\r\n\t\tsetprogress(0, \"Gerando arquivo\", TRUE);\r\n\t\t$arr_registro = array();\r\n\t\tforeach($this->arr_maparesumo as $maparesumo){\r\n\t\t\t$arr_registro[] = $this->registro_r1($maparesumo, FALSE);\r\n\t\t\t$arr_registro[] = $this->registro_r1($maparesumo, TRUE);\r\n\t\t}\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$arr_registro[] = $this->registro_r1($notafiscal);\r\n\t\t}\r\n\r\n\t\t$arr_linha_e = array(); // Linhas para criar arquivo de entrada\r\n\t\t$arr_linha_s = array(); // Linhas para criar arquivo de saida\r\n\t\tforeach($arr_registro as $registro){\r\n\t\t\tif(!is_null($registro)){\r\n\t\t\t\t$linha = implode(\"|\", $registro);\r\n\t\t\t\tswitch($registro[\"02\"]){\r\n\t\t\t\t\tcase \"E\": $arr_linha_e[] = $linha;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"S\": $arr_linha_s[] = $linha;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->criar_arquivo($arr_linha_e, \"E\");\r\n\t\t$this->criar_arquivo($arr_linha_s, \"S\");\r\n\r\n\t\techo messagebox(\"success\", \"\", \"Arquivo gerado com sucesso!\");\r\n\t}", "public function alta()\n {\n $Articulos_model = new Articulos_Model();\n $articulo = new Articulo();\n session_start();\n $errores = [];\n $success = \"\";\n //Recojo datos si hay\n if (isset($_POST['nombre'])) {\n $articulo->setNombre($_POST['nombre']);\n $articulo->setDescripcion($_POST['descripcion']);\n $articulo->setPrecio($_POST['precio']);\n $articulo->setIVA($_POST['IVA']);\n $correcto = true;\n if ($_FILES['imagen']['name'] != \"\") {\n list($base, $extension) = explode(\".\", $_FILES['imagen']['name']);\n $resultado = $this->comprobarImagen($_FILES[\"imagen\"], $_POST['nombre']);\n if ($resultado['success'] == true) {\n $articulo->setImagen($articulo->getNombre() . \".\" . $extension);\n } else {\n $errores[] = $resultado[\"mensaje\"];\n $correcto = false;\n }\n }\n if ($correcto) {\n if ($Articulos_model->create($articulo)) {\n $success = \"Agregado correctamente\";\n } else {\n $errores[] = \"Ha ocurrido un problema\";\n }\n }\n }\n if (isset($_SESSION['cliente'])) {\n $usuario[\"cliente\"] = $_SESSION['cliente'];\n }\n //Pasamos a la vista toda la información que se desea representar\n $variables['articulo'] = $articulo;\n $variables['errores'] = $errores;\n $variables['success'] = $success;\n $usuario[\"usuario\"] = $_SESSION[\"usuario\"];\n //Pasamos a la vista toda la información que se desea representar\n $this->view->show(\"cabecera.php\");\n $this->view->show(\"plantilla_header.php\", $usuario);\n $this->view->show(RUTA_VISTAS . \"listar_header.php\");\n $this->view->show(RUTA_VISTAS . \"alta.php\", $variables);\n $this->view->show(\"plantilla_pie.php\");\n $this->view->show(\"pie.php\", $usuario);\n }", "public function nuevo()\n {\n log_message('DEBUG','#TRAZA | #TRAZ-PROD-TRAZASOFT | ETAPA | nuevo()');\n \n $this->load->model(TST.'Tareas');\n $this->Tareas->eliminarTareasSinOrigen(empresa());\n #Snapshot\n $user = userNick();\n $view = 'etapa/abm';\n $data['key'] = $view . $user;\n\n $data['fecha'] = date('Y-m-d');\n $data['id'] = $this->input->get('op');\n $data['etapa'] = $this->Etapas->nuevo($data['id'])->etapa;\n $data['idetapa'] = $data['etapa']->id;\n $data['accion'] = 'Nuevo';\n $data['op'] = $data['etapa']->titulo;\n\n $this->load->model(ALM . 'Articulos');\n #$data['materias'] = $this->Articulos->obtenerXTipos(array('Proceso', 'Final', 'Materia Prima'));\n // $data['productos'] = $this->Articulos->obtenerXTipos(array('Proceso', 'Producto'));\n\n #FORMULARIO GENERICO\n $data['form_id'] = $data['etapa']->form_id;\n\n #Obtener Proucto por Etapa\n $data['productos_etapa'] = $this->Etapas->obtenerArticulos($data['etapa']->id)['data'];\n $data['productos_entrada_etapa'] = $this->Etapas->getEntradaEtapa($data['etapa']->id)['data'];\n $data['formulas'] = $this->Formulas->getFormulas()->formulas->formula;\n $data['lang'] = lang_get('spanish', 5);\n $data['tareas'] = []; //$this->Tareas->listar()->tareas->tarea;\n $data['templates'] = []; //$this->Templates->listar()->templates->template;\n $data['establecimientos'] = $this->Establecimientos->listar($data['id'])->establecimientos->establecimiento; // listo\n $data['recursosmateriales'] = []; //;$this->Recursos_Materiales->listar()->recursos->recurso;\n $data['rec_trabajo'] = $this->Recursos->obtenerXTipo('TRABAJO')['data'];\n $this->load->view($view, $data);\n }", "function proceso4($testing,$desaprobar){\n //include($this->POROTO->ModelPath . '/alumnocarrera.php');\n //$claseAlumnoCarrera = new AlumnoCarreraModel($this->POROTO);\n include($this->POROTO->ModelPath . '/alumnomateria.php');\n include($this->POROTO->ControllerPath . '/correlativas.php');\n \n\t$db =& $this->POROTO->DB; \n\t$ses =& $this->POROTO->Session;\n\t$lib =& $this->POROTO->Libraries['siteLibrary'];\n\t\n $db->dbConnect(\"procesos/proceso4/\");\n\t$db->begintrans();\t\n $bOk=true;\n $cambios=array();\n \n\tif(!$ses->tienePermiso('','Proceso 4 - Proceso Actualizar/Desaprobar Condicionales')){\n $ses->setMessage(\"Acceso denegado. Contactese con el administrador.\", SessionMessageType::TransactionError);\n header(\"Location: /verprocesos\", TRUE, 302);\n exit();\n\t}\n\t \n if($testing==0){\n $cambios[]=\"EJECUCION Desaprobar:\".$desaprobar;\n }\n else\n {\n $cambios[]=\"SIMULACION Desaprobar:\".$desaprobar;\n }\n $cambios[]=\" \";\n \n $claseAlumnoMateria = new AlumnoMateriaModel($this->POROTO);\n $result=$claseAlumnoMateria->getAlumnoMateriaCondicionales();\n $claseCorrelativas = new correlativas($this->POROTO);\n \n $cambios[]=\"Listado de alumnos actualizar condicionalidades.\";\n \n foreach ($result as $alumnomateria) {\n //Obtengo las correlativas y si las cumple o no.\n $resultados=$claseCorrelativas->getCorrelativasAlumno($alumnomateria[\"idcarrera\"], $alumnomateria[\"idmateria\"], $alumnomateria[\"idcomision\"], $alumnomateria[\"idpersona\"],$alumnomateria[\"idalumnocarrera\"]);\n $valida=true;\n foreach($resultados as $regla){\n if ($regla[\"idregla\"]!=6 && $regla[\"estado\"]==false) $valida=false;\n }\n\n if($valida){//Si cumple con las correlativas, quito la condicionalidad\n if($testing==0){\n //Actualizar registro\n $res=$claseAlumnoMateria->quitarCondicionalidad($alumnomateria[\"idalumnomateria\"]); \n }\n $cambios[]=\"Alumno: \".$alumnomateria[\"idalumnomateria\"].\" \".$alumnomateria[\"alumno\"].\" \".$alumnomateria[\"documento\"].\" Carrera:\".$alumnomateria[\"idalumnocarrera\"].\" \".$alumnomateria[\"carrera\"].\" Materia:\".$alumnomateria[\"nombre\"].\" Quitar Condicionalidad\"; \n \n }else{\n //No quito la condicionalidad porque sigue condicional\n $cambios[]=\"Alumno: \".$alumnomateria[\"idalumnomateria\"].\" \".$alumnomateria[\"alumno\"].\" \".$alumnomateria[\"documento\"].\" Carrera:\".$alumnomateria[\"idalumnocarrera\"].\" \".$alumnomateria[\"carrera\"].\" Materia:\".$alumnomateria[\"nombre\"].\" Continua Cond.\";\n }\n }\n \n if($desaprobar==1 && $testing==0){\n $result=$claseAlumnoMateria->getAlumnoMateriaCondicionales(); \n $cambios[]=\"---\";\n $cambios[]=\"Listado de alumnos desaprobar condicionales.\";\n foreach ($result as $alumnomateria) {\n $claseAlumnoMateria->desaprobarCondicionales($alumnomateria[\"idalumnocarrera\"],$alumnomateria[\"idpersona\"],$alumnomateria[\"idalumnomateria\"],$this->POROTO->Config['estado_alumnomateria_desaprobada'],$ses->getUsuario(),0);\n $res=$claseAlumnoMateria->quitarCondicionalidad($alumnomateria[\"idalumnomateria\"]); \n $cambios[]=\"Alumno: \".$alumnomateria[\"idalumnomateria\"].\" \".$alumnomateria[\"alumno\"].\" \".$alumnomateria[\"documento\"].\" Carrera:\".$alumnomateria[\"idalumnocarrera\"].\" \".$alumnomateria[\"carrera\"].\" Materia:\".$alumnomateria[\"nombre\"].\" DESAPROBADA.\";\n }\n }\n\n \n\tif ($bOk === false) {\n\t\t$db->rollback();\n\t\t$ses->setMessage(\"Se produjo un error al ejecutar el proceso.<br>\", SessionMessageType::TransactionError);\n\t}\n\t else \n\t{\n if(count($cambios)>0){\n $log=$this->POROTO->TempPath.\"proceso4-log-\".date('Ymd').\"-\".date('Hi').\".txt\";\n $ruta=\"proceso4-log-\".date('Ymd').\"-\".date('Hi').\".txt\";\n for($i=0;$i<count($cambios);$i++){\n file_put_contents($log, $cambios[$i].\"\\n\", FILE_APPEND);\n }\n $ses->setMessage(\"Proceso ejecutado con éxito. <br> <a href='/procesos/downloadFile?file=\".$ruta.\"' >Ver log de acción</a><br>\", SessionMessageType::Success);\n }else{\n $ses->setMessage(\"Proceso ejecutado con éxito. <br> \", SessionMessageType::Success);\n }\n\t\t$db->commit();\n\t}\n\t\n\t$db->dbDisconnect();\n\theader(\"Location: /verprocesos\", TRUE, 302);\n }", "public function adjuntar_memo_tres_oc_nc()\r\n{\r\n$session_data=$this->session->userdata('datosuser');\r\n$data=array(\r\n'usuarioUsr'=>$session_data['usuarioUsr'],\r\n'nombreUsr'=>$session_data['nombreUsr'],\r\n'perfilUsr'=>$session_data['perfilUsr'],\r\n'regionUsr'=>$session_data['regionUsr'],\r\n'programaUsr'=>$session_data['programaUsr'],\r\n'componenteUsr'=>$session_data['componenteUsr'],\r\n'usuarios' => $this->persona_model->ver_usuarios()\r\n);\r\n\r\n$data['error']=\"\";\r\n\r\n$data['codigomemo']=$this->uri->segment(3);\r\n\r\n$this->load->view('header');\r\nif($data['perfilUsr']==4){\r\n$data['cant_noti']=$this->persona_model->count_noti_etapa_uno();\r\n$this->load->view('perfil/menu/menu-apoyo', $data);\r\n}\r\nelse if($data['perfilUsr']==7){\r\n$data['cant_cinco']=$this->persona_model->count_noti_etapa_cinco();\r\n$data['cant_noti']=$this->persona_model->count_noti_etapa_dos();\r\n$this->load->view('perfil/menu/menu-pnud', $data);\r\n}\r\nelse if($data['perfilUsr']==6){\r\n$data['cant_noti']=$this->persona_model->count_noti_etapa_tres();\r\n$this->load->view('perfil/menu/menu-region', $data);\r\n}\r\nelse if($data['perfilUsr']==5){\r\n$data['cant_noti']=$this->persona_model->count_noti_etapa_tres();\r\n$this->load->view('perfil/menu/menu-region', $data);\r\n}\r\nelse{\r\n$this->load->view('perfil/menu/menu-perfil', $data);\r\n}\r\n$this->load->view('perfil/pnud/cargar_oc_nc', $data);\r\n$this->load->view('footer');\r\n}", "function TablaDevolucionesProductos()\n {\n //Logo\n $this->Image(\"./assets/img/logo.png\" , 15 ,10, 55 , 17 , \"PNG\"); \n //Arial bold 15\n $this->SetFont('Courier','B',15);\n //Movernos a la derecha\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$dev = new Login();\n $dev = $dev->DevolucionesPorId();\n\t\n################################################# BLOQUE N° 1 ###################################################\t\n\n //Bloque de membrete principal\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 10, 190, 17, '1.5', '');\n\t\n\t//Bloque de membrete principal\n $this->SetFillColor(199);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(98, 12, 18, 12, '1.5', 'F');\n\t//Bloque de membrete principal\n $this->SetFillColor(199);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(98, 12, 18, 12, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',16);\n $this->SetXY(104, 14);\n $this->Cell(26, 5, 'D', 0 , 0);\n\t$this->SetFont('courier','B',8);\n $this->SetXY(98, 19);\n $this->Cell(20, 5, 'Devolución', 0 , 0);\n\t\n\t\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',10);\n $this->SetXY(135, 10);\n $this->Cell(20, 5, 'N° DEVOLUCIÓN ', 0 , 0);\n\t$this->SetFont('courier','B',8);\n $this->SetXY(165, 10);\n $this->Cell(20, 5,utf8_decode($dev[0]['coddevolucion']), 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 14);\n $this->Cell(20, 5, 'FECHA DEVOLUCIÓN ', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(165, 14);\n $this->Cell(20, 5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($dev[0]['fechadevolucion']))), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 18);\n $this->Cell(20, 5, 'FECHA EMISIÓN', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(165, 18);\n $this->Cell(20, 5,utf8_decode(date(\"d-m-Y h:i:s\")), 0 , 0);\n\t//Linea de membrete Nro 4\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 22);\n $this->Cell(20, 5, 'N° DE CAJA', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(165, 22);\n $this->Cell(20, 5,utf8_decode($dev[0]['nrocaja']), 0 , 0);\n\t\n\t\n################################################# BLOQUE N° 2 ###################################################\t\n\n\t//Bloque de datos de empresa\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 29, 190, 18, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(15, 30);\n $this->Cell(20, 5, 'DATOS DE LA EMPRESA ', 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 34);\n $this->Cell(20, 5, 'RAZÓN SOCIAL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(40, 34);\n $this->Cell(20, 5,utf8_decode($con[0]['nomempresa']), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',7);\n $this->SetXY(147, 34);\n $this->Cell(90, 5, 'RIF :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(156, 34);\n $this->Cell(90, 5,utf8_decode($con[0]['rifempresa']), 0 , 0);\n\t//Linea de membrete Nro 4\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 38);\n $this->Cell(20, 5, 'DIRECCIÓN :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(32, 38);\n $this->Cell(20, 5,utf8_decode($con[0]['direcempresa']), 0 , 0);\n\t//Linea de membrete Nro 5\n\t$this->SetFont('courier','B',7);\n $this->SetXY(140, 38);\n $this->Cell(20, 5, 'TELÉFONO :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(156, 38);\n $this->Cell(20, 5,utf8_decode($con[0]['tlfempresa']), 0 , 0);\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 42);\n $this->Cell(20, 5, 'GERENTE :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(30, 42);\n $this->Cell(20, 5,utf8_decode($con[0]['nomresponsable']), 0 , 0);\n\t//Linea de membrete Nro 7\n\t$this->SetFont('courier','B',7);\n $this->SetXY(94, 42);\n $this->Cell(20, 5, 'CÉDULA :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(108, 42);\n $this->Cell(20, 5,utf8_decode($con[0]['cedresponsable']), 0 , 0);\n\t//Linea de membrete Nro 8\n\t$this->SetFont('courier','B',7);\n $this->SetXY(130, 42);\n $this->Cell(20, 5, 'EMAIL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(142, 42);\n $this->Cell(20, 5,utf8_decode($con[0]['correoresponsable']), 0 , 0);\n\t\n################################################# BLOQUE N° 3 ###################################################\t\n\n\t//Bloque de datos de empresa\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 49, 190, 14, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(15, 50);\n $this->Cell(20, 5, 'DATOS DEL PROVEEDOR ', 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 54);\n $this->Cell(20, 5, 'RAZÓN SOCIAL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(36, 54);\n $this->Cell(20, 5,utf8_decode($dev[0]['nomproveedor']), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',7);\n $this->SetXY(100, 54);\n $this->Cell(70, 5, 'RIF :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(108, 54);\n $this->Cell(75, 5,utf8_decode($dev[0]['ritproveedor']), 0 , 0);\n\t//Linea de membrete Nro 4\n\t$this->SetFont('courier','B',7);\n $this->SetXY(130, 54);\n $this->Cell(90, 5, 'EMAIL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(142, 54);\n $this->Cell(90, 5,utf8_decode($dev[0]['emailproveedor']), 0 , 0);\n\t//Linea de membrete Nro 5\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 58);\n $this->Cell(20, 5, 'DIRECCIÓN :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(33, 58);\n $this->Cell(20, 5,utf8_decode($dev[0]['direcproveedor']), 0 , 0);\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',7);\n $this->SetXY(90, 58);\n $this->Cell(20, 5, 'TELÉFONO :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(108, 58);\n $this->Cell(20, 5,utf8_decode($dev[0]['tlfproveedor']), 0 , 0);\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',7);\n $this->SetXY(130, 58);\n $this->Cell(20, 5, 'CONTACTO :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(150, 58);\n $this->Cell(20, 5,utf8_decode($dev[0]['contactoproveedor']), 0 , 0);\n\t\n\t$this->Ln(7);\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(3, 3, 3); // Establece el color del texto (en este caso es Negro)\n $this->SetFillColor(229, 229, 229); // establece el color del fondo de la celda (en este caso es GRIS)\n\t$this->Cell(6,8,'N°',1,0,'C', True);\n\t$this->Cell(15,8,'CÓDIGO',1,0,'C', True);\n\t$this->Cell(50,8,'DESCRIPCIÓN DE PRODUCTO',1,0,'C', True);\n\t$this->Cell(29,8,'CATEGORIA',1,0,'C', True);\n\t$this->Cell(29,8,'PRECIO',1,0,'C', True);\n\t$this->Cell(16,8,'CANT',1,0,'C', True);\n\t$this->Cell(20,8,'LOTE',1,0,'C', True);\n\t//$this->Cell(20,8,'VENCE',1,0,'C', True);\n\t$this->Cell(25,8,'IMPORTE',1,1,'C', True);\n\t\n\t################################################# BLOQUE N° 4 DE DETALLES DE PRODUCTOS ###################################################\t\n\t//Bloque de datos de empresa\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 75, 190, 170, '1.5', '');\n\t\n\t$this->Ln(3);\n $tra = new Login();\n $reg = $tra->VerDetallesDevoluciones();\n\t$cantidad=0;\n\t$a=1;\n for($i=0;$i<sizeof($reg);$i++){\n\t$cantidad+=$reg[$i]['cantdevolucion'];\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(6,4,$a++,0,0,'C');\n\t$this->CellFitSpace(15,4,utf8_decode($reg[$i][\"codproducto\"]),0,0,'C');\n $this->CellFitSpace(50,4,utf8_decode($reg[$i][\"producto\"]),0,0,'C');\n $this->CellFitSpace(29,4,utf8_decode($reg[$i][\"nomcategoria\"]),0,0,'C');\n\t$this->CellFitSpace(29,4,utf8_decode(number_format($reg[$i][\"preciodevolucion\"], 2, '.', ',')),0,0,'C');\n\t$this->CellFitSpace(16,4,utf8_decode($reg[$i][\"cantdevolucion\"]),0,0,'C');\n\t$this->CellFitSpace(20,4,utf8_decode($reg[$i][\"lotedevolucion\"]),0,0,'C');\n\t//$this->CellFitSpace(20,4,utf8_decode($reg[$i][\"cantdevolucion\"]),0,0,'C');\n\t$this->CellFitSpace(25,4,utf8_decode(number_format($reg[$i][\"importe\"], 2, '.', ',')),0,0,'C');\n $this->Ln();\n }\n \n\t\n\n\n################################################# BLOQUE N° 5 DE TOTALES ###################################################\t\n\t//Bloque de Informacion adicional\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 250, 130, 25, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',12);\n $this->SetXY(46, 252);\n $this->Cell(20, 5, 'INFORMACIÓN ADICIONAL', 0 , 0);\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(12, 258);\n $this->Cell(20, 5, 'CANTIDAD DE PRODUCTOS :', 0 , 0);\n $this->SetXY(60, 258);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode($cantidad), 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',9);\n $this->SetXY(12, 262);\n $this->Cell(20, 5, 'TIPO DE DOCUMENTO :', 0 , 0);\n $this->SetXY(60, 262);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(\"FACTURA\"), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetXY(52, 33);\n\t$this->Codabar(13,267,utf8_decode(\"133923786899444489448576556789\"));\n\t//Linea de membrete Nro 2\n $this->SetFont('courier','B',7); \n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->SetXY(55, 268);\n $this->Cell(20, 5, 'Este documento no constituye un comprobante de pago.', 0 , 0);\n\t\n\t//Bloque de Totales de factura\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(142, 250, 58, 25, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(143, 254);\n $this->Cell(20, 5, 'SUB TOTAL :', 0 , 0);\n $this->SetXY(167, 254);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(number_format($dev[0][\"subtotald\"], 2, '.', ',')), 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',9);\n $this->SetXY(143, 258);\n $this->Cell(20, 5, 'IVA '.$dev[0][\"ivad\"].'% :', 0 , 0);\n $this->SetXY(167, 258);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(number_format($dev[0][\"totalivad\"], 2, '.', ',')), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',9);\n $this->SetXY(143, 262);\n $this->Cell(20, 5, 'DESC 0% :', 0 , 0);\n $this->SetXY(167, 262);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(\"0.00\"), 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',9);\n $this->SetXY(143, 266);\n $this->Cell(20, 5, 'TOTAL PAGO :', 0 , 0);\n $this->SetXY(167, 266);\n\t$this->SetFont('courier','',9);\n $this->Cell(20, 5,utf8_decode(number_format($dev[0][\"totald\"], 2, '.', ',')), 0 , 0);\n \n}", "function CuentaPedidosProntoAFacturar($CardCode){\n\t\t\n\t\t $Total_Pedido = 0;\n\t\t $NumPedido = 0;\n\t\t $FechaCreacion = 0;\n\t\t $FechaFin = 0;\n\t\t\t $Total = 0;\n\t\t\t $TotalGeneral = 0;\n\t\tif($this->con->conectar()==true){\n\t\t\t$Resultado = mysql_query(\"SELECT * FROM `PedidosProntosAFacturar` WHERE `CardCode` = '\" .$CardCode. \"'\");\n\t\t\tif($Resultado){\n\t\t\t\techo \"<table class='altrowstable' id='alternatecolor' align='center'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th>Num Pedido</th>\n\t\t\t\t\t\t\t\t<th>Fecha Creacion</th>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>Total</th>\n\t\t\t\t\t\t\t\t<th>Accion</th>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t while( $PedidoHecho = mysql_fetch_array($Resultado) )\n\t\t\t\t {\n\t\t\t\t\t\t //suma total pedido\n\t\t\t\t\t\t\t// $Total_Pedido = $Total_Pedido + ($PedidoHecho['Cantidad']*$PedidoHecho['Precio']);\n\t\t\t\t\t\t\n\t\t\t\t\t //respalda numero pedido\n\t\t\t\t\t if ($NumPedido != $PedidoHecho['NumPedido'])\n\t\t\t\t\t \t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t echo\"<tr>\n\t\t\t\t\t \t \t <td>\". $PedidoHecho['NumPedido'].\"</td>\n\t\t\t\t\t\t\t <td>\". $PedidoHecho['Fecha'].\"</td>\n\t\t\t\t\t\t\t <td>\". number_format($PedidoHecho['Total'], 2) .\"</td>\n\t\t\t\t\t\t\t <td>\n\t\t\t\t\t\t\t <a id='Actualizar' class='ClassBotones' href='javascript:VerDetallePedido(\\\"\".$CardCode.\"\\\",\\\"\". $PedidoHecho['NumPedido'].\"\\\");'>Ver Detalle</a>\n\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$TotalGeneral=$TotalGeneral+$PedidoHecho['Total'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$NumPedido = $PedidoHecho['NumPedido'];\n\t\t\t\t\t\t\t/* NOTAS SE DEBE HACER UA VARIABLE INDEPENDIENTE PARA CADA DATO YA QUE SI NO EL TOTAL DEL PEDIDO NO PODRA MOSTRARSE */\t\t\t\t\t\n\t\t\t\t\t //si el proximo pedido es diferente al actual\t\n\t\t\t\t\t //agarra la siguiente linea\n\t\t\t\t\t\t\t\n\t\t\t\t\t }//fin while\n\t\n\t\t\t\t/*echo\"<table class='altrowstable' id='alternatecolor'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th>Num Pedido</th>\n\t\t\t\t\t\t\t\t<th>Foto</th>\n\t\t\t\t\t\t\t\t<th>CodArticulo</th>\n\t\t\t\t\t\t\t\t<th>Descripcion</th>\n\t\t\t\t\t\t\t\t<th>Cantidad</th>\n\t\t\t\t\t\t\t\t<th>Precio</th>\n\t\t\t\t\t\t\t\t<th>Total</th>\t\n\t\t\t\t\t\t </tr>\";\n\t\t\t while( $PedidoHecho = mysql_fetch_array($Resultado) ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t echo\"<tr>\n\t\t\t\t\t \t\t <td>\". $PedidoHecho['NumPedido'].\"</td>\n\t\t\t\t\t <td>\";\n\t\t\t\t \t\t\t\tif (file_exists(\"../img/Articulos/\".trim($ItemCode).\".jpg\")) {\n \t\t\t\t\t\t \t\t\techo\" <img src='img/Articulos/$ItemCode.jpg' width='100' height='117'>\";\n\t\t\t\t\t\t\t\t\t} else {\n \t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo\"<img src='img/General/SinImagenDisponible.jpg' width='100' height='115'>\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\techo\"\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t <td>\". $PedidoHecho['CodArticulo'].\"</td>\n\t\t\t\t\t\t\t <td>\". $PedidoHecho['Descripcion'].\"</td>\n\t\t\t\t\t\t\t <td>\". $PedidoHecho['Cantidad'].\"</td>\n\t\t\t\t\t\t\t <td>\". number_format($PedidoHecho['Precio'], 2) .\"</td>\n\t\t\t\t\t\t\t <td>\". number_format(($PedidoHecho['Cantidad']*$PedidoHecho['Precio']), 2) . \"\\n\" .\"</td>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t\t\t $Total_Pedido = $Total_Pedido + ($PedidoHecho['Cantidad']*$PedidoHecho['Precio']);\n\t\t\t\t\t\t // $Total_Articulos = $Result[\"NumItems\"];\n\t\t\t\t\t \n\t\t\t }//FIN WHILE\n\t\t\t\t*/ echo \"<tr>\n\t\t\t\t\t\t<td colspan='2' align='center'>TOTAL</td>\n\t\t\t\t\t\t<td colspan='1' align='left'>\". number_format($TotalGeneral, 2).\"</td>\n\t\t\t\t\t </tr>\n\t\t\t </table>\";\n\t\t\t\n\t\t }\n\t\t\t }\n\t}", "public function cabecera_2020($com_id,$tp){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente = $this->model_componente->get_componente_pi($com_id); //// DATOS COMPONENTE\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']); /// DATOS FASE\n //$proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $proyecto = $this->model_proyecto->get_datos_proyecto_unidad($fase[0]['proy_id']);\n\n $tabla='';\n $tabla.='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" style=\"width:100%;\" align=\"center\">\n <tr>\n <td colspan=\"2\" style=\"width:100%; height: 1.2%; font-size: 14pt;\"><b>'.$this->session->userdata('entidad').'</b></td>\n </tr>\n <tr style=\"font-size: 8pt;\">\n <td style=\"width:10%; height: 1.2%\"><b>DIR. ADM.</b></td>\n <td style=\"width:90%;\">: '.strtoupper($proyecto[0]['dep_departamento']).'</td>\n </tr>\n <tr style=\"font-size: 8pt;\">\n <td style=\"width:10%; height: 1.2%\"><b>UNI. EJEC.</b></td>';\n if($tp==1){ // pdf\n $tabla.='<td style=\"width:90%;\">: '.strtoupper($proyecto[0]['dist_distrital']).'</td>';\n }\n else{ // excel\n $tabla.='<td style=\"width:90%;\">: '.mb_convert_encoding(strtoupper($proyecto[0]['dist_distrital']), 'cp1252', 'UTF-8').'</td>';\n }\n $tabla.='\n </tr>\n <tr style=\"font-size: 8pt;\">';\n if($this->gestion!=2020){\n $tabla.='<td style=\"height: 1.2%\"><b>';\n if($proyecto[0]['tp_id']==1){\n $tabla.='PROY. INV. ';\n }\n else{\n $tabla.='ACTIVIDAD ';\n }\n $tabla.='</b></td>';\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' - '.strtoupper($proyecto[0]['proy_nombre']).'</td>';\n }\n else{\n $tabla.='<td style=\"height: 1.2%\"><b>';\n if($proyecto[0]['tp_id']==1){\n $tabla.='PROY. INV. ';\n }\n else{\n $tabla.=''.$proyecto[0]['tipo_adm'].' ';\n }\n $tabla.='</b></td>';\n if($tp==1){ /// pdf\n if($proyecto[0]['tp_id']==1){\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' - '.strtoupper($proyecto[0]['proy_nombre']).'</td>';\n }\n else{\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' '.$proyecto[0]['tipo'].' - '.strtoupper($proyecto[0]['act_descripcion']).'-'.$proyecto[0]['abrev'].'</td>';\n }\n }\n else{ /// Excel\n if($proyecto[0]['tp_id']==1){\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' - '.mb_convert_encoding(strtoupper($proyecto[0]['proy_nombre']), 'cp1252', 'UTF-8').'</td>';\n }\n else{\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' '.$proyecto[0]['tipo'].' - '.mb_convert_encoding(strtoupper($proyecto[0]['act_descripcion']), 'cp1252', 'UTF-8').'-'.$proyecto[0]['abrev'].'</td>';\n }\n } \n }\n $tabla.='\n </tr>\n <tr style=\"font-size: 8pt;\">';\n if($this->gestion!=2020){\n $tabla.='<td style=\"height: 1.2%\"><b>';\n if($proyecto[0]['tp_id']==1){\n $tabla.='COMPONENTE ';\n }\n else{\n $tabla.='SUB ACTIVIDAD ';\n }\n $tabla.='</b></td>';\n }\n else{\n $tabla.='<td style=\"height: 1.2%\"><b>';\n if($proyecto[0]['tp_id']==1){\n $tabla.='COMPONENTE ';\n }\n else{\n $tabla.='SERVICIO ';\n }\n $tabla.='</b></td>';\n }\n if($tp==1){ // pdf\n $tabla.='<td>: '.strtoupper($componente[0]['com_componente']).'</td>';\n }\n else{ // excel\n $tabla.='<td>: '.mb_convert_encoding(strtoupper($componente[0]['com_componente']), 'cp1252', 'UTF-8').'</td>';\n }\n $tabla.='\n </tr>\n </table>';\n return $tabla;\n }", "function alta_entrada(){\n $e = new Entrada();\n\t\t$precio=$_POST['costo_unitario'];\n\t\t$producto_id=$_POST['cproductos_id'];\n $e->usuario_id = $GLOBALS['usuarioid'];\n $e->empresas_id = $GLOBALS['empresaid'];\n $related = $e->from_array($_POST);\n //if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n $f = new Pr_factura();\n $f->get_by_id($e->pr_facturas_id);\n $e->espacios_fisicos_id = $f->espacios_fisicos_id;\n $e->lote_id = $f->lote_id;\n $e->costo_total = ($e->cantidad * $e->costo_unitario);\n\t\t$e->existencia = $e->cantidad;\n $e->cproveedores_id = $f->cproveedores_id;\n $e->fecha = date(\"Y-m-d H:i:s\");\n if ($e->id == 0)\n unset($e->id);\n if ($e->save($related)) {\n echo $e->id;\n\t\t\t$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n } else\n echo 0;\n }", "public function carrinho(){\n\n $total = 0;\n $totalProdutos = 0;\n\n\n\n require_once ('cms/models/produto_class.php');\n\n $produtoClass = new produtoClass;\n // VERIFICAR SE EXISTE UMA SESSION\n\n if ($_SESSION) {\n\n if (isset($_SESSION['idUsuario'])) {\n $totalDados = count($_SESSION);\n @$dadosTotais = $totalDados - 2;\n\n // echo $dadosTotais;\n }else {\n $totalDados = count($_SESSION);\n @$dadosTotais = $totalDados - 2;\n\n // echo $dadosTotais;\n }\n\n\n\n //echo $dadosTotais;\n // SEPARA NOME DE QUANTIDADE OU VALORES\n\n echo \"<form class='' action='router.php?controller=produtos&modo=finalizarCompra' method='post'>\";\n foreach ($_SESSION as $nome => $quantidade) {\n\n if ($quantidade > 0) {\n\n if (substr($nome,0,9) == 'produtos_') {\n\n // echo (\"essas e a quantidade \".$quantidade.\"</br>\");\n // PEGA id DA SESSION\n $id = substr($nome,9,(strlen($nome) -9));\n\n\n\n //echo $id.\"</br>\";\n\n\n // MONTA O CARRINHO\n $produtoClass->idProduto = substr($nome,9,(strlen($nome) -9));\n $produtoClass->quantidade = $quantidade;\n $retorno = $produtoClass::selecionarPorId($produtoClass);\n // var_dump($retorno);\n\n $count=0;\n\n // $conta = 100;\n while ($count < count($retorno)) {\n\n //$conta = $conta - 1;\n\n //echo $conta;\n\n // echo \"</br> STRING </br>\";\n $subtotal =$retorno[$count]->quantidade * $retorno[$count]->preco;\n // echo ('nome: '.$retorno[$count]->nome. ' '.$retorno[$count]->quantidade.' x R$ '.number_format($retorno[$count]->preco ,2 ) .' = R$'. number_format($subtotal,2).'</br>');\n //var_dump($retorno);\n\n\n // validacao para Nao adicionar produtos zerados\n if ($retorno[$count]->quantidade <= 1) {\n $class='cursor';\n }else {\n $class='Novocursor';\n }\n\n // validacao de quantidade no estoque\n //echo $retorno[$count]->quantidadeProduto ;\n if ($retorno[$count]->quantidadeProduto <= $retorno[$count]->quantidade) {\n $class2='cursor';\n }else {\n $class2='Novocursor';\n }\n //\n // $counta=1;\n // while ($counta < $totalDados) {\n //\n // echo $counta;\n //\n // $counta+=1;\n // }\n\n\n echo (\n \"\n\n <div class='produtoItemDescricao'>\n <div class='descricaoProdutoPedido'>\n <div class='produtoDetalhes'>\n <div class='imgProdutodetalhe'>\n <img src=cms/\". $retorno[$count]->imagem .\" alt='produto'>\n </div>\n\n <div class='descricaoProdutoItem'>\n <div class='textoDescricaoProduto'>\n <p>\".$retorno[$count]->descricao.\"</p>\n </div>\n\n <div class='textoDescricaoDestribuidor'>\n <p>Produzido e entregue por: <span class='abrirModal'>Auto center</span> </p>\n </div>\n </div>\n\n\n\n\n </div>\n </div>\n\n <div class='descricaoProdutoPedidoPreco'>\n <div class='textoDescricaoPreco'>\n\n <p>R$ <span class='preco'>\".number_format($retorno[$count]->preco ,2 ).\"</span> </p>\n </div>\n </div>\n\n <div class='descricaoProdutoPedidoQuantidade'>\n <div class='textoDescricaoQuantidade'>\n\n <div class='QuantidadeProdutos'>\n <div class='del'>\n\n <a class='\".$class.\"' href='router.php?controller=produtos&modo=addCarrinho&menos=\".$id.\"'>-</a>\n\n </div>\n\n <div class='quantidadeTotal'>\n\n <p>\".$retorno[$count]->quantidade.\"</p>\n\n </div>\n\n <div class='add'>\n <a class='\".$class2.\"' href='router.php?controller=produtos&modo=addCarrinho&idProduto=\".$id.\"'>+</a>\n </div>\n </div>\n\n <a href='router.php?controller=produtos&modo=addCarrinho&del=\".$id.\"'>Remover</a>\n\n\n </div>\n </div>\n\n <div class='descricaoProdutoPedidoSubTotal'>\n <div class='textoDescricaoPreco'>\n <p>R$ <span class='preco'>\".number_format($subtotal,2).\"</span> </p>\n </div>\n </div>\n </div>\n\n <!-- passando dados para cadastrar no banco -->\n\n <input class='esconder' type='text' name='txtIdProduto\".(@$counta = $counta -1 ).\"' value='\".$id.\"'>\n <input class='esconder' type='text' name='txtQuantidade\".(@$counta2 = $counta2 -1 ).\"' value='\".$retorno[$count]->quantidade.\"'>\n\n\n\n \");\n\n //echo $count;\n\n $count+=1;\n\n $total +=$subtotal;\n\n $totalProdutos+=$quantidade;\n }\n\n\n }\n\n\n }\n\n // $count=0;\n // while ($count < count($retorno)) {\n // echo \"</br> STRING </br>\";\n // var_dump($retorno);\n // return $retorno;\n // $count+=1;\n // }\n\n\n // $quantidadeProdutos = count($_SESSION);\n //\n // $produtosQuantidade = $quantidadeProdutos-1;\n //\n // $cont = 0;\n // while ($produtosQuantidade > $cont) {\n // echo (\"produtos \".$cont);\n // $cont+=1;\n // }\n\n\n\n }\n } // aqui fecha o foreach\n\n\n\n\n if ($total == 0) {\n echo \"nao ha produtos\";\n }else{\n echo (\" <div class='TotalProdutos'>\n <div class='espaco'>\n <input class='esconder' type='text' name='txtDados' value='\".$dadosTotais.\"'>\n </div>\n\n <div class='espaco'>\n <div class='Totalgeral'>\n <div class='detalhesValores'>\n <p>Subtotal (\".$totalProdutos.\" itens):</p>\n </div>\n\n <div class='detalhesValores'>\n <p class='precoTotal'>R$ <span class='preco'>\".$total.\"</span> </p>\n </div>\n\n\n </div>\n\n <div class='Totalgeral'>\n <div class='detalhesValores'>\n <p>Frete:</p>\n </div>\n\n <div class='detalhesValores'>\n <div class='calculofrete'>\n <form class='' action='index.html' method='post'>\n <input class='txttCep' type='text' name='' value=''>\n </form>\n </div>\n </div>\n\n </div>\n\n\n <div class='Totalgeral'>\n <div class='detalhesValores'>\n <p>Total a pagar:</p>\n </div>\n\n <div class='detalhesValores'>\n <p class='precoTotal'>R$ <span class='preco'>\".$total.\"</span> </p>\n </div>\n\n\n </div>\n\n <div class='botaoEnviar'>\n <input class='botaoEnviar' type='submit' name='btnSalvarCarrinho' value='Finalizar Compra'>\n </div>\n\n\n\n </div>\n </div>\n\n </form>\");\n }\n\n $_SESSION['totalProdutos'] = $totalProdutos;\n\n\n //echo $_SESSION[$totalProdutos];\n\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->rh105_sequencial = ($this->rh105_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_sequencial\"]:$this->rh105_sequencial);\n if($this->rh105_dtgeracao == \"\"){\n $this->rh105_dtgeracao_dia = @$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_dtgeracao_dia\"];\n $this->rh105_dtgeracao_mes = @$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_dtgeracao_mes\"];\n $this->rh105_dtgeracao_ano = @$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_dtgeracao_ano\"];\n if($this->rh105_dtgeracao_dia != \"\"){\n $this->rh105_dtgeracao = $this->rh105_dtgeracao_ano.\"-\".$this->rh105_dtgeracao_mes.\"-\".$this->rh105_dtgeracao_dia;\n }\n }\n if($this->rh105_dtdeposito == \"\"){\n $this->rh105_dtdeposito_dia = @$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_dtdeposito_dia\"];\n $this->rh105_dtdeposito_mes = @$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_dtdeposito_mes\"];\n $this->rh105_dtdeposito_ano = @$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_dtdeposito_ano\"];\n if($this->rh105_dtdeposito_dia != \"\"){\n $this->rh105_dtdeposito = $this->rh105_dtdeposito_ano.\"-\".$this->rh105_dtdeposito_mes.\"-\".$this->rh105_dtdeposito_dia;\n }\n }\n $this->rh105_codarq = ($this->rh105_codarq == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_codarq\"]:$this->rh105_codarq);\n $this->rh105_codbcofebraban = ($this->rh105_codbcofebraban == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_codbcofebraban\"]:$this->rh105_codbcofebraban);\n $this->rh105_tipoarq = ($this->rh105_tipoarq == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_tipoarq\"]:$this->rh105_tipoarq);\n $this->rh105_folha = ($this->rh105_folha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_folha\"]:$this->rh105_folha);\n $this->rh105_arquivotxt = ($this->rh105_arquivotxt == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_arquivotxt\"]:$this->rh105_arquivotxt);\n $this->rh105_instit = ($this->rh105_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_instit\"]:$this->rh105_instit);\n }else{\n $this->rh105_sequencial = ($this->rh105_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"rh105_sequencial\"]:$this->rh105_sequencial);\n }\n }", "function reporte000()\n\t{\n\t\t\t//GROCERY CRUD SETUP\n\t\t\t\n\t\t\t\n\t\t\t// aca tomo la sede:\n\t\t\t$permiso_sede = $this->session->userdata('sede');\n\t\t\t$crud = new grocery_CRUD();\n\t\t\t$crud->set_table('entregas');\n\t\t\t$crud->set_language('spanish');\n\t\t\t$crud->where('entregas.id_sede',$permiso_sede);\n\t\t\t$crud->set_relation('id_equipo','equipos','codigo_equipo','id_sede= \"'.$this->session->userdata('sede_filtro').'\" and estado_equipo=\"'.$this->parametros_model->obtener_id_parametro(\"estado equipo\",\"deshabilitado\").'\"');\n\t\t\t$crud->columns('id_insumo','id_equipo','id_sector','nro_ticket','fecha_entrega','estado','observaciones','usuario_entrega');\n\t\t\t$crud->add_fields('id_sede','id_sector','estado','id_equipo','id_insumo','fecha_entrega','observaciones','nro_ticket','usuario_entrega', 'cantidad', 'contador');\n\t\t\t\n\t\t\t$crud->display_as('id_insumo','Insumo')\n\t\t\t\t ->display_as('id_equipo','Equipo')\n\t\t\t\t ->display_as('id_sector','Sector');\n\t\t\t$crud->set_subject('Entrega');\n\t\t\t\t\t//anulo todas las acciones salvo agregar para usar solo el crud definido en listar\n\t\t\t $crud->unset_list(); \n\t\t\t $crud->unset_delete();\n \t $crud->unset_read();\n $crud->unset_edit();\n $crud->unset_export();\n $crud->unset_print();\n\t\t\t\n\t\t\t$crud->set_relation('id_insumo','Insumos','codigo_insumo');\n\t\t\t\n\t\t\t//por algun no olcutaba el campo preguntando si el estado era add y era a causa del relation... y como la necestio en list y edit lo deje asi\n\n\t\t\tif ($crud->getState() != 'add') \n{\n\t $crud->set_relation('estado','parametros','valor','nombre_parametro=\"estado_entrega\"');\n\t \n\t\n}\n// idem estado pero con sector\n\t\t\tif (($crud->getState() != 'add') and ($crud->getState() != 'edit'))\n{\n\t \n\t $crud->set_relation('id_sector','sectores','nombre_sector');\n\t\n}\n\n\t\t\tif ($crud->getState() == 'add') \n{\n\n$crud->change_field_type('id_sector','invisible');\n$crud->change_field_type('estado','invisible');\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('cantidad','invisible');\n \n}\n\t\t\tif ($this->grocery_crud->getState() == 'edit') \n{\n/*$uri = $this->uri->segment(3);\n $this->session->set_userdata('insumo_actual', $uri);*/\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('id_sector','invisible');\n $crud->change_field_type('cantidad','invisible');\n \t\n \n}\n\t\t/* validaciones */\n\t\t\n\t\t$crud->set_rules('id_equipo', 'Equipo','trim|required');\n\t\t $crud->set_rules('id_insumo', 'id_insumo','trim|required|callback_insumo_check');\n\t\t//$crud->set_rules('observaciones', 'observaciones','trim|required');\n\t\t//$crud->set_rules('id_equipo','id_equipo','required');\n\t\t//$crud->set_rules('nro_ticket','nro_ticket','numeric');\n\t\t//$crud->set_rules('id_insumo', 'Insumo', 'callback_insumo_check');\n\t\t//$crud->required_fields('id_equipo','id_insumo');\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS\n\t\t\n\t\t $crud->callback_add_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_edit_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_after_insert(array($this, 'after_insert1'));\n\t\t\t\n\t\t\t$crud->callback_before_insert(array($this,'before_insert1')); \t\n\t\t\t$crud->callback_before_update(array($this,'before_update1'));\t\n\t\t\ttry {\n \n $output = $crud->render(); //this will raise an exception when the action is list\n\n //$this->template->load('template', 'default_view', $output);\n \n } catch (Exception $e) {\n\n if ($e->getCode() == 14) { //The 14 is the code of the error on grocery CRUD (don't have permission).\n //redirect using your user id\n redirect(strtolower(__CLASS__) . '/listar');\n \n } else {\n show_error($e->getMessage());\n return false;\n }\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t//DEPENDENT DROPDOWN SETUP\n\t\t\t$dd_data = array(\n\t\t\t\t//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD\n\t\t\t\t'dd_state' => $crud->getState(),\n\t\t\t\t//SETUP YOUR DROPDOWNS\n\t\t\t\t//Parent field item always listed first in array, in this case countryID\n\t\t\t\t//Child field items need to follow in order, e.g stateID then cityID\n\t\t\t\t'dd_dropdowns' => array('id_equipo','id_insumo'),\n\t\t\t\t//SETUP URL POST FOR EACH CHILD\n\t\t\t\t//List in order as per above\n\t\t\t\t'dd_url' => array('', site_url().'/entregas/get_states/'),\n\t\t\t\t//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS\n\t\t\t\t'dd_ajax_loader' => base_url().'ajax-loader.gif'\n\t\t\t);\n\t\t\t$output->dropdown_setup = $dd_data;\n\t\t\t$output->content_view='crud_content_view';\n\t\t\t$this->_example_output($output);\n\t}", "public function index()\n {\n\t\tif (!$this->session->userdata('id_usuario'))\n\t\t{\n\t\t\tredirect('/login/index');\n\t\t}\n\t\t\n\t\t$id_periodo_contable = -1;\n\t\t\n\t\tif ($this->session->userdata('periodo_especifico'))\n {\n $id_periodo_contable = $this->session->userdata('periodo_especifico');\n\t\t\t$this->session->unset_userdata('periodo_especifico');\n }\n\t\t\n\t\t\n // Parte 1: cargar toda la informacion del balance de comprobacion\n $balance_comprobacion = new BalanceComprobacion_model();\n\t\tif ($id_periodo_contable == -1)\n\t\t{\n\t\t\t$balance_comprobacion->cargar_informacion();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$balance_comprobacion->cargar_informacion($id_periodo_contable);\n\t\t}\n $balance_comprobacion->saldar_balance_comprobacion();\n $datos_a_desplegar = $balance_comprobacion->obtener_info_a_desplegar();\n \n $saldo_no_ajuste = $balance_comprobacion->obtener_saldo_no_ajuste();\n $saldo_ajuste = $balance_comprobacion->obtener_saldo_ajuste();\n $saldo_todo = $balance_comprobacion->obtener_saldo_todo();\n \n // Parte 2: cargar toda la informacion del estado de resultado\n $estado_resultado = new EstadoResultado_model();\n\t\tif ($id_periodo_contable == -1)\n\t\t{\n\t\t\t$estado_resultado->cargar_informacion();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$estado_resultado->cargar_informacion($id_periodo_contable);\n\t\t}\n $estado_resultado->saldar_estado_resultado();\n $datos_resultado_a_desplegar = $estado_resultado->obtener_info_a_desplegar();\n $saldo_estado_resultado = $estado_resultado->obtener_saldo();\n $estado_empresa = $estado_resultado->obtener_estado_empresa();\n $mensaje_estado = '';\n \n // Parte 3: cargar toda la informacion del estado de capital\n $estado_capital = new EstadoCapital_model();\n\t\tif ($id_periodo_contable == -1)\n\t\t{\n\t\t\t$estado_capital->cargar_informacion();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$estado_capital->cargar_informacion($id_periodo_contable);\n\t\t}\n $saldo_a_enviar = 0.0;\n if ($estado_empresa == 'ganancia')\n {\n $saldo_a_enviar = $saldo_estado_resultado[1];\n }\n else\n {\n $saldo_a_enviar = $saldo_estado_resultado[0];\n }\n $estado_capital->agregar_info_utilidades($saldo_a_enviar, $estado_empresa);\n $estado_capital->saldar_estado_capital();\n $datos_capital_a_desplegar = $estado_capital->obtener_info_a_desplegar();\n $saldo_estado_capital = $estado_capital->obtener_saldo();\n \n \n if ($estado_empresa == 'ganancia')\n {\n $mensaje_estado = 'La empresa presenta ganancias';\n }\n else\n {\n $mensaje_estado = 'La empresa presenta perdidas';\n }\n\t\t\n\t\t\n\t\t// Parte 4: cargar toda la infomacion de balance general\n\t\t$balance_general = new BalanceGeneral_model();\n\t\tif ($id_periodo_contable == -1)\n\t\t{\n\t\t\t$balance_general->cargar_informacion();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$balance_general->cargar_informacion($id_periodo_contable);\n\t\t}\n\t\t$balance_general->cargar_estado_capital($estado_capital->obtener_saldo());\n\t\t$balance_general->cargar_estado_resultado($estado_resultado->obtener_saldo());\n\t\t$balance_general->cargar_periodo_contable($estado_capital->obtener_periodo_contable());\n\t\t$balance_general->saldar_balance_general();\n\t\t$datos_balancegeneral_a_desplegar = $balance_general->obtener_info_a_desplegar();\n\t\t$saldo_balance_general = $balance_general->obtener_saldo();\n\t\t\n\t\t// guardamos en la sesion el balance general\n\t\t$this->session->set_userdata('balance_general', $balance_general);\n \n\t\t// Parte 5: obtener informacion extra del nuevo periodo contable\n\t\t$periodo_contable = $this->PeriodoContable_model->obtener_periodo_abierto();\n\t\t$fecha_nuevo_periodo = new DateTime($periodo_contable[0]['fecha_final']);\n\t\t$fecha_nuevo_periodo->modify('+1 day');\n\t\t\n\t\t\n\t\t$periodos = $this->PeriodoContable_model->obtener_lista_periodo_contable();\n\t\t\n \n\t\t\n $this->smarty->assign(array(\n 'base_url' => base_url(),\n 'datos_a_desplegar' => $datos_a_desplegar,\n 'saldo_debe_no_ajuste' => $saldo_no_ajuste[0],\n 'saldo_haber_no_ajuste' => $saldo_no_ajuste[1],\n 'saldo_debe_ajuste' => $saldo_ajuste[0],\n 'saldo_haber_ajuste' => $saldo_ajuste[1],\n 'saldo_debe_todo' => $saldo_todo[0],\n 'saldo_haber_todo' => $saldo_todo[1],\n 'datos_resultado_a_desplegar' => $datos_resultado_a_desplegar,\n 'saldo_debe_resultado' => $saldo_estado_resultado[0],\n 'saldo_haber_resultado' => $saldo_estado_resultado[1],\n 'mensaje_estado_empresa' => $mensaje_estado,\n 'datos_capital_a_desplegar' => $datos_capital_a_desplegar,\n 'saldo_debe_capital' => $saldo_estado_capital[0],\n 'saldo_haber_capital' => $saldo_estado_capital[1],\n\t\t\t'datos_balancegeneral_a_desplegar' => $datos_balancegeneral_a_desplegar,\n\t\t\t'saldo_debe_balance_general' => $saldo_balance_general[0],\n\t\t\t'saldo_haber_balance_general' => $saldo_balance_general[1],\n\t\t\t'fecha_nuevo_periodo' => $fecha_nuevo_periodo->format('d-m-Y'),\n\t\t\t'periodos' => $periodos\n ));\n \n $this->smarty->view('ver_estados_financieros.php');\n }", "public function facturar()\n {\n $detalle[0][\"cantidad\"] = 2;\n $detalle[0][\"unidadMedida\"] = \"UND\";\n $detalle[0][\"codigoProducto\"] = \"001-2011\";\n $detalle[0][\"descripcionProducto\"] = \"Prontuario Tributario\";\n $detalle[0][\"precioUnitario\"] = \"150\";\n $detalle[0][\"montoBruto\"] = \"300\";\n $detalle[0][\"montoDescuento\"] = \"0\";\n $detalle[0][\"importeNetoGravado\"] = \"336\";\n $detalle[0][\"detalleImpuestosIva\"] = \"36\";\n $detalle[0][\"importeExento\"] = \"0\";\n $detalle[0][\"otrosImpuestos\"] = \"0\";\n $detalle[0][\"importeOtrosImpuestos\"] = \"0\";\n $detalle[0][\"importeTotalOperacion\"] = \"336\";\n $detalle[0][\"tipoProducto\"] = \"S\";// B= BIEN, S= SERVICIO\n //-------------------------------------------------------------------------------------------------------\n $detalle[0][\"personalizado_01\"] = \"N/A\";\n $detalle[0][\"personalizado_02\"] = \"N/A\";\n $detalle[0][\"personalizado_03\"] = \"N/A\";\n $detalle[0][\"personalizado_04\"] = \"N/A\";\n $detalle[0][\"personalizado_05\"] = \"N/A\";\n $detalle[0][\"personalizado_06\"] = \"N/A\";\n //--------------------------------------- DETALLE DEL SEGUNDO PRODUCTO ----------------------------------\n $detalle[1][\"cantidad\"] = 1;\n $detalle[1][\"unidadMedida\"] = \"UND\";\n $detalle[1][\"codigoProducto\"] = \"002-2011\";\n $detalle[1][\"descripcionProducto\"] = \"Membresia 6 Meses \";\n $detalle[1][\"precioUnitario\"] = \"1750\";\n $detalle[1][\"montoBruto\"] = \"1750\";\n $detalle[1][\"montoDescuento\"] = \"0\";\n $detalle[1][\"importeNetoGravado\"] = \"1960\";\n $detalle[1][\"detalleImpuestosIva\"] = \"210\";\n $detalle[1][\"importeExento\"] = \"0\";\n $detalle[1][\"otrosImpuestos\"] = \"0\";\n $detalle[1][\"importeOtrosImpuestos\"] = \"0\";\n $detalle[1][\"importeTotalOperacion\"] = \"1960\";\n $detalle[1][\"tipoProducto\"] = \"B\";// B= BIEN, S= SERVICIO\n //-------------------------------------------------------------------------------------------------------\n $detalle[1][\"personalizado_01\"] = \"N/A\";\n $detalle[1][\"personalizado_02\"] = \"N/A\";\n $detalle[1][\"personalizado_03\"] = \"N/A\";\n $detalle[1][\"personalizado_04\"] = \"N/A\";\n $detalle[1][\"personalizado_05\"] = \"N/A\";\n $detalle[1][\"personalizado_06\"] = \"N/A\";\n\n try {\n\n $client = new SoapClient(\"https://www.ingface.net/listener/ingface?wsdl\", array(\"exceptions\" => 1));\n $resultado = $client->registrarDte(array(\"dte\" => array(\"usuario\" => \"GPAUTOS\",\n \"clave\" => \"A3C73DA00A0C49722CACA5AD7B80C6CDD41D8CD98F00B204E9800998ECF8427E\",\n \"validador\" => false,\n \"dte\" => array\n (\n \"codigoEstablecimiento\" => \"2\",\n \"idDispositivo\" => \"001\",\n \"serieAutorizada\" => \"FAC\",\n \"numeroResolucion\" => \"301620181114163\",\n \"fechaResolucion\" => \"2018-11-14\",\n \"tipoDocumento\" => \"FACE\",\n \"serieDocumento\" => \"63\",\n\n \"estadoDocumento\" => \"ACTIVO\",\n \"numeroDocumento\" => \"3\",\n \"fechaDocumento\" => \"2018-11-14\",\n \"codigoMoneda\" => \"GTQ\",\n \"tipoCambio\" => \"1\",\n \"nitComprador\" => str_replace(\"-\", \"\", \"5503407-1\"),\n \"nombreComercialComprador\" => \"CONSUMIDOR FELIZ\",\n \"direccionComercialComprador\" => \"CIUDAD\",\n \"telefonoComprador\" => \"22082208\",\n \"correoComprador\" => \"[email protected]\",\n \"regimen2989\" => false,\n \"departamentoComprador\" => \"N/A\",\n \"municipioComprador\" => \"N/A\",\n\n \"importeBruto\" => 200,\n \"importeDescuento\" => 0,\n \"importeTotalExento\" => 0,\n \"importeOtrosImpuestos\" => 0,\n \"importeNetoGravado\" => 224,\n \"detalleImpuestosIva\" => 24,\n \"montoTotalOperacion\" => 224,\n \"descripcionOtroImpuesto\" => \"N/A\",\n\n \"observaciones\" => \"N/A\",\n \"nitVendedor\" => str_replace(\"-\", \"\", \"136771-4\"),\n \"departamentoVendedor\" => \"GUATEMALA\",\n \"municipioVendedor\" => \"GUATEMALA\",\n \"direccionComercialVendedor\" => \"CIUDAD REFORMA\",\n \"NombreComercialRazonSocialVendedor\" => \"NOMBRE DELA EMPRESA, S.A\",\n \"nombreCompletoVendedor\" => \"NOMBRE DELA EMPRESA, S.A\",\n \"regimenISR\" => \"1\",\n\n \"personalizado_01\" => \"N/A\",\n \"personalizado_02\" => \"N/A\",\n \"personalizado_03\" => \"N/A\",\n \"personalizado_04\" => \"N/A\",\n \"personalizado_05\" => \"N/A\",\n \"personalizado_06\" => \"N/A\",\n \"personalizado_07\" => \"N/A\",\n \"personalizado_08\" => \"N/A\",\n \"personalizado_09\" => \"N/A\",\n \"personalizado_10\" => \"N/A\",\n \"personalizado_11\" => \"N/A\",\n \"personalizado_12\" => \"N/A\",\n \"personalizado_13\" => \"N/A\",\n \"personalizado_14\" => \"N/A\",\n \"personalizado_15\" => \"N/A\",\n \"personalizado_16\" => \"N/A\",\n \"personalizado_17\" => \"N/A\",\n \"personalizado_18\" => \"N/A\",\n \"personalizado_19\" => \"N/A\",\n \"personalizado_20\" => \"N/A\",\n\n \"detalleDte\" => $detalle\n )\n )\n )\n );\n\n if ($resultado->return->valido) {\n echo \"DTE: \" . $resultado->return->numeroDte . \"</br>\";\n echo \"CAE: \" . $resultado->return->cae . \"</br>\";\n } else {\n echo \"ERROR: \" . $resultado->return->descripcion;\n }\n } catch (SoapFault $E) {\n $objResponse->addAlert($E->faultstring);\n }\n }", "function index()\r\n {\r\n $data['sistema'] = $this->sistema;\r\n $this->parametros;\r\n \r\n if($this->acceso(24)){\r\n //**************** inicio contenido ***************\r\n $data['rolusuario'] = $this->session_data['rol'];\r\n $empresa_id = 1;\r\n $data['page_title'] = \"Inventario\";\r\n $data['empresa'] = $this->Empresa_model->get_empresa($empresa_id);\r\n $data['parametro'] = $this->parametros;\r\n $this->load->model('Moneda_model');\r\n $data['moneda'] = $this->Moneda_model->get_moneda(2); //Obtener moneda extragera\r\n $data['lamoneda'] = $this->Moneda_model->getalls_monedasact_asc();\r\n \r\n $data['almacenes'] = $this->Inventario_model->get_almacenes();\r\n \r\n //********************************************\r\n // SMART GRID\r\n //********************************************\r\n /*$this->load->library('SmartGrid/Smartgrid');\r\n // MySQL Query to get data \r\n $decimales = $this->parametros['parametro_decimales'];\r\n $decimales2 = 0;\r\n $sql = \"select \r\n i.producto_id, i.producto_nombre, i.producto_codigobarra, round(i.producto_costo,{$decimales}) as producto_costo, round(i.producto_precio,{$decimales}) as producto_precio, round(i.existencia,{$decimales}) as existencia,\r\n round(s.suc1,{$decimales2}) as suc1, round(s.suc2,{$decimales2}) as suc2, round(s.suc3,{$decimales2}) as suc3, s.suc4, s.suc5, s.suc6, s.suc7, s.suc8, s.suc9, s.suc10\r\n \r\n from inventario i, inventario_sucursales s where i.producto_id = s.producto_id\";\r\n// $sql = \"select * from producto order by producto_nombre\"; \r\n \r\n $config = array(\"page_size\"=> 500000, //cantidad de registros a visualizar\r\n \"toolbar_position\"=> 'top',\r\n \"paging_enabled\"=> true\r\n );\r\n \r\n $raiz = base_url(\"producto/edit/\");\r\n \r\n $buttons_html = '<div class=\"btn-group\" role=\"group\" aria-label=\"\"><a href=\"'.$raiz.'{producto_id}\" class=\"btn btn-default btn-xs\" value=\"{producto_id}\" target=\"blank_\"><fa class=\"fa fa-computer\"></fa> View</a><button type=\"button\" class=\"btn btn-success btn-xs\" value=\"{field_name}\">Edit</button> <button type=\"button\" class=\"btn btn-danger btn-xs\" value=\"{field_name}\">Delete</button></div>';\r\n // Column settings\r\n\r\n $lamoneda = \"Bs\";\r\n $columns = array(\r\n \r\n \"producto_id\"=>array(\"header\"=>\"#\", \"type\"=>\"label\"),\r\n \"producto_codigobarra\"=>array(\"header\"=>\"Código\", \"type\"=>\"label\"),\r\n \"producto_nombre\"=>array(\"header\"=>\"Descripción\", \"type\"=>\"label\"),\r\n //\"categoria_nombre\"=>array(\"header\"=>\"Categoria\", \"type\"=>\"label\"),\r\n //\"producto_unidad\"=>array(\"header\"=>\"Unidad\", \"type\"=>\"label\"),\r\n \"producto_costo\"=>array(\"header\"=>\"P. Compra \".$lamoneda, \"type\"=>\"label\"),\r\n \"producto_precio\"=>array(\"header\"=>\"P. Venta \".$lamoneda, \"type\"=>\"label\"),\r\n \"suc1\"=>array(\"header\"=>\"Suc 1\".$lamoneda, \"type\"=>\"label\"),\r\n \"suc2\"=>array(\"header\"=>\"Suc 2\".$lamoneda, \"type\"=>\"label\"),\r\n \"suc3\"=>array(\"header\"=>\"Suc 3\".$lamoneda, \"type\"=>\"label\"),\r\n \"suc3\"=>array(\"header\"=>\"Suc 3\".$lamoneda, \"type\"=>\"label\"),\r\n \"suc4\"=>array(\"header\"=>\"Suc 4\".$lamoneda, \"type\"=>\"label\"),\r\n \"suc5\"=>array(\"header\"=>\"Suc 5\".$lamoneda, \"type\"=>\"label\"),\r\n \r\n \r\n ); \r\n\r\n // Set the grid \r\n $this->smartgrid->set_grid($sql, $columns, $config);\r\n\r\n // Render the grid and assign to data array, so it can be print to on the view\r\n $data['grid_html'] = $this->smartgrid->render_grid(); \r\n */\r\n //*************** FIN SMARTGRID*************** \r\n //******************************************** \r\n \r\n $data['_view'] = 'inventario_sucursal/index';\r\n $this->load->view('layouts/main',$data);\r\n\r\n //**************** fin contenido ***************\r\n }\r\n\t\t\t\r\n }", "function autorizar_venta_directa($id_movimiento_material) {\r\n global $_ses_user,$db; \r\n\r\n \r\n $titulo_pagina = \"Movimiento de Material\";\r\n $fecha_hoy = date(\"Y-m-d H:i:s\",mktime());\r\n \r\n \r\n $sql = \"select deposito_origen from movimiento_material \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $res = sql($sql) or fin_pagina();\r\n $deposito_origen = $res->fields[\"deposito_origen\"];\r\n \r\n \r\n $sql = \"select id_factura from movimiento_factura where id_movimiento_material = $id_movimiento_material\";\r\n $fact = sql($sql) or fin_pagina(); \r\n $id_factura = $fact->fields[\"id_factura\"];\r\n \r\n $sql = \" select id_detalle_movimiento,cantidad,id_prod_esp from detalle_movimiento \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $detalle_mov = sql($sql) or fin_pagina();\r\n \r\n for($i=0; $i < $detalle_mov->recordcount(); $i++) { \t \r\n \t\r\n \t $id_detalle_movimiento = $detalle_mov->fields[\"id_detalle_movimiento\"];\t\r\n \t $cantidad = $detalle_mov->fields[\"cantidad\"];\r\n \t $id_prod_esp = $detalle_mov->fields[\"id_prod_esp\"];\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n //eliminamos las reservas hechas para este movimiento\r\n $comentario_stock=\"Utilización de los productos reservados por el $titulo_pagina Nº $id_movimiento\";\r\n $id_tipo_movimiento=7;\r\n \r\n \r\n //tengo que eliminar del stock los productos correspondientes \r\n descontar_reserva($id_prod_esp,$cantidad,$deposito_origen,$comentario_stock,$id_tipo_movimiento,$id_fila=\"\",$id_detalle_movimiento);\r\n //pongo las banderas de la factura en cuenta asi se produce\r\n //el movimiento correcto en el balance\r\n $detalle_mov->movenext(); \r\n }//del for \r\n \r\n if ($id_factura) {\r\n \r\n $sql = \"update licitaciones.cobranzas \r\n set renglones_entregados=1, licitacion_entregada=1\r\n where cobranzas.id_factura=$id_factura\";\r\n sql($sql) or fin_pagina();\r\n } \r\n \r\n \r\n \r\n\r\n}", "static public function ctrInsertOportunidad(){\n\n if(isset($_POST[\"opoEmpleado\"])){\n if(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"opofolio\"]) &&\n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ., ]+$/', $_POST[\"nuevoEmpresa\"]) && \n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ., ]+$/', $_POST[\"opoServicio\"]) &&\n preg_match('/^[0-9., ]+$/', $_POST[\"opoCantidad\"]) &&\n preg_match('/^[0-9., ]+$/', $_POST[\"opoImporte\"])){\n $tabla = \"oportunidad\";\n $datos = array(\n \"codigo\" => $_POST[\"opofolio\"],\n \"idUsuario\" => $_POST[\"opoEmpleado\"],\n \"idCliente\" => $_POST[\"opoCliente\"],\n \"empresa\" => $_POST[\"nuevoEmpresa\"],\n \"servicio\" => $_POST[\"opoServicio\"],\n \"idPieza\" => $_POST[\"opoModelo\"],\n \"cantidad\" => $_POST[\"opoCantidad\"],\n \"importe\" => $_POST[\"opoImporte\"],\n \"idPorcentaje\" => $_POST[\"opoEtapa\"],\n \"idAccion\" => $_POST[\"opoAccion\"],\n \"descripcion\" => $_POST[\"opoDescripcion\"],\n );\n\n $respuestas = ModeloOportunidad::mdlInsertOportunidad($tabla,$datos);\n\n \n if($respuestas == \"ok\"){\n \n echo '<script>\n localStorage.removeItem(\"folio\");\n localStorage.removeItem(\"Idempleado\");\n localStorage.removeItem(\"empleado\");\n\t\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"success\",\n\t\t\t\t\t\ttitle: \"¡la oportunidad ha sido guardado correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\twindow.location = \"oportunidad\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n \n }\n\n }else{\n \n echo '<script>\n\n\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"error\",\n\t\t\t\t\t\ttitle: \"¡Los datos ingresados no pueden ir vacíos o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\twindow.location = \"oportunidad\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t</script>';\n \n }\n\n }\n }", "function save() {\r\n $exp_id = $_REQUEST [\"exp_id\"];\r\n $tra_id = $_REQUEST [\"tra_id\"];\r\n $cue_id = $_REQUEST [\"cue_id\"];\r\n \r\n //$ver_id = $_SESSION ['VER_ID'];\r\n //$ser_id = 0;\r\n $usu_id = 0;\r\n $trc_id = 0;\r\n $exc_id = 0;\r\n $con_id = 0;\r\n $this->expediente = new tab_expediente ();\r\n $sql = \"SELECT * \r\n FROM tab_expediente \r\n WHERE exp_estado = 1 \r\n AND exp_id='$exp_id' \";\r\n $rows = $this->expediente->dbselectBySQL($sql);\r\n\r\n if (count($rows) == 1) {\r\n $ser_id = $rows [0]->getSer_id();\r\n }\r\n\r\n//\t\t$this->expunidad = new tab_expunidad ();\r\n//\t\t$rows_euv = $this->expunidad->dbselectBySQL ( \"select * from tab_expunidad where euv_estado = 1\r\n//\t\t\t\t\t\tand exp_id='\" . $exp_id . \"' \" );\r\n//\t\tif (count ( $rows_euv ) >= 1) {\r\n//\t\t\t$euv_id = $rows_euv [0]->getEuv_id ();\r\n//\t\t\t$uni_id = $rows_euv [0]->getUni_id ();\r\n//\t\t}\r\n\r\n $expusuario = new Tab_expusuario ();\r\n $sql = \"SELECT *\r\n FROM tab_expusuario\r\n WHERE eus_estado = 1\r\n\t\tand exp_id='\" . $exp_id . \"' \";\r\n $rows_eus = $expusuario->dbselectBySQL($sql);\r\n if (count($rows_eus) >= 1) {\r\n $usu_id = $rows_eus [0]->getUsu_id();\r\n }\r\n\r\n $this->tramitecuerpos = new tab_tramitecuerpos ();\r\n $sql = \"select *\r\n from tab_tramitecuerpos\r\n where tra_id=\" . $tra_id . \"\r\n and cue_id=\" . $cue_id . \" \";\r\n $rows = $this->tramitecuerpos->dbselectBySQL($sql);\r\n if (count($rows) >= 1) {\r\n $trc_id = $rows [0]->getTrc_id();\r\n }\r\n //print \"ser_id: \".$ser_id.\"<br>\".\"euv_id: \".$euv_id.\"<br>\".\"uni_id: \".$uni_id.\"<br>usu_id: \".$usu_id.\"<br>trc_id: \".$trc_id;die();\r\n\r\n\r\n // Save Tab_archivo\r\n $fil_id = $this->saveArchivo();\r\n\r\n \r\n \r\n // Save Tab_archivo_digital\r\n ///////////////Aumentado por freddy///////////////////////////////////////////////////////////////////////////////////////////\r\n //$seccion = VAR3;\r\n $arc = new archivo ();\r\n $tarchivo = new tab_archivo ();\r\n //\r\n $archivo_digital = new tab_archivo_digital();\r\n //\r\n $tarchivo->setRequest2Object($_REQUEST);\r\n //$exp_id = $_REQUEST ['exp_id'];\r\n //$fil_id = $_REQUEST ['fil_id'];\r\n $sql = \"SELECT *\r\n FROM tab_archivo\r\n WHERE fil_id = '$fil_id' \";\r\n $rows = $tarchivo->dbselectBySQL($sql);\r\n //$tarch = $rows [0];\r\n\r\n $archivo_type = $_FILES [\"archivo\"] [\"type\"];\r\n $archivo = $_FILES [\"archivo\"] [\"tmp_name\"];\r\n $archivo_size = $_FILES [\"archivo\"] [\"size\"];\r\n $archivo_name = $_FILES [\"archivo\"] [\"name\"];\r\n $nombre = basename($_FILES[\"archivo\"][\"name\"]);\r\n $nombreFichero = $_FILES [\"archivo\"] [\"name\"];\r\n\r\n $archivo_name_array = explode(\".\", $archivo_name);\r\n $archivo_ext = array_pop($archivo_name_array);\r\n $archivo_sin_ext = implode($archivo_name_array);\r\n //$archivo_name = $arc->generarNombre($archivo_sin_ext);\r\n //$archivo_name = \"\";\r\n $archivo_cifrado = md5($archivo_name);\r\n $sis_tammax = 0;\r\n\r\n \r\n // Data Parameters\r\n $nombreDirectorio = \"\";\r\n $tsistema = new tab_sistema ();\r\n $sql = \"SELECT *\r\n FROM tab_sistema\";\r\n $rows2 = $tsistema->dbselectBySQL($sql);\r\n if (count($rows2) >= 1) {\r\n $sis_tipcarga = $rows2 [0]->sis_tipcarga;\r\n $sis_tammax = $rows2 [0]->sis_tammax;\r\n $nombreDirectorio = $rows2 [0]->sis_ruta;\r\n }\r\n\r\n\r\n // Verify size\r\n if ($archivo_size > $sis_tammax) {\r\n echo \"El tamaño del archivo supera el permitido\";\r\n } else {\r\n\r\n /* * *************************************************** */\r\n /* TYPE SAVE BD */\r\n /* * *************************************************** */\r\n $sis_tipcarga = 1;\r\n\r\n if ($sis_tipcarga == 1) {\r\n // SERVER\r\n $error = false;\r\n $copiarFichero = false;\r\n if (is_uploaded_file($_FILES['archivo']['tmp_name'])) {\r\n //$nombreDirectorio = \"img/\";\r\n $nombreFichero = $_FILES['archivo']['name'];\r\n $copiarFichero = true;\r\n $nombreCompleto = $nombreDirectorio . $nombreFichero;\r\n if (is_file($nombreCompleto)) {\r\n $idUnico = time();\r\n $nombreFichero = $idUnico . \"-\" . $nombreFichero;\r\n }\r\n } else if ($_FILES['archivo']['error'] == UPLOAD_ERR_FORM_SIZE) {\r\n $maxsize = $_REQUEST['MAX_FILE_SIZE'];\r\n $errores[\"archivo\"] = \"El tamanio del fichero supera el limite permitido ($maxsize bytes)!\";\r\n $error = true;\r\n } else if ($_FILES['archivo']['name'] == \"\")\r\n $nombreFichero = '';\r\n else {\r\n $errores[\"archivo\"] = \"No se ha podido subir el fichero!\";\r\n $msm_guardado_archivo = 0;\r\n $error = true;\r\n }\r\n if ($error == false) {\r\n $link = $archivo_digital->connect();\r\n pg_query($link, \"begin\");\r\n $sql = \"INSERT INTO tab_archivo_digital(fil_id, \r\n fil_nomoriginal, \r\n fil_nomcifrado, \r\n fil_tipo, \r\n fil_tamano, \r\n fil_extension, \r\n nombre, \r\n mime, \r\n size, \r\n archivo, \r\n fil_estado) \r\n VALUES ($fil_id, \r\n '$nombreFichero', \r\n '$archivo_cifrado', \r\n '$archivo_type',\r\n '$archivo_size' , \r\n '$archivo_ext' ,\r\n '$nombre', \r\n '$archivo_type', \r\n $archivo_size, \r\n '$nombreFichero', \r\n 1)\";\r\n pg_query($link, $sql) or die(pg_last_error($link));\r\n pg_query($link, \"commit\");\r\n if ($copiarFichero)\r\n move_uploaded_file($_FILES['archivo']['tmp_name'], $nombreDirectorio . $nombreFichero);\r\n $msm_guardado_archivo = 1; \r\n \r\n }\r\n }\r\n else {\r\n // BD\r\n $link = $archivo_digital->connect();\r\n $fp = fopen($archivo, \"rb\");\r\n $contenido = fread($fp, filesize($archivo));\r\n fclose($fp);\r\n pg_query($link, \"begin\");\r\n $oid = pg_lo_create($link);\r\n $sql = \"INSERT INTO tab_archivo_digital(fil_id, \r\n fil_nomoriginal, \r\n fil_nomcifrado, \r\n fil_tipo, \r\n fil_tamano, \r\n fil_extension, \r\n nombre, \r\n archivo_oid, \r\n mime, \r\n size, \r\n archivo) \r\n VALUES ($fil_id, \r\n '$archivo_name', \r\n '$archivo_cifrado', \r\n '$archivo_type',\r\n '$archivo_size', \r\n '$archivo_ext', \r\n '$nombre', \r\n $oid, \r\n '$archivo_type', \r\n $archivo_size, \r\n '$nombreFichero')\";\r\n pg_query($link, $sql) or die(pg_last_error($link));\r\n $blob = pg_lo_open($link, $oid, \"w\");\r\n pg_lo_write($blob, $contenido);\r\n pg_lo_close($blob);\r\n pg_query($link, \"commit\");\r\n $msm_guardado_archivo = 1; \r\n\r\n }\r\n\r\n //Guardar palabra clave\r\n if (!empty($_REQUEST['fil_descripcion'])) {\r\n $this->palclave = new tab_palclave();\r\n $pac_nombre = trim($_REQUEST['fil_descripcion']);\r\n $array = explode(SEPARATOR_SEARCH, $pac_nombre);\r\n for($j=0;$j<count($array);$j++){\r\n $sql = \"select pac_id from tab_palclave where pac_estado = 1 AND fil_id='$fil_id' AND pac_nombre='\" . $array[$j] . \"'\";\r\n $row = $this->palclave->dbSelectBySQL($sql);\r\n if (count($row) == 0) {\r\n $this->palclave->setFil_id($fil_id);\r\n $this->palclave->setPac_nombre(strtoupper(trim($array[$j])));\r\n $this->palclave->setPac_formulario('Documento');\r\n $this->palclave->setPac_estado(1);\r\n $this->palclave->insert();\r\n }\r\n } \r\n }\r\n\r\n\r\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\n if ($ser_id != 0 && $usu_id != 0 && $trc_id != 0) {\r\n\r\n if (isset($_REQUEST [\"con_id\"]) && $_REQUEST [\"con_id\"] != \"\") {\r\n $con_id = $_REQUEST [\"con_id\"];\r\n $suc_id = $_REQUEST [\"suc_id\"];\r\n $expcontenedor = new tab_expcontenedor ();\r\n $row_exc = $expcontenedor->dbselectBy3Field(\"suc_id\", $suc_id, \"exc_estado\", \"1\", \"exp_id\", $exp_id);\r\n\r\n if (count($row_exc) == 0) {\r\n $exc_id = $this->saveContenedor($exp_id, $suc_id);\r\n } else {\r\n $exc_id = $row_exc [0]->exc_id;\r\n }\r\n }\r\n \r\n \r\n $this->saveExpArchivo($fil_id, $exp_id, $tra_id, $cue_id);\r\n if ($_REQUEST ['accion'] == 'cargar') {\r\n header(\"location:\" . PATH_DOMAIN . \"/estrucDocumental/viewTree/\" . $exp_id . \"/\" . $msm_guardado_archivo . \"/$cue_id/\");\r\n } else {\r\n if ($_REQUEST ['accion'] == 'cargarnuevo') {\r\n $this->addArchivo2(\"estrucDocumental\");\r\n }else{\r\n Header(\"Location: \" . PATH_DOMAIN . \"/archivo/digitalizar/$exp_id/$fil_id/\" . VAR3 . \"/\");\r\n }\r\n }\r\n } else {\r\n header(\"location:\" . PATH_DOMAIN . \"/estrucDocumental/viewTree/\" . $exp_id . \"/\" . $msm_guardado_archivo . \"/$cue_id/\");\r\n }\r\n }\r\n \r\n \r\n \r\n }", "public function registrarMantenimientosController($datosAjax){\n\n\t\t\tif (isset($datosAjax[\"idMantenimiento\"])) {\n\n\t\t\t\t$datosController = array(\"idMantenimiento\"=>$datosAjax[\"idMantenimiento\"]);\n\n\t\t\t\t$respuesta = GestorMantenimientosModel::registrarMantenimientosModel($datosController, 'categoria', 'mantenimiento', 'temporal_mantenimientos');\n\n\n\t\t\t\techo '\n\t\t\t\t\t<table class=\"table datatable-basic table-bordered table-striped table-hover text-center\">\n\t\t\t\t\t\t<thead class=\"success tabla-header\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th>Categoria</th>\n\t\t\t\t\t\t\t\t<th>Mantenimiento</th>\n\t\t\t\t\t\t\t\t<th>Costo</th>\n\t\t\t\t\t\t\t\t<th>Eliminar</th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t';\n\n\t\t\t\t$subtototal = 0;\n\t\t\t\t$iva = 0.12;\n\t\t\t\t$totalIva = 0;\n\t\t\t\t$total = 0;\n\n\t\t\t\tforeach ($respuesta as $row => $item) {\n\t\t\t\t\t\n\t\t\t\t\techo '\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td >' . $item[\"nombre_categoria\"] . '</td>\n\t\t\t\t\t\t\t<td >' . $item[\"descripcion_mantenimiento\"] . '</td>\n\t\t\t\t\t\t\t<td >' . $item[\"costo_tmp_mantenimiento\"] . '</td>\n\t\t\t\t\t\t\t<td class=\"text-center\">\n\t\t\t\t\t\t\t<button type=\"button\" onclick=\"eliminarMantenimiento(\\'' . $item[\"id_temporal\"] . '\\')\"><span class=\"fa fa-trash-o\"></span></button></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t';\n\t\t\t\t\t$costoMantenimiento = $item[\"costo_tmp_mantenimiento\"];\n\t\t\t\t\t$costoMantenimientoF = number_format($costoMantenimiento,2); # Formateo de variables\n\t\t\t\t\t$costoMantenimientoR = str_replace(\",\", \"\", $costoMantenimientoF); #Reemplazo de las comas\n\t\t\t\t\t$subtototal += $costoMantenimientoR;\n\n\t\t\t\t}\n\n\t\t\t\techo '\n\t\t\t\t\t\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\n\t\t\t\t';\n\n\t\t\t\techo '<div class=\"row\">';\n\n\t\t\t\t\techo '<div class=\"col-md-8 col-sm-6 col-xs-12 titulo-total\">\n\t\t\t\t\t\t\t<h4>Total a Pagar</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t';\n\n\t\t\t\t\t\t\n\n\t\t\t\t\techo '<div class=\"col-md-4 col-sm-6 col-xs-12 seccion-total\">';\n\n\t\t\t\t\t\t$totalIva = $subtototal * $iva;\n\t\t\t\t\t\t$total = $subtototal + $totalIva;\n\t\t\t\t\t\techo '<label>Subtotal </label> <label>' . ' $ ' . number_format($subtototal, 2) . '</label><br>';\n\t\t\t\t\t\techo '<label>IVA </label> <label>' . ' $ ' . number_format($totalIva, 2) .'</label><br>';\n\t\t\t\t\t\techo '<label>Total </label> <label>' . ' $ ' . number_format($total, 2) .'</label>';\n\n\t\t\t\t\techo '</div>';\n\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<hr>';\n\n\t\t\t}\n\n\t\t}", "public function reporte_poa_2020($com_id){\n $data['componente'] = $this->model_componente->get_componente_pi($com_id); //// DATOS COMPONENTE\n $data['mes'] = $this->mes_nombre();\n $data['fase']=$this->model_faseetapa->get_fase($data['componente'][0]['pfec_id']); /// DATOS FASE\n $data['proyecto'] = $this->model_proyecto->get_id_proyecto($data['fase'][0]['proy_id']); //// DATOS PROYECTO\n\n $data['cabecera']=$this->cabecera_2020($com_id,1); /// Cabecera\n if($this->gestion==2019){ /// GESTION 2019\n if($data['proyecto'][0]['tp_id']==1){\n $data['operaciones']=$this->componente_operacion_pi_nuevo($com_id);\n }\n else{\n $data['operaciones']=$this->componente_operacion_nuevo($com_id);\n }\n \n $this->load->view('admin/programacion/producto/reporte_productos', $data);\n }\n else{ /// Para la gestion 2020\n if($data['proyecto'][0]['tp_id']==4){\n $data['proyecto'] = $this->model_proyecto->get_datos_proyecto_unidad($data['fase'][0]['proy_id']);\n }\n\n $data['operaciones']=$this->componente_operaciones($com_id); /// Reporte Gasto Corriente, Proyecto de Inversion 2020\n $this->load->view('admin/programacion/producto/reporte_productos2020', $data);\n }\n }", "function index()\r\n {\r\n if (!$this->session->userdata('aprobado')) {redirect ('acceso', 'refresh'); exit();}\r\n \r\n // VERIFICACIÓN DE PERMISOS NECESARIOS PARA ACCESAR EL CONTROLADOR:\r\n // * EL USUARIO DEBE TENER NIVEL SUPERIOR A COORDINADOR id_nivel=<4\r\n if (!($this->session->userdata('administrador') || $this->session->userdata('id_nivel')<5)) exit('Sin Acceso al Script');\r\n\r\n // RECUPERA LA FECHA Y HORA DEL SISTEMA\r\n date_default_timezone_set('America/Caracas'); // Establece la Hora de Venezuela para funciones de fecha y hora \r\n $ahora= getdate(time());\r\n $yearmax=$ahora['year']+1; // El año máximo del POA es el año siguiente al año en curso\r\n $yearpoa=$this->session->userdata('yearpoa');\r\n \r\n $data=array();\r\n $data['titulo']='Resúmen de la Planificación Operativa';\r\n $data['subtitulo']='Planificación Operativa del Año:';\r\n $data['year_poa']= array( \r\n 'name' => 'year_poa',\r\n 'id' => 'year_poa',\r\n 'class'=>'Titulos',\r\n 'value' => $yearpoa,\r\n 'maxlength' => '4',\r\n 'title'=>'Año del POA',\r\n 'readonly'=>'readonly',\r\n 'size' => 4);\r\n $data['flecha_sum']= array(\r\n 'src' => base_url().'imagenes/forward_enabled.png',\r\n 'alt' => 'Adelante',\r\n 'class' => 'BotonIco',\r\n 'width' => '',\r\n 'height' => '',\r\n 'title' => 'Clic para avanzar',\r\n 'onclick'=> \"javascript:\r\n if ($('#year_poa').val()<$yearmax)\r\n {\r\n document.getElementById('year_poa').value ++;\r\n }\r\n actualiza();\"\r\n );\r\n $data['flecha_sus']= array(\r\n 'src' => base_url().'imagenes/back_enabled.png',\r\n 'alt' => 'Atrás',\r\n 'class' => 'BotonIco',\r\n 'width' => '',\r\n 'height' => '',\r\n 'title' => 'Clic para retroceder',\r\n 'onclick'=> \"javascript:document.getElementById('year_poa').value --; actualiza();\"\r\n );\r\n \r\n $data['id_unidad']= array( \r\n 'type' => 'hidden',\r\n 'name' => 'id_unidad',\r\n 'id' => 'id_unidad', \r\n 'value' => $this->session->userdata('id_estructura')); \r\n \r\n $data['contenido']='enviar_poa/enviar_poa'; \r\n $data['script']='<!-- Cargamos CSS de DataTables -->'.\"\\n\"; \r\n $data['script'].=\"\\t\".'<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"'.base_url().'css/dataTables.css\"/>'.\"\\n\";\r\n $data['script'].='<!-- Cargamos JS para DataTables -->'.\"\\n\";\r\n $data['script'].=\"\\t\".'<script type=\"text/javascript\" src=\"'.base_url().'js/jquery.dataTables.js\"></script>'.\"\\n\";\r\n $data['script'].='<!-- Cargamos Nuestro JS -->'.\"\\n\";\r\n $data['script'].=\"\\t\".'<script type=\"text/javascript\" src=\"'.base_url().'js/enviar_poa.js\"></script>'.\"\\n\";\r\n \r\n \r\n $data['tabla']=$this->planificacion_unidades($yearpoa, $this->session->userdata('id_estructura')); \r\n \r\n // CARGAMOS LA VISTA \r\n $this->load->view('plantillas/plantilla_general',$data); \r\n }", "function TablaServiciosDiariasVendedor()\n {\t\n\t\n\t//Logo\n $this->Image(\"./assets/img/logo.png\" , 20 ,12, 60 , 20 , \"PNG\");\n\t$this->SetXY(10, 15);\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(75,6,'',0,0,'');\n\t$this->Cell(120,6,'LISTADO DE SERVICIOS DEL DIA '.date(\"Y-m-d\"),0,1,'C');\n \n\t$this->Cell(75,6,'',0,0,'');\n $this->Cell(120,6,'DE CAJA N°.'.base64_decode($_GET['caja']),0,0,'C');\n //Salto de línea\n $this->Ln(15);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'CÉDULA GERENTE: ',0,0,'');\n\t$this->Cell(44,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->Cell(30,5,'NOMBRE GERENTE:',0,0,'');\n\t$this->Cell(83,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'TELÉFONO GERENTE: ',0,0,'');\n $this->Cell(44,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->Cell(30,5,'CORREO GERENTE:',0,0,'');\n $this->Cell(83,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(10,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'CÓDIGO SERVICIO',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'FECHA SERVICIO',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'SERVICIOS',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'SUBTOTAL',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'IVA',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'DESCUENTO',1,0,'C', True);\n\t$this->CellFitSpace(26,8,'TOTAL PAGO',1,1,'C', True);\n\t\n $tra = new Login();\n $reg = $tra->ListarServiciosDiarias();\n\t$serviciosTotal=0;\n\t$pagoSubtotal=0;\n\t$pagoIva=0;\n\t$pagoDescuento=0;\n\t$pagoTotal=0;\n\t$a=1;\n for($i=0;$i<sizeof($reg);$i++){\n $serviciosTotal+=$reg[$i]['cantidad'];\n\t$pagoSubtotal+=$reg[$i]['subtotal']; \n\t$pagoIva+=$reg[$i]['totaliva']; \n\t$pagoDescuento+=$reg[$i]['totaldescuento']; \n\t$pagoTotal+=$reg[$i]['totalpago'];\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(10,5,$a++,1,0,'C');\n\t$this->CellFitSpace(32,5,$reg[$i][\"codservicio\"],1,0,'C');\n\t$this->CellFitSpace(32,5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($reg[$i]['fechaservicio']))),1,0,'C');\n\t$this->CellFitSpace(22,5,utf8_decode($reg[$i][\"cantidad\"]),1,0,'C');\n\t$this->CellFitSpace(25,5,utf8_decode(number_format($reg[$i]['subtotal'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totaliva'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totaldescuento'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(26,5,utf8_decode(number_format($reg[$i]['totalpago'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(10,5,'',1,0,'C');\n $this->Cell(32,5,'',1,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(32,5,'TOTAL GENERAL',1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n $this->Cell(22,5,utf8_decode($serviciosTotal),1,0,'C');\n $this->Cell(25,5,utf8_decode(number_format($pagoSubtotal, 2, '.', ',')),1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($pagoIva, 2, '.', ',')),1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($pagoDescuento, 2, '.', ',')),1,0,'C'); \n $this->CellFitSpace(26,5,utf8_decode(number_format($pagoTotal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n\n \n $this->Ln(15); \n $this->SetFont('courier','B',9);\n $this->Cell(190,0,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]).' RECIBIDO POR:___________________________','',1,'C');\n $this->Ln(4);\n }", "function update_save() {\r\n //obtenemos los datos del expediente\r\n \r\n $exp_id = $_REQUEST [\"exp_id\"];\r\n $tra_id = $_REQUEST [\"tra_id\"];\r\n $cue_id = $_REQUEST [\"cue_id\"];\r\n //$ver_id = $_SESSION ['VER_ID'];\r\n $ser_id = 0;\r\n $usu_id = 0;\r\n $trc_id = 0;\r\n $exc_id = 0;\r\n $con_id = 0;\r\n $this->expediente = new tab_expediente ();\r\n $sql = \"SELECT * \r\n FROM tab_expediente\r\n WHERE exp_estado = 1 \r\n AND exp_id='$exp_id' \";\r\n $rows = $this->expediente->dbselectBySQL($sql);\r\n\r\n if (count($rows) == 1) {\r\n $ser_id = $rows [0]->getSer_id();\r\n }\r\n\r\n $expusuario = new Tab_expusuario ();\r\n $sql = \"SELECT * \r\n FROM tab_expusuario\r\n WHERE eus_estado = 1\r\n AND exp_id='\" . $exp_id . \"' \";\r\n $rows_eus = $expusuario->dbselectBySQL($sql);\r\n if (count($rows_eus) >= 1) {\r\n $usu_id = $rows_eus [0]->getUsu_id();\r\n }\r\n\r\n $this->tramitecuerpos = new tab_tramitecuerpos ();\r\n $sql = \"SELECT * \r\n FROM tab_tramitecuerpos \r\n WHERE tra_id=\" . $tra_id . \" and cue_id=\" . $cue_id . \" \";\r\n $rows = $this->tramitecuerpos->dbselectBySQL($sql);\r\n if (count($rows) >= 1) {\r\n $trc_id = $rows [0]->getTrc_id();\r\n }\r\n\r\n $fil_id = $this->updateArchivo(); \r\n \r\n if (!empty($_REQUEST['fil_descripcion'])) {\r\n $this->palclave = new tab_palclave();\r\n $pac_nombre = trim($_REQUEST['fil_descripcion']);\r\n $array = explode(SEPARATOR_SEARCH, $pac_nombre);\r\n \r\n for($j=0;$j<count($array);$j++){\r\n if ($array[$j]!='') {\r\n $sql = \"select pac_id from tab_palclave where pac_estado = 1 AND fil_id='$fil_id' AND pac_nombre='\" . trim($array[$j]) . \"'\";\r\n $row = $this->palclave->dbSelectBySQL($sql);\r\n if (count($row) == 0) {\r\n $this->palclave->setFil_id($fil_id);\r\n $this->palclave->setPac_nombre(strtoupper(trim($array[$j])));\r\n $this->palclave->setPac_formulario('Documento');\r\n $this->palclave->setPac_estado(1);\r\n $this->palclave->insert();\r\n }\r\n }\r\n }\r\n \r\n } \r\n\r\n\r\n \r\n\r\n \r\n // ********************************\r\n // Save Tab_archivo_digital\r\n ///////////////Aumentado por freddy///////////////////////////////////////////////////////////////////////////////////////////\r\n //$seccion = VAR3;\r\n $arc = new archivo ();\r\n $tarchivo = new tab_archivo ();\r\n //\r\n $archivo_digital = new tab_archivo_digital();\r\n //\r\n $tarchivo->setRequest2Object($_REQUEST);\r\n //$exp_id = $_REQUEST ['exp_id'];\r\n //$fil_id = $_REQUEST ['fil_id'];\r\n $sql = \"SELECT *\r\n FROM tab_archivo\r\n WHERE fil_id = '$fil_id' \";\r\n $rows = $tarchivo->dbselectBySQL($sql);\r\n //$tarch = $rows [0];\r\n\r\n $archivo_type = $_FILES [\"archivo\"] [\"type\"];\r\n $archivo = $_FILES [\"archivo\"] [\"tmp_name\"];\r\n $archivo_size = $_FILES [\"archivo\"] [\"size\"];\r\n $archivo_name = $_FILES [\"archivo\"] [\"name\"];\r\n $nombre = basename($_FILES[\"archivo\"][\"name\"]);\r\n $nombreFichero = $_FILES [\"archivo\"] [\"name\"];\r\n\r\n $archivo_name_array = explode(\".\", $archivo_name);\r\n $archivo_ext = array_pop($archivo_name_array);\r\n $archivo_sin_ext = implode($archivo_name_array);\r\n //$archivo_name = $arc->generarNombre($archivo_sin_ext);\r\n $archivo_name = \"\";\r\n $archivo_cifrado = md5($archivo_name);\r\n $sis_tammax = 0;\r\n\r\n \r\n // Data Parameters\r\n $nombreDirectorio = \"\";\r\n $tsistema = new tab_sistema ();\r\n $sql = \"SELECT *\r\n FROM tab_sistema\";\r\n $rows2 = $tsistema->dbselectBySQL($sql);\r\n if (count($rows2) >= 1) {\r\n $sis_tipcarga = $rows2 [0]->sis_tipcarga;\r\n $sis_tammax = $rows2 [0]->sis_tammax;\r\n $nombreDirectorio = $rows2 [0]->sis_ruta;\r\n }\r\n\r\n\r\n // Verify size\r\n if ($archivo_size > $sis_tammax) {\r\n echo \"El tamaño del archivo supera el permitido\";\r\n } else {\r\n\r\n /* * *************************************************** */\r\n /* TYPE SAVE BD */\r\n /* * *************************************************** */\r\n $sis_tipcarga = 1;\r\n\r\n if ($sis_tipcarga == 1) {\r\n $error = false;\r\n $copiarFichero = false;\r\n if (is_uploaded_file($_FILES['archivo']['tmp_name'])) {\r\n //$nombreDirectorio = \"img/\";\r\n $nombreFichero = $_FILES['archivo']['name'];\r\n $copiarFichero = true;\r\n $nombreCompleto = $nombreDirectorio . $nombreFichero;\r\n if (is_file($nombreCompleto)) {\r\n $idUnico = time();\r\n $nombreFichero = $idUnico . \"-\" . $nombreFichero;\r\n }\r\n } else if ($_FILES['archivo']['error'] == UPLOAD_ERR_FORM_SIZE) {\r\n $maxsize = $_REQUEST['MAX_FILE_SIZE'];\r\n $errores[\"archivo\"] = \"El tamanio del fichero supera el limite permitido ($maxsize bytes)!\";\r\n $error = true;\r\n } else if ($_FILES['archivo']['name'] == \"\")\r\n $nombreFichero = '';\r\n else {\r\n $errores[\"archivo\"] = \"No se ha podido subir el fichero!\";\r\n $msm_guardado_archivo = 0;\r\n $error = true;\r\n }\r\n if ($error == false) {\r\n $link = $archivo_digital->connect();\r\n pg_query($link, \"begin\");\r\n// $sql = \"INSERT INTO tab_archivo_digital(fil_id, fil_nomoriginal, fil_nomcifrado, fil_tipo, fil_tamano, fil_extension, nombre, mime, size, archivo, fil_estado) \r\n// VALUES ($fil_id, '$nombreFichero', '$archivo_cifrado', '$archivo_type','$archivo_size' , '$archivo_ext' ,'$nombre', '$archivo_type', $archivo_size, '$nombreFichero', 1)\";\r\n $sql = \"UPDATE tab_archivo_digital \r\n SET fil_nomoriginal='$nombreFichero', fil_nomcifrado='$archivo_cifrado', fil_tipo='$archivo_type', fil_tamano='$archivo_size', fil_extension='$archivo_ext', nombre='$nombre', mime='$archivo_type', size=$archivo_size, archivo='$nombreFichero', fil_estado=1 \r\n WHERE fil_id = $fil_id \";\r\n pg_query($link, $sql) or die(pg_last_error($link));\r\n pg_query($link, \"commit\");\r\n if ($copiarFichero)\r\n move_uploaded_file($_FILES['archivo']['tmp_name'], $nombreDirectorio . $nombreFichero);\r\n $msm_guardado_archivo = 1; //\"Se subio correctamente el archivo\";\r\n }\r\n }\r\n else {\r\n $link = $archivo_digital->connect();\r\n $fp = fopen($archivo, \"rb\");\r\n $contenido = fread($fp, filesize($archivo));\r\n fclose($fp);\r\n pg_query($link, \"begin\");\r\n $oid = pg_lo_create($link);\r\n// $sql = \"INSERT INTO tab_archivo_digital(fil_id, fil_nomoriginal, fil_nomcifrado, fil_tipo, fil_tamano, fil_extensio, nombre, archivo_oid, mime, size, archivo) \r\n// VALUES ($fil_id, '$archivo_name', '$archivo_cifrado', '$archivo_type','$archivo_size' , '$archivo_ext', '$nombre', $oid, '$archivo_type', $archivo_size, '$nombreFichero')\";\r\n $sql = \"UPDATE tab_archivo_digital\r\n SET fil_nomoriginal='$archivo_name', fil_nomcifrado='$archivo_cifrado', fil_tipo='$archivo_type', fil_tamano='$archivo_size', fil_extension='$archivo_ext', nombre='$nombre', archivo_oid=$oid, mime='$archivo_type', size=$archivo_size, archivo='$nombreFichero', fil_estado=1 \r\n WHERE fil_id = $fil_id \";\r\n \r\n pg_query($link, $sql) or die(pg_last_error($link));\r\n $blob = pg_lo_open($link, $oid, \"w\");\r\n pg_lo_write($blob, $contenido);\r\n pg_lo_close($blob);\r\n pg_query($link, \"commit\");\r\n $msm_guardado_archivo = 1; //\"Se subio correctamente el archivo\"\r\n }\r\n\r\n\r\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\n if ($ser_id != 0 && $usu_id != 0 && $trc_id != 0) {\r\n// if (isset($_REQUEST [\"con_id\"]) && $_REQUEST [\"con_id\"] != \"\") {\r\n// $con_id = $_REQUEST [\"con_id\"];\r\n// $suc_id = $_REQUEST [\"suc_id\"];\r\n// $expcontenedor = new tab_expcontenedor ();\r\n// $row_exc = $expcontenedor->dbselectBy3Field(\"suc_id\", $suc_id, \"exc_estado\", \"1\", \"exp_id\", $exp_id);\r\n//\r\n// if (count($row_exc) == 0) {\r\n// $exc_id = $this->saveContenedor($exp_id, $suc_id);\r\n// } else {\r\n// $exc_id = $row_exc [0]->exc_id;\r\n// }\r\n// } \r\n \r\n \r\n //$this->updateExpArchivo($fil_id, $exp_id, $tra_id, $cue_id);\r\n \r\n if ($_REQUEST ['accion'] == 'cargar') {\r\n //Header ( \"Location: \" . PATH_DOMAIN . \"/archivo/cargar/$exp_id/$fil_id/\" . VAR3 . \"/\" );\r\n\r\n header(\"location:\" . PATH_DOMAIN . \"/estrucDocumental/viewTree/\" . $exp_id . \"/\" . $msm_guardado_archivo . \"/$cue_id/\");\r\n } else {\r\n Header(\"Location: \" . PATH_DOMAIN . \"/archivo/digitalizar/$exp_id/$fil_id/\" . VAR3 . \"/\");\r\n }\r\n } else {\r\n header(\"location:\" . PATH_DOMAIN . \"/estrucDocumental/viewTree/\" . $exp_id . \"/\" . $msm_guardado_archivo . \"/$cue_id/\");\r\n }\r\n }\r\n \r\n }", "public function lista_productos($com_id){ \n $data['componente'] = $this->model_componente->get_componente($com_id);\n if(count($data['componente'])!=0){\n\n $data['fase']=$this->model_faseetapa->get_fase($data['componente'][0]['pfec_id']);\n $proy_id=$data['fase'][0]['proy_id'];\n $data['menu']=$this->genera_menu($proy_id);\n $data['productos'] = $this->model_producto->list_prod($com_id); // Lista de productos\n $data['proyecto'] = $this->model_proyecto->get_id_proyecto($proy_id);\n $data['oregional']=$this->verif_oregional($proy_id); //// Verifica Objetivos regionales\n $data['monto_asig']=0;\n $data['monto_prog']=0;\n $data['monto_asig']=$this->model_ptto_sigep->suma_ptto_accion($data['proyecto'][0]['aper_id'],1);\n $data['monto_prog']=$this->model_ptto_sigep->suma_ptto_accion($data['proyecto'][0]['aper_id'],2);\n\n $monto_a=0;$monto_p=0;\n if(count($data['monto_asig'])!=0){\n $monto_a=$data['monto_asig'][0]['monto'];\n }\n if (count($data['monto_prog'])!=0) {\n $monto_p=$data['monto_prog'][0]['monto']; \n }\n\n $data['saldo']= round(($monto_a-$monto_p),2);\n $data['indi'] = $this->model_proyecto->indicador(); /// indicador\n $data['metas'] = $this->model_producto->tp_metas(); /// tp metas\n $data['oestrategicos'] = $this->model_mestrategico->list_objetivos_estrategicos(); /// Objetivos Estrategicos\n if(count($this->model_producto->ult_operacion($com_id))!=0){\n $data['cod_ope']=$this->model_producto->ult_operacion($com_id);\n }\n else{\n $data['cod_ope']=0;\n }\n\n /*--------- Proyecto de Inversion -----------*/\n if($data['proyecto'][0]['tp_id']==1){\n //$data['componente'] = $this->model_componente->get_componente_pi($com_id);\n $data['datos_proyecto']='<h1> PROYECTO : <small> '.$data['proyecto'][0]['aper_programa'].' '.$data['proyecto'][0]['proy_sisin'].''.$data['proyecto'][0]['aper_actividad'].' - '.$data['proyecto'][0]['proy_nombre'].'</small></h1>';\n $data['list_oregional']=$this->lista_oregional_pi($proy_id);\n $data['prod'] = $this->operaciones($proy_id,$com_id);\n $data['tit_comp']='UNIDAD RESPONSABLE';\n }\n /*--------- Operacion de Funcionamiento ----------*/\n else{\n $data['proyecto'] = $this->model_proyecto->get_datos_proyecto_unidad($proy_id);\n //$data['componente'] = $this->model_componente->get_componente($com_id);\n $data['datos_proyecto']='<h1> '.$data['proyecto'][0]['establecimiento'].' : <small> '.$data['proyecto'][0]['aper_programa'].' '.$data['proyecto'][0]['aper_proyecto'].''.$data['proyecto'][0]['aper_actividad'].' - '.$data['proyecto'][0]['tipo'].' '.$data['proyecto'][0]['act_descripcion'].' - '.$data['proyecto'][0]['abrev'].'</small></h1>';\n $data['list_oregional']=$this->lista_oregional($proy_id);\n $data['prod'] = $this->operaciones($proy_id,$com_id);\n $data['tit_comp']='SUBACTIVIDAD';\n }\n\n \n $this->load->view('admin/programacion/producto/list_productos', $data); /// Gasto Corriente\n\n }\n else{\n redirect('prog/list_serv/'.$com_id);\n }\n }", "public function ActualizarDetallesVentas()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"codproducto\"]) or empty($_POST[\"producto\"]) or empty($_POST[\"cantventa\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\n\t$sql = \"select existencia from productos where codproducto = '\".$_POST[\"codproducto\"].\"'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t\n\t\t$existenciadb = $row['existencia'];\n\t\t$cantventa = rount($_POST[\"cantventa\"],2);\n\t\t$cantidadventadb = $_POST[\"cantidadventadb\"];\n\n\t\t$total = $_POST[\"cantventa\"]-$_POST[\"cantidadventadb\"];\n\n\t\tif ($total > $existenciadb) \n\t\t{ \n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\n###################### ACTUALIZAMOS EL DETALLE DEL PRODUCTO ############################\n\t\t$sql = \" UPDATE detalleventas set \"\n\t\t.\" cantventa = ?, \"\n\t\t.\" precioventa = ?, \"\n\t\t.\" importe = ?, \"\n\t\t.\" importe2 = ? \"\n\t\t.\" where \"\n\t\t.\" coddetalleventa = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $cantventa);\n\t\t$stmt->bindParam(2, $precioventa);\n\t\t$stmt->bindParam(3, $importeventa);\n\t\t$stmt->bindParam(4, $importecompra);\n\t\t$stmt->bindParam(5, $coddetalleventa);\n\n\t\t$cantventa = strip_tags($_POST[\"cantventa\"]);\n\t\t$precioventa = strip_tags($_POST[\"precioventa\"]);\n\t\t$importeventa = strip_tags($_POST[\"importe\"]);\n\t\t$importecompra = strip_tags($_POST[\"importe2\"]);\n\t\t$coddetalleventa = strip_tags($_POST[\"coddetalleventa\"]);\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql2 = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->bindParam(1, $stocktotal);\n\t\t$stmt->bindParam(2, $codproducto);\n\n\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t$cantidad = rount($_POST[\"cantventa\"],2);\n\t\t$calculoventa= rount($cantventa-$_POST[\"cantidadventadb\"],2);\n\t\t$stocktotal = rount($existenciadb-$calculoventa,2);\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN KARDEX ############################\t\t\n\t\t$sql2 = \" update kardexproductos set \"\n\t\t.\" salidas = ?, \"\n\t\t.\" preciom = ?, \"\n\t\t.\" costototal = ? \"\n\t\t.\" where \"\n\t\t.\" codproceso = ? and codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->bindParam(1, $salidas);\n\t\t$stmt->bindParam(2, $preciounit);\n\t\t$stmt->bindParam(3, $costototal);\n\t\t$stmt->bindParam(4, $codventa);\n\t\t$stmt->bindParam(5, $codproducto);\n\n\t\t$salidas = rount($_POST[\"cantventa\"],2);\n\t\t$preciounit = strip_tags($_POST[\"precioventa\"]);\n\t\t$codventa = strip_tags($_POST[\"codigoventa\"]);\n\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t$costototal = strip_tags($_POST[\"cantventa\"] * $_POST[\"precioventa\"]);\n\t\t$stmt->execute();\n\n################### CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codproducto\"]));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$_POST[\"codproducto\"].\"'\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$_POST[\"cantventa\"],2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\nif($_POST[\"cantventa\"]!=$_POST[\"cantidadventadb\"]) { \n\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ##################\t\t\t\n\t\t\t\t\t$sql2 = \" update kardexingredientes set \"\n\t\t\t\t\t.\" salidasing = ?, \"\n\t\t\t\t\t.\" stockactualing = ?, \"\n\t\t\t\t\t.\" preciouniting = ?, \"\n\t\t\t\t\t.\" costototaling = ? \"\n\t\t\t\t\t.\" where \"\n\t\t\t\t\t.\" codprocesoing = ? and codproducto = ? and codingrediente = ?;\n\t\t\t\t\t\";\n\t\t $stmt = $this->dbh->prepare($sql2);\n\t\t\t\t\t$stmt->bindParam(1, $salidasing);\n\t\t\t\t\t$stmt->bindParam(2, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(3, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(4, $costototaling);\n\t\t\t\t\t$stmt->bindParam(5, $codventa);\n\t\t\t\t\t$stmt->bindParam(6, $codproducto);\n\t\t\t\t\t$stmt->bindParam(7, $codingrediente);\n\n\t\t\t\t\t$salidasing = rount($cantracion*$_POST[\"cantventa\"],2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $_POST[\"cantventa\"]);\n\t\t $codventa = strip_tags($_POST[\"codigoventa\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$stmt->execute();\n\t##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #####################\n\t\t\t\t}\n\n\t\t }\n\n}\n############ FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###############\n\n\n\t\t$sql4 = \"select * from ventas where idventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array($_POST[\"codigoventa\"]) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t$tipopagove = $paea[0][\"tipopagove\"];\n\t\t$codcaja = $paea[0][\"codcaja\"];\n\t\t$totalpago = $paea[0][\"totalpago\"];\n\t\t$montopagado = $paea[0][\"montopagado\"];\n\t\t\t\n\t \n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2 from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array($_POST[\"idventa\"]));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\tif($row = $stmt->fetch())\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t$importeivasi = ($pae[0][\"importe\"]== \"\" ? \"0\" : $pae[0][\"importe\"]);\n\t\t$importe2 = ($pae[0][\"importe2\"]== \"\" ? \"0\" : $pae[0][\"importe2\"]);\n\n\t\t\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2 from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array($_POST[\"idventa\"]));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $roww;\n\t\t\t}\n\t\t$importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\t\t$importe2 = ($roww[\"importe2\"]== \"\" ? \"0\" : $roww[\"importe2\"]);\n\n\t\t\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" idventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n $stmt->bindParam(1, $subtotalivasive);\n $stmt->bindParam(2, $subtotalivanove);\n $stmt->bindParam(3, $totalivave);\n\t\t$stmt->bindParam(4, $totaldescuentove);\n\t\t$stmt->bindParam(5, $total);\n\t\t$stmt->bindParam(6, $devuelto);\n\t\t$stmt->bindParam(7, $codventa);\n\t\t\n\t\t$subtotalivasive= strip_tags($importeivasi);\n $subtotalivanove= strip_tags($importeivano);\n $totalivave= rount($subtotalivasive*$iva,2);\n $tot= rount($subtotalivasive+$subtotalivanove+$totalivave,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$total,2));\n\t\t$codventa = strip_tags($_POST[\"codigoventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\tif ($tipopagove==\"CONTADO\"){\n\n\t\t$sql = \"select ingresos from arqueocaja where codcaja = '\".$codcaja.\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t//if (isset($row['ingresos'])) { $ingreso = $row['ingresos']; } else { $ingreso ='0.00'; }\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = '\".$codcaja.\"' and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\n\t\t$monto = rount($totalpago-$total,2);\n\t\t$txtTotal = rount($ingreso-$monto,2);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA FUE ACTUALIZADO EXITOSAMENTE <a href='reportepdf?codventa=\".base64_encode($_POST[\"idventa\"]).\"&tipo=\".base64_encode(\"TICKET\").\"' class='on-default' data-placement='left' data-toggle='tooltip' data-original-title='Imprimir Factura' target='_black' rel='noopener noreferrer'><strong>IMPRIMIR TICKET</strong></a></div>\";\n\t\texit;\n\n\t\t\t}", "public function Actualizar_Exp_Laboral($data){\n $modelo = new HojaVida();\n $fechahora = $modelo->get_fecha_actual();\n $datosfecha = explode(\" \",$fechahora);\n $fechalog = $datosfecha[0];\n $horalog = $datosfecha[1];\n \n $tiporegistro = \"Experiencia Laboral\";\n $accion = \"Actualiza una Nueva \".$tiporegistro.\" En el Sistema (Hoja vida) TALENTO HUMANO\";\n $detalle = $_SESSION['nombre'].\" \".$accion.\" \".$fechalog.\" \".\"a las: \".$horalog;\n $tipolog = 15;\n $idusuario = $_SESSION['idUsuario'];\n //$idusuario = $_POST['id_user'];;\n try {\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\t\t\n //EMPIEZA LA TRANSACCION\n $this->pdo->beginTransaction();\n $sql = \"UPDATE th_experiencia_laboral SET \n exp_id_departamento = ?,\n exp_id_municipio = ?, \n exp_rama_flag = ?,\n exp_empresa = ?,\n exp_cargo = ?,\n exp_CS_flag = ?,\n exp_id_area_CS = ?,\n exp_fecha_inicio = ?,\n exp_fecha_actualmente = ?,\n exp_fecha_fin = ?,\n exp_ruta_certificado = ?,\n exp_id_usuarioE = ?\n WHERE exp_id = ?\";\n\n $this->pdo->prepare($sql)\n ->execute(\n array( \n $data->exp_id_departamento,\n $data->exp_id_municipio,\n $data->exp_rama,\n $data->exp_empresa,\n $data->exp_cargo,\n $data->exp_CS_flag,\n $data->exp_id_area,\n $data->exp_fecha_inicio,\n $data->exp_fecha_actualmente,\n $data->exp_fecha_fin,\n $data->exp_ruta_certificado,\n $idusuario,\n $data->id\n )\n ); \n \n $this->pdo->exec(\"INSERT INTO log (fecha, accion,detalle,idusuario,idtipolog) VALUES ('$fechalog', '$accion','$detalle','$idusuario','$tipolog')\");\n //SE TERMINA LA TRANSACCION \n $this->pdo->commit();\n } catch (Exception $e) {\n $this->pdo->rollBack();\n die($e->getMessage());\n }\n }", "function insertarFactura(){\r\n\t\t$this->procedimiento='tesor.ft_factura_ime';\r\n\t\t$this->transaccion='TSR_FAC_INS';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t//Define los parametros para la funcion\t\t\r\n\t\t$this->setParametro('nro_factura','nro_factura','int4');\r\n\t\t$this->setParametro('nombre_emisor','nombre_emisor','varchar');\r\n\t\t$this->setParametro('domicilio_emisor','domicilio_emisor','varchar');\r\n\t\t$this->setParametro('nit_emisor','nit_emisor','int4');\r\n\t\t$this->setParametro('nombre_cliente','nombre_cliente','varchar');\r\n\t\t$this->setParametro('domicilio_cliente','domicilio_cliente','varchar');\r\n\t\t$this->setParametro('nit_cliente','nit_cliente','int4');\t\t\r\n\t\t$this->setParametro('fecha_emision','fecha_emision','date');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "public function solicitud_pdf_comfiar() {\n require_once(\"application/controllers/wsonline2/facturaElectronica.php\");\n\n $libfacturaElectronica = new FacturaElectronica();\n log_info($this->iniciLog);\n log_info($this->logHeader . ' Entro a solicitud_pdf_comfiar');\n\n $sqlfacturasinpdf = $this->db->query(\"SELECT pk_xml_codigo,xmlcom.url_pdf,xmlcom.pk_factura_codigo,xmlcom.id_transaccion_comfiar,fac.numero_factura\n FROM modfactur.factblxmlcomfiar xmlcom\n JOIN modfactur.factblfactur fac\n ON xmlcom.pk_factura_codigo = fac.pk_factur_codigo\n WHERE xmlcom.pk_tipo_xml_codigo =1\n and url_pdf is null order by pk_xml_codigo asc\");\n $facturas = $sqlfacturasinpdf->result_array;\n $total_sinpdf=count($facturas);\n log_info($this->logHeader . ' TOTAL FACTURAS SIN PDF = '.$total_sinpdf);\n \n if($total_sinpdf>0){\n //se consultan parametros consumo ws solo una vez para no \n $cuitId = $this->facturacionelectronica->retornarValorConfiguracion(3); //Cuit, RUC o NIT del emisor del comprobante. \n $puntoVentaId = $this->facturacionelectronica->retornarValorConfiguracion(5); //Número de punto de venta a procesar 01 factura\n $tipoComprobanteId = $this->facturacionelectronica->retornarValorConfiguracion(6); //Número del tipo de comprobante a procesar. Ejemplo 01:Factura\n $prefijoPeople = $this->facturacionelectronica->retornarValorConfiguracion(24); // Pefrijo factura ejemplo SETT\n }\n foreach ($facturas as $factura) {\n log_info($this->queryData . ' DATOS FACTURA: URL_PDF= ' . $factura['URL_PDF'] . ' PK_FACTURA_CODIGO= ' .\n $factura['PK_FACTURA_CODIGO'] . ' ID_TRANSACCION_COMFIAR= ' . $factura['ID_TRANSACCION_COMFIAR'] . ' NÚMERO_FACTURA= ' . $factura['NUMERO_FACTURA']);\n\n $urlWsdl = $this->facturacionelectronica->retornarValorConfiguracion(30);\n $wsdl = $urlWsdl;\n $options = array(\n 'cache_wsdl' => 0,\n 'trace' => 1,\n 'stream_context' => stream_context_create(array(\n 'ssl' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n 'allow_self_signed' => true\n )\n ))\n );\n $client = new SoapClient($wsdl, $options);\n $transaccionId = $factura['ID_TRANSACCION_COMFIAR'];\n $nroComprobante = $factura['NUMERO_FACTURA'];\n $respuesta_token = $libfacturaElectronica->verificar_token_comfiar();\n\n log_info($this->logHeader . '::::RESPUESTA_VERIFICAR_TOKEN::::' . $respuesta_token);\n\n $sessionId = $this->facturacionelectronica->retornarValorConfiguracion(32);\n $fechaVenc = $this->facturacionelectronica->retornarValorConfiguracion(33);\n $pk_xml_codigo = $factura['PK_XML_CODIGO'];\n\n // web service input params\n $request_param = array(\n \"transaccionId\" => $transaccionId, //274 id transaccion confiar\n \"cuitId\" => $cuitId,\n \"puntoDeVentaId\" => $puntoVentaId,\n \"tipoComprobanteId\" => $tipoComprobanteId, // tipo comprobante factura 01\n \"numeroComprobante\" => $nroComprobante, //418 Número de factura enviado SETT418\n \"token\" => array(\n \"SesionId\" => $sessionId,\n \"FechaVencimiento\" => $fechaVenc\n )\n );\n log_info($this->logHeader . $this->postData . 'Id_Tx_Comfiar: ' . $transaccionId .\n ' cuitId: ' . $cuitId .\n ' puntoDeVentaId: ' . $puntoVentaId .\n ' tipoComprobanteId: ' . $tipoComprobanteId .\n ' numeroComprobante: ' . $nroComprobante .\n ' SesionId: ' . $sessionId .\n ' FechaVencimiento: ' . $fechaVenc .\n ' PK_xml_codigo: ' . $pk_xml_codigo);\n\n try {\n $responce_param = $client->DescargarPdf($request_param);\n log_info($this->postData . 'RESPUESTA COMSUMO DESCARGARPDF::' . json_encode($responce_param));\n if (isset($responce_param->DescargarPdfResult)) {\n\n\n $b64 = $responce_param->DescargarPdfResult;\n $data = base64_encode($b64);\n $urlpublica = $this->db->query(\"select VALOR_PARAMETRO from modgeneri.gentblpargen where pk_pargen_codigo =96\");\n $urlpublica = $urlpublica->result_array[0];\n //guarda y genera url factura pdf\n $folderPath = \"uploads/facturacomfiar/\";\n $date = date('Y-m-d');\n $random = rand(1000, 9999);\n $fact = strtolower($prefijoPeople) . '-' . $nroComprobante . '-';\n $name = $fact . strtolower($date . '-' . $random . '.pdf');\n $file_dir = $folderPath . $name;\n $url = $urlpublica['VALOR_PARAMETRO'] . '/' . $folderPath . $name;\n $pdf_decoded = base64_decode($data); //Write data back to pdf file\n try {\n $pdf = fopen($file_dir, 'w');\n fwrite($pdf, $pdf_decoded);\n //close output file\n fclose($pdf);\n $dataReturn = $url;\n// echo $url . '+++' . $fact;\n } catch (Exception $e) {\n $response = 'Excepción capturada: ' . $e->getMessage();\n }\n\n log_info($this->logHeader . '::Consumo Correcto soap DescargarPdf::URL PDF COMFIAR::' . $dataReturn);\n\n $response = $dataReturn;\n //llamar procedimiento actualiza url factura transmitida comfiar\n $sql = \"BEGIN modfactur.facpkgdatacomfiar.prcactualizapdffacturacomfiar(\n parpkxmlcodigo=>:parpkxmlcodigo,\n parurlpdf=>:parurlpdf,\n parrespuesta=>:parrespuesta);\n END;\";\n\n $conn = $this->db->conn_id;\n $stmt = oci_parse($conn, $sql);\n oci_bind_by_name($stmt, ':parpkxmlcodigo', $pk_xml_codigo, 32);\n oci_bind_by_name($stmt, ':parurlpdf', $dataReturn, 1000);\n oci_bind_by_name($stmt, ':parrespuesta', $parrespuesta, 32);\n if (!oci_execute($stmt)) {\n $e = oci_error($stmt);\n// VAR_DUMP($e);\n log_info($this->finLog . ' ERROR ACTUALIZANDO FACTURA -prcactualizapdffacturacomfiar- '\n . $e['message'] . '[*] parpkxmlcodigo=' . $pk_xml_codigo . '[*] parurlpdf=' . $dataReturn);\n }\n } else {\n $response = 'Error consumo Soap';\n }\n } catch (Exception $e) {\n log_info($this->logHeader . 'ERROR SOAP::' . $e->getMessage());\n\n $response = 'Error consumo DescargarPdf :' . $e->getMessage();\n }\n log_info($this->finLog . ' FACTURA NÚMERO= ' . $nroComprobante . ' PK_XML_CODIGO =' . $pk_xml_codigo . ' URL PDF ACTUALIZADA ::RESPONSE::' . $response);\n }\n }", "public function reajustar(){\n //calculando según el IPC acumulado\n //entre el último reajuste realizado y ahora. \n $mes_actual = (int)date(\"m\");\n $agno_actual = (int)date('Y');\n $mes_inicio = $mes_actual - $this->reajusta_meses;\n $agno_inicio = $agno_actual;\n if($mes_inicio <= 0){\n $agno_inicio -= 1;\n $mes_inicio+= 12;\n }\n $ipcs = array();\n if($agno_inicio != $agno_actual){\n $ipcs = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes >= :m and agno = :a','params'=>array(':m'=>$mes_inicio,':a'=>$agno_inicio)));\n $ipcs_actual = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes < :m and agno = :a','params'=>array(':m'=>$mes_actual,':a'=>$agno_actual)));\n foreach($ipcs_actual as $ipc){\n $ipcs[] = $ipc;\n }\n }\n else{\n $ipcs = Ipc::model()->findAll(array('condition'=>'mes >= :m1 and mes < :m2 and agno = :a','params'=>array(':m1'=>$mes_inicio,':m2'=>$mes_actual,':a'=>$agno_actual)));\n }\n\n $ipc_acumulado = 0;\n foreach($ipcs as $ipc){\n //sumo los ipcs para generar el ipc acumulado\n $ipc_acumulado+= $ipc->porcentaje;\n }\n //para hacer el cálculo según porcentaje\n $ipc_acumulado /= 100;\n\n //saco el último debe pagar para ver cuánto era lo que tenía que pagar antes\n $debePagars = DebePagar::model()->findAllByAttributes(array('contrato_id'=>$this->id),array('order'=>'id DESC'));\n $debePagar = $debePagars[0];\n \n $debeNuevo = new DebePagar();\n $debeNuevo->agno = $agno_actual;\n $debeNuevo->mes = $mes_actual;\n $debeNuevo->dia = $debePagar->dia;\n $debeNuevo->contrato_id = $this->id;\n //ahora hay que reajustar los montos del contrato dependiendo del ipc_acumulado\n //el precio base debe ser el valor anterior en debe pagar\n $debeNuevo->monto_gastocomun = intval($debePagar->monto_gastocomun*(1+$ipc_acumulado));\n $debeNuevo->monto_gastovariable = intval($debePagar->monto_gastovariable*(1+$ipc_acumulado));\n $debeNuevo->monto_mueble = intval($debePagar->monto_mueble*(1+$ipc_acumulado));\n $debeNuevo->monto_renta = intval($debePagar->monto_renta*(1+$ipc_acumulado));\n try{\n //se reajusta el contrato\n $debeNuevo->save(); \n } catch (Exception $ex) {\n }\n }", "function TablaProductosVendidos()\n {\n //Logo\n $this->Image(\"./assets/img/logo.png\" , 20 ,12, 60 , 20 , \"PNG\");\n\t$this->SetXY(10, 15);\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(75,6,'',0,0,'');\n\t$this->Cell(120,6,'LISTADO DE PRODUCTOS VENDIDOS POR FECHAS ',0,1,'C');\n \n\t$this->Cell(75,6,'',0,0,'');\n $this->Cell(120,6,' DESDE '.$_GET[\"desde\"].' HASTA '.$_GET[\"hasta\"],0,0,'C');\n //Salto de línea\n $this->Ln(15);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'CÉDULA GERENTE: ',0,0,'');\n\t$this->Cell(44,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->Cell(30,5,'NOMBRE GERENTE:',0,0,'');\n\t$this->Cell(83,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'TELÉFONO GERENTE: ',0,0,'');\n $this->Cell(44,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->Cell(30,5,'CORREO GERENTE:',0,0,'');\n $this->Cell(83,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(8,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(15,8,'CÓDIGO',1,0,'C', True);\n\t$this->CellFitSpace(60,8,'DESCRIPCIÓN DE PRODUCTO',1,0,'C', True);\n\t$this->CellFitSpace(20,8,'CATEGORIA',1,0,'C', True);\n\t$this->CellFitSpace(23,8,'PRECIO V.',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'EXISTENCIA',1,0,'C', True);\n\t$this->CellFitSpace(18,8,'VENDIDOS',1,0,'C', True);\n\t$this->CellFitSpace(26,8,'MONTO TOTAL',1,1,'C', True);\n\t\n $ve = new Login();\n\t$reg = $ve->BuscarVentasProductos();\n\t$precioTotal=0;\n\t$existeTotal=0;\n\t$vendidosTotal=0;\n\t$pagoTotal=0;\n\t$a=1;\n\tfor($i=0;$i<sizeof($reg);$i++){\n\t$precioTotal+=$reg[$i]['precioventa'];\n\t$existeTotal+=$reg[$i]['existencia'];\n\t$vendidosTotal+=$reg[$i]['cantidad']; \n\t$pagoTotal+=$reg[$i]['precioventa']*$reg[$i]['cantidad'];\n\t$this->SetFont('courier','',7); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(8,5,$a++,1,0,'C');\n\t$this->CellFitSpace(15,5,$reg[$i][\"codproducto\"],1,0,'C');\n $this->CellFitSpace(60,5,utf8_decode($reg[$i][\"producto\"]),1,0,'C');\n\t$this->CellFitSpace(20,5,utf8_decode($reg[$i][\"nomcategoria\"]),1,0,'C');\n\t$this->CellFitSpace(23,5,utf8_decode(number_format($reg[$i][\"precioventa\"], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(22,5,utf8_decode($reg[$i]['existencia']),1,0,'C');\n\t$this->CellFitSpace(18,5,utf8_decode($reg[$i]['cantidad']),1,0,'C');\n\t$this->CellFitSpace(26,5,utf8_decode(number_format($reg[$i]['precioventa']*$reg[$i]['cantidad'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(8,5,'',0,0,'C');\n $this->Cell(15,5,'',0,0,'C');\n $this->Cell(60,5,'',0,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(20,5,'TOTALES',1,0,'C', True);\n $this->SetFont('courier','B',7);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n $this->Cell(23,5,utf8_decode(number_format($precioTotal, 2, '.', ',')),1,0,'C');\n $this->Cell(22,5,utf8_decode($existeTotal),1,0,'C');\n $this->Cell(18,5,utf8_decode($vendidosTotal),1,0,'C'); \n $this->CellFitSpace(26,5,utf8_decode(number_format($pagoTotal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n\n $this->Ln(12); \n $this->SetFont('courier','B',9);\n $this->Cell(5,6,'',0,0,'');\n $this->Cell(100,6,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]),0,0,'');\n $this->Cell(60,6,'RECIBIDO:__________________________________',0,0,'');\n $this->Ln();\n $this->Cell(5,6,'',0,0,'');\n $this->Cell(100,6,'FECHA/HORA ELABORACIÓN: '.date('d-m-Y h:i:s A'),0,0,'');\n $this->Cell(60,6,'',0,0,'');\n $this->Ln(4);\n }", "public function accionIndex(){\n \n if(!Sistema::app()->acceso()->hayUsuario()){\n Sistema::app()->paginaError(400,\"Solos los usuarios registrados pueden acceder\");\n exit;\n }\n\n //llega el pase de la pelicula\n $codPase = intval($_GET[\"id\"]);\n \n //obtener las entradas compradas para ese pase, esa pelicula y esa hora\n $entUsuarios = new Entradas_usuarios();\n $pasePelicula = new Pases_peliculas();\n $sala = new Salas();\n $asientos = new Asientos();\n $entAnonimos = new Entradas_anonimos();\n \n \n $pasePelicula->buscarPorId($codPase);//CONTROLAR QUE EXISTE.\n //CONTROLAR TAMBIEN SI HA CADUCADO.\n \n //obtengo la sala donde se proyecta ese pase\n $sala->buscarPorId($pasePelicula->cod_sala);\n \n \n $opFil[\"select\"] = \"cod_asiento, fila, columna\";\n $opFil[\"where\"] = \"t.cod_sala =\".$pasePelicula->cod_sala;\n $opFil[\"order by\"] = \"fila, columna\";\n \n $totalAsientos = $asientos->buscarTodos($opFil);\n \n //tengo todos las entradas para ese pase.\n $opFiltrado[\"where\"] = \"t.cod_pase_pelicula = \".$codPase;\n $entradasUsu = $entUsuarios->buscarTodos($opFiltrado);\n $entradasAnon = $entAnonimos->buscarTodos($opFiltrado);\n \n $filas = $sala->n_filas;\n $columnas = $sala->n_columnas;\n $capacidad = $sala->capacidad;\n \n \n $asientosOcupados = [];\n \n //Si no hay entradas compreadas para este pase, no se ejecuta ---\n \n if(!empty($entradasUsu)||!empty($entradasAnon)){\n $asientosOcupados = $this->asientosOcupados($entradasUsu, $entradasAnon);\n }\n \n //if(!empty($entradasAnonimos)){\n // $asientosOcupados2 = $this->asientosOcupados($entradasAnonimos);\n // var_dump($asientosOcupados2);\n //}\n \n if(isset($_POST[\"butacas\"])){\n \n //llega el imput que almacena en un string creado en js\n //con un string con todos los asientos seleccionados\n $asientosSel = explode(\",\", $_POST[\"butacas\"]);\n \n Sistema::app()->sesion()->set(\"butacas\",$asientosSel);\n Sistema::app()->sesion()->set(\"codPase\",$codPase);\n \n Sistema::app()->irAPagina(array(\"entradasUsuarios\",\"mostrarResumen\"));\n exit;\n }\n \n \n $this->dibujaVista(\"mostrarCine\",array(\"asientosOcupados\"=>$asientosOcupados,\n \"filas\"=>$filas,\n \"cols\"=>$columnas,\n \"codPase\"=>$codPase,\n \"codAsientos\"=>$totalAsientos\n ),\n \"CINES MELERO\");\n \n \n \n }", "public function index()\n {\n\n $id = Input::get('id');\n\n // OJO: Validar que solo exista un periodo activo para un convenio, que no se solapen los periodos\n //$encuestas = Encuesta::where('estado','AC')->first();\n $encuestaRespuestas = EncuestaRespuesta::find($id);\n if ($encuestaRespuestas) {\n $encuesta_id = $encuestaRespuestas->encuesta_id;\n } else {\n $encuesta_id = Encuesta::buscarEncuestaActiva(Auth::user()->instituciones_id);\n }\n //$encuesta_id = Encuesta::buscarEncuestaActiva(Auth::user()->instituciones_id);\n // $encuesta_id = 3;\n // } else {\n // $encuesta_id = Encuesta::buscarEncuestaActiva(Auth::user()->instituciones_id);\n // }\n\n $dimension = Dimension::where('encuentas_id', $encuesta_id)->orderBy('id', 'ASC')->get();\n $dimension_inicial = Dimension::where('encuentas_id', $encuesta_id)->orderBy('id', 'ASC')->first();\n\n $id_dimension_inicial = $dimension_inicial->id;\n \n $dimension_final = Encuesta::find($encuesta_id)->dimension->last();\n $id_final = $dimension_final->id;\n $total_dimensiones = Encuesta::find($encuesta_id)->dimension->count();\n \n $total_preguntas = Preguntas::getCantPreguntas($encuesta_id);\n $factor = Factores::all();\n $periodo = Periodo::all();\n \n \n if ($id == '') {\n $encuestaRespuestas = 0;\n $desbloqueda = 1;\n $desc_motivo = \" \";\n $imdis = 0;\n }else{\n // Para validar que solo edite sus encuestas\n if (Auth::user()->hasRole('snds')){\n $encuestaRespuestas = EncuestaRespuesta::find($id)\n ->getEstadoEncuestaRespuestas();\n }else{\n $encuestaRespuestas = EncuestaRespuesta::find($id)\n ->getEstadoEncuestaRespuestas(Auth::user()->instituciones_id);\n }\n \n \n if ($encuestaRespuestas) \n {\n $desbloqueda = $encuestaRespuestas->estados_encuesta_id;\n }else{\n return redirect('home')->with('errors_validacion',\"Encuesta no pertenece a su municipalidad.\");\n }\n\n \n if (($encuestaRespuestas->estados_encuesta_id === 1) && (Auth::user()->hasRole('oum')))\n {\n\n return redirect('home')->with('errors_validacion',\"La Encuesta no esta completada por parte de su municipalidad.\");\n }\n\n\n\n\n $descripcion_motivo = EncuestaRespuesta::select('motivo_rechazo')\n ->where('id','=',$id)->firstOrFail();\n $desc_motivo = $descripcion_motivo->motivo_rechazo;\n\n $imdis = $encuestaRespuestas->imdis;\n }\n\n \n if ($desbloqueda == 1 ) { // Si esta en borrador esta desbloqueda\n $encuesta_bloqueda = '';\n } else {\n $encuesta_bloqueda = ' disabled ';\n }\n\n /**\n * Bloquear si el periodo esta cerrado.\n */\n $periodo_cerrado = Periodo::buscarPeriodoActivo(Auth::user()->instituciones_id, $id);\n\n // Si es el periodo esta cerrado se bloquea\n if ($periodo_cerrado == 0) {\n $encuesta_bloqueda = ' disabled '; // Bloquea la encuesta si esta. \n }\n\n if (Auth::user()->hasRole('snds')) { // Si es senadis no edita\n $encuesta_bloqueda = ' disabled ';\n }\n \n return view('encuesta.encuesta',['dimension' => $dimension ,\n 'total_preguntas' => $total_preguntas,\n 'factor' => $factor,\n 'periodo' => $periodo,\n 'escuesta_bloqueda' => $encuesta_bloqueda,\n 'encuestaRespuestas' => $encuestaRespuestas,\n 'desc_motivo' => $desc_motivo,\n 'desbloqueda' => $desbloqueda,\n 'id_dimension_inicial' => $id_dimension_inicial,\n 'encuestas_id' => $encuesta_id,\n 'id_final' => $id_final,\n 'total_dimensiones' => $total_dimensiones,\n 'imdis' => $imdis,\n \n ]);\n }", "function alta_pr_factura(){\n $tipo_descuento = $_POST['tipo_descuento'];\n unset($_POST['tipo_descuento']);\n if ($tipo_descuento == \"porcentaje\") {\n $_POST['porcentaje_descuento'] = $_POST['descuento'];\n $_POST['descuento'] = 0;\n } else {\n //$monto = $_POST['monto_total'] != 0 ? $_POST['monto_total'] : 1;\n $_POST['porcentaje_descuento'] = 0;//100 * $_POST['descuento'] / $monto;\n }\n $u = new Pr_factura();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n $u->espacios_fisicos_id = $GLOBALS['espacios_fisicos_id'];\n $u->fecha_captura = date(\"Y-m-d H:i:s\");\n $fecha = explode(\" \", $_POST['fecha']);\n $u->fecha = $fecha[2] . \"/\" . $fecha[1] . \"/\" . $fecha[0];\n unset($_POST['fecha']);\n unset($_POST['tipo_entrada']);\n $related = $u->from_array($_POST);\n // save with the related objects\n $u->lote_id = 0;\n $u->save($related);\n \n\t/*if ($u->save($related)) {\n //Dar de alta el lote si el proveedor no es el inicial\n if ($u->cproveedores_id > 0) {\n $l = new Lote();\n $l->fecha_recepcion = $u->fecha;\n $l->espacio_fisico_inicial_id = $u->espacios_fisicos_id;\n $l->pr_factura_id = $u->id;\n $l->save();\n $u->lote_id = $l->id;\n $u->save();\n }\n }*/\n echo \"<input type='hidden' name='id' id='id' value='$u->id'>\";\n }", "public function facturarContado(Request $request){\n\n $cliente = $request->selecli;\n $tipo = $request->pagos;\n $modo = $request->modo;\n $fecha = $request->fechaactual;\n $empleado = $request->idemp;\n $tarjeta = $request->typecard;\n //Contado\n $totapago = $request->totals;\n //Credito\n $dias = $request->diascredit;\n $cuota = $request->cuota;\n $saldo_act = $request->limitcredit; \n\n if ($tipo == 1) {\n $meses = $dias * 0.0328549112;\n $subtot = $cuota * $meses;\n $iva = $subtot * 0.13;\n $total = $subtot + $iva; \n $saldo = $saldo_act - $total;\n\n $factcredit = $this->FacturasQueries->insertFacturaCredito($cliente, $tipo, $empleado, $fecha, round($total, 2));\n\n $this->FacturasQueries->updateCredito($cliente, round($saldo, 2));\n\n $items = Cart::getContent();\n\n foreach ($items as $row) {\n $this->FacturasQueries->insertDetalles($factcredit, $row->id, $row->quantity, $row->getPriceSum());\n }\n\n $factura = $this->FacturasQueries->getFactura($factcredit);\n $detalles = $this->FacturasQueries->getdetalle($factcredit);\n foreach ($factura as $row) {\n $empleado = $this->FacturasQueries->getEmpleadoID($row->idEmpleado); \n }\n $subtotal = 0;\n $iva = 0;\n foreach ($detalles as $items) {\n $subtotal += $items->Precio; \n }\n $iva = $subtotal * 0.13;\n\n $pdf = PDF::loadView('factura.pdf', compact(['factura', 'detalles', 'empleado', 'subtotal', 'iva'])); \n\n }elseif ($tipo == 2) {\n $items = Cart::getContent();\n\n if (empty($tarjeta)) {\n $factcont = $this->FacturasQueries->insertFacturaContado($cliente, $tipo, $modo, $empleado, $fecha, $totapago);\n\n }else{\n $factcont = $this->FacturasQueries->insertFacturaContadoFactura($cliente, $tipo, $modo, $empleado, $fecha, $totapago, $tarjeta);}\n\n foreach ($items as $row) {\n $this->FacturasQueries->insertDetalles($factcont, $row->id, $row->quantity, $row->getPriceSum());\n } \n\n $factura = $this->FacturasQueries->getFactura($factcont);\n $detalles = $this->FacturasQueries->getdetalle($factcont);\n foreach ($factura as $row) {\n $empleado = $this->FacturasQueries->getEmpleadoID($row->idEmpleado); \n }\n $subtotal = 0;\n $iva = 0;\n foreach ($detalles as $items) {\n $subtotal += $items->Precio; \n }\n $iva = $subtotal * 0.13;\n\n $pdf = PDF::loadView('factura.pdf', compact(['factura', 'detalles', 'empleado', 'subtotal', 'iva'])); \n }\n\n $customPaper = array(0,0,200,600);\n\n $pdf->setPaper($customPaper);\n\n Cart::clear();\n\n return $pdf->stream('ticket.pdf'); \n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->tr20_id = ($this->tr20_id == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_id\"]:$this->tr20_id);\n if($this->tr20_dtalvara == \"\"){\n $this->tr20_dtalvara_dia = ($this->tr20_dtalvara_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_dia\"]:$this->tr20_dtalvara_dia);\n $this->tr20_dtalvara_mes = ($this->tr20_dtalvara_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_mes\"]:$this->tr20_dtalvara_mes);\n $this->tr20_dtalvara_ano = ($this->tr20_dtalvara_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_ano\"]:$this->tr20_dtalvara_ano);\n if($this->tr20_dtalvara_dia != \"\"){\n $this->tr20_dtalvara = $this->tr20_dtalvara_ano.\"-\".$this->tr20_dtalvara_mes.\"-\".$this->tr20_dtalvara_dia;\n }\n }\n $this->tr20_numcgm = ($this->tr20_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_numcgm\"]:$this->tr20_numcgm);\n $this->tr20_ruaid = ($this->tr20_ruaid == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_ruaid\"]:$this->tr20_ruaid);\n $this->tr20_nro = ($this->tr20_nro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_nro\"]:$this->tr20_nro);\n $this->tr20_bairroid = ($this->tr20_bairroid == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_bairroid\"]:$this->tr20_bairroid);\n $this->tr20_complem = ($this->tr20_complem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_complem\"]:$this->tr20_complem);\n $this->tr20_fone = ($this->tr20_fone == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_fone\"]:$this->tr20_fone);\n $this->tr20_prefixo = ($this->tr20_prefixo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_prefixo\"]:$this->tr20_prefixo);\n }else{\n $this->tr20_id = ($this->tr20_id == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_id\"]:$this->tr20_id);\n }\n }", "function listarTotalesPeriodoAgencia(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_PERAGTOT_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n\n $this->setParametro('id_periodo_venta','id_periodo_venta','int4');\n\n $this->capturaCount('total_credito_mb','numeric');\n $this->capturaCount('total_credito_me','numeric');\n $this->capturaCount('total_boletos_mb','numeric');\n $this->capturaCount('total_boletos_usd','numeric');\n $this->capturaCount('total_comision_mb','numeric');\n $this->capturaCount('total_comision_usd','numeric');\n $this->capturaCount('total_debito_mb','numeric');\n $this->capturaCount('total_debito_usd','numeric');\n $this->capturaCount('total_neto_mb','numeric');\n $this->capturaCount('total_neto_usd','numeric');\n\n\n //Definicion de la lista del resultado del query\n $this->captura('id_periodo_venta_agencia','int4');\n $this->captura('codigo_periodo','varchar');\n $this->captura('id_agencia','int4');\n $this->captura('medio_pago','varchar');\n $this->captura('mes','varchar');\n $this->captura('gestion','varchar');\n $this->captura('id_periodo_venta','int4');\n $this->captura('fecha_ini','varchar');\n $this->captura('fecha_fin','varchar');\n $this->captura('moneda_restrictiva','varchar');\n $this->captura('codigo_int','varchar');\n $this->captura('nombre','varchar');\n $this->captura('fecha_ini2','varchar');\n $this->captura('fecha_fin2','varchar');\n $this->captura('estado','varchar');\n $this->captura('total_credito_mb','numeric');\n $this->captura('total_credito_me','numeric');\n $this->captura('total_boletos_mb','numeric');\n $this->captura('total_boletos_usd','numeric');\n $this->captura('total_comision_mb','numeric');\n $this->captura('total_comision_usd','numeric');\n $this->captura('total_debito_mb','numeric');\n $this->captura('total_debito_usd','numeric');\n $this->captura('total_neto_mb','numeric');\n $this->captura('total_neto_usd','numeric');\n $this->captura('monto_mb','numeric');\n $this->captura('monto_usd','numeric');\n $this->captura('billetes','text');\n\n\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function Geral() {\r\n \r\n extract($GLOBALS);\r\n global $w_Disabled;\r\n $w_chave = $_REQUEST['w_chave'];\r\n $w_sq_tipo_lancamento = $_REQUEST['w_sq_tipo_lancamento'];\r\n $w_readonly = '';\r\n $w_erro = '';\r\n\r\n // Carrega o segmento cliente\r\n $sql = new db_getCustomerData; $RS = $sql->getInstanceOf($dbms,$w_cliente); \r\n $w_segmento = f($RS,'segmento');\r\n \r\n // Verifica se há necessidade de recarregar os dados da tela a partir\r\n // da própria tela (se for recarga da tela) ou do banco de dados (se não for inclusão)\r\n if ($w_troca>'' && $O!='E') {\r\n // Se for recarga da página\r\n $w_codigo_interno = $_REQUEST['w_codigo_interno'];\r\n $w_sq_tipo_lancamento = $_REQUEST['w_sq_tipo_lancamento'];\r\n $w_sq_tipo_documento = $_REQUEST['w_sq_tipo_documento'];\r\n $w_descricao = $_REQUEST['w_descricao'];\r\n $w_valor = $_REQUEST['w_valor'];\r\n $w_fim = $_REQUEST['w_fim'];\r\n $w_conta_debito = $_REQUEST['w_conta_debito'];\r\n $w_sq_forma_pagamento = $_REQUEST['w_sq_forma_pagamento'];\r\n $w_cc_debito = $_REQUEST['w_cc_debito'];\r\n $w_cc_credito = $_REQUEST['w_cc_credito'];\r\n\r\n } elseif(strpos('AEV',$O)!==false || $w_copia>'') {\r\n // Recupera os dados do lançamento\r\n $sql = new db_getSolicData; \r\n $RS = $sql->getInstanceOf($dbms,nvl($w_copia,$w_chave),$SG);\r\n if (count($RS)>0) {\r\n $w_codigo_interno = f($RS,'codigo_interno');\r\n $w_sq_tipo_lancamento = f($RS,'sq_tipo_lancamento');\r\n $w_conta_debito = f($RS,'sq_pessoa_conta');\r\n $w_descricao = f($RS,'descricao');\r\n $w_fim = formataDataEdicao(f($RS,'fim'));\r\n $w_valor = formatNumber(f($RS,'valor'));\r\n $w_sq_forma_pagamento = f($RS,'sq_forma_pagamento');\r\n $w_cc_debito = f($RS,'cc_debito');\r\n $w_cc_credito = f($RS,'cc_credito');\r\n }\r\n }\r\n\r\n // Recupera dados do comprovante\r\n if (nvl($w_troca,'')=='' && (nvl($w_copia,'')!='' || nvl($w_chave,'')!='')) {\r\n $sql = new db_getLancamentoDoc; $RS = $sql->getInstanceOf($dbms,nvl($w_copia,$w_chave),null,null,null,null,null,null,'DOCS');\r\n $RS = SortArray($RS,'sq_tipo_documento','asc');\r\n foreach ($RS as $row) {$RS=$row; break;}\r\n if (nvl($w_copia,'')=='') $w_chave_doc = f($RS,'sq_lancamento_doc'); // Se cópia, não copia a chave do documento \r\n $w_sq_tipo_documento = f($RS,'sq_tipo_documento');\r\n $w_numero = f($RS,'numero');\r\n $w_data = FormataDataEdicao(f($RS,'data'));\r\n $w_serie = f($RS,'serie');\r\n $w_valor_doc = formatNumber(f($RS,'valor'));\r\n $w_patrimonio = f($RS,'patrimonio');\r\n $w_tributo = f($RS,'calcula_tributo');\r\n $w_retencao = f($RS,'calcula_retencao'); \r\n }\r\n\r\n // Default: pagamento para pessoa jurídica\r\n $w_tipo_pessoa = nvl($w_tipo_pessoa,2);\r\n \r\n // Recupera o trâmite de conclusão\r\n $sql = new db_getTramiteList; $RS = $sql->getInstanceOf($dbms, $w_menu,null,null,null);\r\n $RS = SortArray($RS,'ordem','asc');\r\n foreach ($RS as $row) {\r\n if (f($row,'sigla')=='AT') {\r\n $w_tramite_conc = f($row,'sq_siw_tramite');\r\n break;\r\n }\r\n }\r\n \r\n // Verifica as formas de pagamento possíveis. Se apenas uma, atribui direto\r\n $sql = new db_getFormaPagamento; $RS = $sql->getInstanceOf($dbms, $w_cliente, null, $SG, null,'S',null);\r\n $w_exibe_fp = true;\r\n if (count($RS)==1 || nvl($w_sq_forma_pagamento,'')!='') {\r\n foreach($RS as $row) { \r\n if (nvl($w_sq_forma_pagamento,f($row,'sq_forma_pagamento'))==f($row,'sq_forma_pagamento')) {\r\n $w_sq_forma_pagamento = f($row,'sq_forma_pagamento'); \r\n $w_forma_pagamento = f($row,'sigla'); \r\n $w_nm_forma_pagamento = f($row,'nome'); \r\n break; \r\n }\r\n }\r\n if (count($RS)==1) $w_exibe_fp = false;\r\n }\r\n \r\n // Verifica os tipos de documento possíveis. Se apenas um, atribui direto\r\n $sql = new db_getTipoDocumento; $RS = $sql->getInstanceOf($dbms,null,$w_cliente,$w_menu,null);\r\n $w_exibe_dc = true;\r\n if (count($RS)==1) {\r\n foreach($RS as $row) { \r\n $w_sq_tipo_documento = f($row,'chave'); \r\n $w_tipo_documento = f($row,'sigla'); \r\n $w_nm_tipo_documento = f($row,'nome'); \r\n break; \r\n }\r\n $w_exibe_dc = false;\r\n }\r\n\r\n // Se o tipo de lançamento já foi informado, recupera o código externo para definir a conta contábil de débito\r\n if ($w_sq_tipo_lancamento) {\r\n $sql = new db_getTipoLancamento; $RS = $sql->getInstanceOf($dbms,$w_sq_tipo_lancamento,null,$w_cliente,null);\r\n $w_cc_debito = f($RS[0],'codigo_externo');\r\n }\r\n \r\n // Retorna as contas contábeis do lançamento\r\n retornaContasContabeis($RS_Menu, $w_cliente, $w_sq_tipo_lancamento, $w_sq_forma_pagamento, $w_conta_debito, $w_cc_debito, $w_cc_credito);\r\n \r\n Cabecalho();\r\n head();\r\n Estrutura_CSS($w_cliente);\r\n // Monta o código JavaScript necessário para validação de campos e preenchimento automático de máscara,\r\n // tratando as particularidades de cada serviço\r\n ScriptOpen('JavaScript');\r\n CheckBranco();\r\n FormataData();\r\n SaltaCampo();\r\n FormataDataHora();\r\n FormataValor();\r\n ShowHTML('function botoes() {');\r\n ShowHTML(' document.Form.Botao[0].disabled = true;');\r\n ShowHTML(' document.Form.Botao[1].disabled = true;');\r\n ShowHTML('}');\r\n ValidateOpen('Validacao');\r\n if ($O=='I' || $O=='A') {\r\n Validate('w_sq_tipo_lancamento','Tipo do lançamento','SELECT',1,1,18,'','0123456789');\r\n if ($w_exibe_fp) Validate('w_sq_forma_pagamento','Forma de pagamento','SELECT',1,1,18,'','0123456789');\r\n Validate('w_conta_debito','Conta bancária', 'SELECT', 1, 1, 18, '', '0123456789');\r\n if ($w_exibe_dc) Validate('w_sq_tipo_documento','Tipo de documento','SELECT',1,1,18,'','0123456789');\r\n Validate('w_fim','Data da operação', 'DATA', '1', '10', '10', '', '0123456789/');\r\n Validate('w_valor','Valor total do documento','VALOR','1',4,18,'','0123456789.,-');\r\n CompValor('w_valor','Valor total do documento','>','0,00','zero');\r\n Validate('w_descricao','Observação','1','',5,2000,'1','1');\r\n \r\n Validate('w_cc_debito','Conta Débito','','','2','25','ABCDEFGHIJKLMNOPQRSTUVWXYZ','0123456789');\r\n Validate('w_cc_credito','Conta Crédito','','','2','25','ABCDEFGHIJKLMNOPQRSTUVWXYZ','0123456789');\r\n \r\n ShowHTML(' if ((theForm.w_cc_debito.value != \"\" && theForm.w_cc_credito.value == \"\") || (theForm.w_cc_debito.value == \"\" && theForm.w_cc_credito.value != \"\")) {');\r\n ShowHTML(' alert (\"Informe ambas as contas contábeis ou nenhuma delas!\");');\r\n ShowHTML(' theForm.w_cc_debito.focus();');\r\n ShowHTML(' return false;');\r\n ShowHTML(' }');\r\n \r\n } \r\n Validate('w_assinatura',$_SESSION['LABEL_ALERTA'], '1', '1', '3', '30', '1', '1');\r\n ValidateClose();\r\n ScriptClose();\r\n ShowHTML('<BASE HREF=\"'.$conRootSIW.'\">');\r\n ShowHTML('</HEAD>');\r\n if ($w_troca>'') BodyOpen('onLoad=\\'document.Form.'.$w_troca.'.focus()\\';');\r\n elseif (!(strpos('EV',$O)===false)) BodyOpen('onLoad=\\'this.focus()\\';');\r\n else BodyOpen('onLoad=\\'document.Form.w_sq_tipo_lancamento.focus()\\';');\r\n Estrutura_Topo_Limpo();\r\n Estrutura_Menu();\r\n Estrutura_Corpo_Abre();\r\n Estrutura_Texto_Abre();\r\n ShowHTML('<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">');\r\n if ($w_chave>'') ShowHTML(' <tr><td><font size=\"2\"><b>'.$w_codigo_interno.' ('.$w_chave.')</b></td>');\r\n if (strpos('IAEV',$O)!==false) {\r\n if (strpos('EV',$O)!==false) {\r\n $w_Disabled=' DISABLED ';\r\n if ($O=='V') $w_Erro = Validacao($w_sq_solicitacao,$SG);\r\n } \r\n if (Nvl($w_pais,'')=='') {\r\n // Carrega os valores padrão para país, estado e cidade\r\n $sql = new db_getCustomerData; $RS = $sql->getInstanceOf($dbms,$w_cliente);\r\n $w_pais = f($RS,'sq_pais');\r\n $w_uf = f($RS,'co_uf');\r\n $w_cidade = Nvl(f($RS_Menu,'sq_cidade'),f($RS,'sq_cidade_padrao'));\r\n } \r\n AbreForm('Form',$w_dir.$w_pagina.'Grava','POST','return(Validacao(this));',null,$P1,$P2,$P3,$P4,$TP,$SG,$R,$O);\r\n ShowHTML(MontaFiltro('POST'));\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_troca\" value=\"\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_copia\" value=\"'.$w_copia.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave\" value=\"'.$w_chave.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_codigo_interno\" value=\"'.$w_codigo_interno.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_menu\" value=\"'.f($RS_Menu,'sq_menu').'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_data_hora\" value=\"'.f($RS_Menu,'data_hora').'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_cidade\" value=\"'.$w_cidade.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_tramite\" value=\"'.$w_tramite_conc.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_tipo\" value=\"'.$w_tipo.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_chave_doc\" value=\"'.$w_chave_doc.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_tipo_pessoa\" value=\"'.$w_tipo_pessoa.'\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_aviso\" value=\"N\">');\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_dias\" value=\"0\">');\r\n ShowHTML('<tr bgcolor=\"'.$conTrBgColor.'\"><td>');\r\n ShowHTML(' <table width=\"100%\" border=\"0\">');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" height=\"2\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" bgcolor=\"#D0D0D0\"><b>Identificação</td></td></tr>');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n ShowHTML(' <tr><td colspan=3>Os dados deste bloco serão utilizados para identificação do lançamento, bem como para o controle de sua execução.</td></tr>');\r\n ShowHTML(' <tr><td colspan=3 align=\"center\" height=\"1\" bgcolor=\"#000000\"></td></tr>');\r\n\r\n ShowHTML(' <tr valign=\"top\">');\r\n selecaoTipoLancamento('Tipo de lançamento:',null,null,$w_sq_tipo_lancamento,$w_menu,$w_cliente,'w_sq_tipo_lancamento',$SG, 'onChange=\"document.Form.action=\\''.$w_dir.$w_pagina.$par.'\\'; document.Form.O.value=\\''.$O.'\\'; document.Form.w_troca.value=\\''.(($w_exibe_fp) ? 'w_sq_forma_pagamento' : 'w_conta_debito').'\\'; document.Form.submit();\"',3);\r\n ShowHTML(' <tr valign=\"top\">');\r\n if ($w_exibe_fp) {\r\n SelecaoFormaPagamento('<u>F</u>orma de pagamento:','F','Selecione na lista a forma desejada para esta aplicação.',$w_sq_forma_pagamento,$SG,'w_sq_forma_pagamento',null,'onChange=\"document.Form.action=\\''.$w_dir.$w_pagina.$par.'\\'; document.Form.O.value=\\''.$O.'\\'; document.Form.w_troca.value=\\'w_conta_debito\\'; document.Form.submit();\"');\r\n } else {\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_sq_forma_pagamento\" value=\"'.$w_sq_forma_pagamento.'\">');\r\n }\r\n SelecaoContaBanco('<u>C</u>onta bancária:','C','Selecione a conta bancária envolvida no lançamento.',$w_conta_debito,null,'w_conta_debito',null,'onChange=\"document.Form.action=\\''.$w_dir.$w_pagina.$par.'\\'; document.Form.O.value=\\''.$O.'\\'; document.Form.w_troca.value=\\''.(($w_exibe_dc) ? 'w_sq_tipo_documento' : 'w_fim').'\\'; document.Form.submit();\"');\r\n ShowHTML(' </tr>');\r\n ShowHTML(' <tr valign=\"top\">');\r\n if ($w_exibe_dc) {\r\n SelecaoTipoDocumento('<u>T</u>ipo do documento:','T', 'Selecione o tipo de documento.', $w_sq_tipo_documento,$w_cliente,$w_menu,'w_sq_tipo_documento',null,null);\r\n } else {\r\n ShowHTML('<INPUT type=\"hidden\" name=\"w_sq_tipo_documento\" value=\"'.$w_sq_tipo_documento.'\">');\r\n }\r\n ShowHTML(' <td><b><u>D</u>ata da operação:</b><br><input '.$w_Disabled.' accesskey=\"D\" type=\"text\" name=\"w_fim\" class=\"sti\" SIZE=\"10\" MAXLENGTH=\"10\" VALUE=\"'.$w_fim.'\" onKeyDown=\"FormataData(this,event);\" onKeyUp=\"SaltaCampo(this.form.name,this,10,event);\">'.ExibeCalendario('Form','w_fim').'</td>');\r\n ShowHTML(' <td><b><u>V</u>alor:</b><br><input '.$w_Disabled.' accesskey=\"V\" type=\"text\" name=\"w_valor\" class=\"sti\" SIZE=\"18\" MAXLENGTH=\"18\" VALUE=\"'.$w_valor.'\" style=\"text-align:right;\" onKeyDown=\"FormataValor(this,18,2,event);\" title=\"Informe o valor total do documento.\"></td>');\r\n ShowHTML(' <tr><td colspan=3><b><u>O</u>bservação:</b><br><textarea '.$w_Disabled.' accesskey=\"O\" name=\"w_descricao\" class=\"sti\" ROWS=3 cols=75 title=\"Observação sobre a aplicação.\">'.$w_descricao.'</TEXTAREA></td>');\r\n\r\n ShowHTML(' <tr valign=\"top\">');\r\n ShowHTML(' <td><b><u>C</u>onta contábil de débito:</b></br><input type=\"text\" name=\"w_cc_debito\" class=\"sti\" SIZE=\"11\" MAXLENGTH=\"25\" VALUE=\"'.$w_cc_debito.'\"></td>');\r\n ShowHTML(' <td><b><u>C</u>onta contábil de crédito:</b></br><input type=\"text\" name=\"w_cc_credito\" class=\"sti\" SIZE=\"11\" MAXLENGTH=\"25\" VALUE=\"'.$w_cc_credito.'\"></td>');\r\n \r\n ShowHTML(' <tr><td align=\"LEFT\" colspan=4><b>'.$_SESSION['LABEL_CAMPO'].':<BR> <INPUT ACCESSKEY=\"A\" class=\"sti\" type=\"PASSWORD\" name=\"w_assinatura\" size=\"30\" maxlength=\"30\" value=\"\"></td></tr>');\r\n ShowHTML(' <tr><td align=\"center\" colspan=\"3\" height=\"1\" bgcolor=\"#000000\"></TD></TR>');\r\n ShowHTML(' <tr><td align=\"center\" colspan=\"3\">');\r\n ShowHTML(' <input class=\"stb\" type=\"submit\" name=\"Botao\" value=\"Gravar\">');\r\n if ($P1==0) {\r\n ShowHTML(' <input class=\"STB\" type=\"button\" onClick=\"location.href=\\''.montaURL_JS($w_dir,'tesouraria.php?par=inicial&O=L&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.'&SG='.MontaFiltro('GET')).'\\';\" name=\"Botao\" value=\"Abandonar\">');\r\n } else {\r\n $sql = new db_getMenuData; $RS = $sql->getInstanceOf($dbms,$w_menu);\r\n ShowHTML(' <input class=\"stb\" type=\"button\" onClick=\"location.href=\\''.montaURL_JS($w_dir,$R.'&w_copia='.$w_copia.'&O=L&SG='.f($RS,'sigla').'&P1='.$P1.'&P2='.$P2.'&P3='.$P3.'&P4='.$P4.'&TP='.$TP.MontaFiltro('GET')).'\\';\" name=\"Botao\" value=\"Cancelar\">');\r\n }\r\n ShowHTML(' </td>');\r\n \r\n ShowHTML(' </tr>');\r\n ShowHTML(' </table>');\r\n ShowHTML(' </TD>');\r\n ShowHTML('</tr>');\r\n ShowHTML('</FORM>');\r\n } else {\r\n ScriptOpen('JavaScript');\r\n ShowHTML(' alert(\"Opção não disponível\");');\r\n ScriptClose();\r\n } \r\n ShowHTML('</table>');\r\n ShowHTML('</center>');\r\n Estrutura_Texto_Fecha();\r\n Estrutura_Fecha();\r\n Estrutura_Fecha();\r\n Estrutura_Fecha();\r\n Rodape();\r\n}", "public function AgregarMatriculasMasivas($numInsercion,$lin_inf, $conexion,$idTablaGeneral) { \n header(\"Content-Type: text/html;charset=utf-8\"); \n $IdUsuario = $_SESSION['idUsuario']; \n $registro = explode(\";\", $lin_inf);\n \n $sql = \"CALL SPAGREGARMATRICULASMASIVAS('$registro[0]',$registro[1],$registro[2],$registro[3],'$registro[4]',$registro[5],'$registro[6]','$registro[7]',$registro[8]);\";\n $resultado=1;\n $rs=null;\n $array=\"\";\n //$conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $inserto = 0;\n if ($rs = $conexion->getPDO()->query($sql)) {\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas as $fila) {\n $array = $fila['pIdTabla'];\n }\n }\n $rs->closeCursor();\n $IdMatricula = $array;\n //----- Inicio envío de correos de las matriculas -----//\n if ($IdMatricula > 0){\n $rs1=null;\n $array1=array();\n $conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $sql1 = \"CALL SPCONSULTARDATOSCORREOMATRICULA($IdMatricula);\";\n if ($rs1 = $conexion->getPDO()->query($sql1)){\n if ($filas = $rs1->fetchAll(PDO::FETCH_ASSOC)){\n //----- Inicio código para enviar el correo al estudiante luego de la matrícula -----//\n foreach ($filas as $fila) {\n $array1[] = $fila; \n }\n $rs1->closeCursor();\n $utilidades = new clsUtilidades();\n $rs2=null;\n $array2=array();\n $IdTercero = $array1[0]['Id'];\n $sql2 = \"CALL SPCONSULTARCORREOSESTUDIANTES($IdTercero);\";\n if ($rs2 = $conexion->getPDO()->query($sql2)) {\n if ($filas2 = $rs2->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas2 as $fila1) {\n $array2[] = $fila1; \n }\n }\n $rs2->closeCursor();\n $clave = array_pop($array2)['Email'];\n $correode = array_pop($array2)['Email'];\n $rs3=null;\n $array3=array(); \n $sql3 = \"CALL SPCONSULTARCORREOUSUARIO($IdUsuario);\";\n if ($rs3 = $conexion->getPDO()->query($sql3)) {\n if ($filas3 = $rs3->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas3 as $fila3) {\n $array3[] = $fila3; \n }\n }\n $rs3->closeCursor();\n }\n if (count($array2)>0){\n $estudiante = $array1[0]['Estudiante'];\n $tipoidentificacion = $array1[0]['TipoIdentificacion'];\n $cedula = $array1[0]['NumeroIdentificacion'];\n $correoElectronico = $array1[0]['CorreoElectronico'];\n $salon = $array1[0]['Salon'];\n $curso = $array1[0]['Curso'];\n $ruta = $array1[0]['Ruta'];\n $duracionCurso = $array1[0]['DuracionCurso'];\n $diasCurso = $array1[0]['DiasCurso'];\n $fechaInicial = $array1[0]['FechaInicial'];\n $fechaFinal = $array1[0]['FechaFinal'];\n $horaInicial = $array1[0]['HoraInicial'];\n $horaFinal = $array1[0]['HoraFinal'];\n $modulo = $array1[0]['Modulo'];\n $duracionModulo = $array1[0]['DuracionModulo'];\n $modalidad = $array1[0]['Modalidad'];\n $sede = $array1[0]['Sede'];\n $docente = $array1[0]['Docente'];\n $usuario = $_SESSION['nombreUsuario'];\n $usuarioe = $array3[0]['CorreoElectronico'];\n $asunto = \"ID DE MATRICULA\";\n $correo=$utilidades->enviarCorreoEstudiante($estudiante,$tipoidentificacion,$cedula,$correoElectronico,$salon,$curso,$ruta,$duracionCurso,$diasCurso,$fechaInicial,$fechaFinal,$horaInicial,$horaFinal,$modulo,$duracionModulo,$modalidad,$sede,$docente,$IdMatricula,$usuario,$usuarioe,$correode,$clave,$asunto);\n }else{\n print_r(\"Error2\");\n $data[\"error\"]=\"No se encontraron correos de estudiantes\";\n }\n }else{\n print_r(\"No consulta correo estudiante\");\n $data[\"error\"]=\"No se consultaron los correos\";\n print_r($conexion->getPDO()->errorInfo()); die();\n } \n }\n }else{\n print_r(\"No consulta datos correo matricula <br>\");\n }\n }\n //----- Fin envío de correos de las matriculas -----//\n } \n return $array;\n }", "function autorizar_entregar_pm($id_movimiento_material) {\r\n global $_ses_user,$db,$id_stock_rma;\r\n \r\n\r\n //$db->StartTrans();\r\n $sql=\"select id_deposito from general.depositos where nombre='RMA-Produccion-San Luis' \";\r\n $res = sql($sql) or fin_pagina();\r\n $id_stock_rma = $res->fields[\"id_deposito\"];\r\n \r\n $titulo_pagina = \"Movimiento de Material\";\r\n $fecha_hoy = date(\"Y-m-d H:i:s\",mktime());\r\n \r\n \r\n $sql = \"select deposito_origen,deposito_destino from movimiento_material \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $res = sql($sql) or fin_pagina();\r\n \r\n $deposito_origen = $res->fields[\"deposito_origen\"];\r\n $deposito_destino = $res->fields[\"deposito_destino\"];\r\n \r\n $sql = \" select id_detalle_movimiento,cantidad,id_prod_esp from detalle_movimiento \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $detalle_mov = sql($sql) or fin_pagina();\r\n \r\n for($i=0; $i < $detalle_mov->recordcount(); $i++){ \t \r\n \t $id_detalle_movimiento = $detalle_mov->fields[\"id_detalle_movimiento\"];\t\r\n \t $cantidad = $detalle_mov->fields[\"cantidad\"];\r\n \t $id_prod_esp = $detalle_mov->fields[\"id_prod_esp\"];\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n //eliminamos las reservas hechas para este movimiento\r\n $comentario_stock=\"Utilización de los productos reservados por el $titulo_pagina Nº $id_movimiento\";\r\n $id_tipo_movimiento=7;\r\n descontar_reserva($id_prod_esp,$cantidad,$deposito_origen,$comentario_stock,$id_tipo_movimiento,$id_fila=\"\",$id_detalle_movimiento);\r\n //ahora incremento el stock destino\r\n \r\n if($deposito_destino==$id_stock_rma) {\r\n\t $comentario_rma=\"Ingreso de productos a RMA mediante el $titulo_pagina Nº $id_movimiento\";\r\n $tipo_log=\"Creacion MM Nº $id_movimiento\";\r\n $cb_insertados=array();\r\n $rma_san_luis = 1;\r\n incrementar_stock_rma($id_prod_esp,$cantidad,\"\",$comentario_rma,\"\",$cb_insertados,\"\",1,\"\",\"\",\"\",\"null\",\"\",$nro_caso,\"\",$tipo_log,\"\",$id_movimiento_material,$rma_san_luis);\r\n //guardamos el id de proveedor elegido para RMA, en la fila del PM o MM (en la tabla detalle_movimiento)\r\n /*\r\n $query=\"update mov_material.detalle_movimiento set id_proveedor=$id_proveedor_rma where id_detalle_movimiento=$id_detalle_movimiento\";\r\n sql($query,\"<br>Error al actualizar el proveedor de RMA del producto<br>\") or fin_pagina();\r\n */\r\n }\r\n else { \r\n $comentario = \" Ingreso de Productos mediante PM N°: $id_movimiento_material\";\r\n agregar_stock($id_prod_esp,$cantidad,$deposito_destino,$comentario,13,\"disponible\");\r\n } \r\n \r\n $detalle_mov->movenext(); \r\n }//del for\r\n \r\n}", "function calcular()\n\t\t{\n\t\t\tif ($_SERVER['REQUEST_METHOD']=='POST') {\n\t\t\t//Guardamos en un arreglo lo que recibimos de la vista via POST\t\n\t\t\t\t//enviamos ala funcion insertPersons del Modelo de personas \n\t\t\t\t//el arreglo previamente recibido\n\t\t\t\t $listado = $this->_estadisticaModel->getActividades($_POST['fechai'],$_POST['fechaf']);\n\t\t\t\t $listado2 = $this->_estadisticaModel->getMateriales_x_actividades($_POST['fechai'],$_POST['fechaf']);\n\t\t\t\t $listado1 = $this->_estadisticaModel->getCantidad($_POST['fechai'],$_POST['fechaf']);\n\t\t\t\t $this->_view->_fechai = $_POST['fechai'];\n\t\t\t\t $this->_view->_fechaf = $_POST['fechaf'];\n\t\t\t\t $this->_view->_listado2 = $listado2;\n\t\t\t\t $this->_view->_listado = $listado;\n\t\t\t\t $this->_view->_listado1 = $listado1;\n\t\t\t\t $this->_view->render(\"estadistica\",'','',$this->_sidebar_menu);\n\t\t\t\t \n\t\t\t\t//redireccionamos al listado\n\t\t\t}else{\n\t\t\t\t//se muestra la ventana si no es via post\n\t\t\t\t$this->_view->render(\"insert\",'','',$this->_sidebar_menu);\n\t\t\t}\n\t\t\t\n\t\t}", "function alta_inventario(){\n\t\t\n\t\t$u= new Pr_factura();\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresaid'];\n\t\t$u->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$u->fecha_captura=date(\"Y-m-d H:i:s\");\n\t\t$u->fecha=date(\"Y-m-d H:i:s\");\n\t\t$u->cproveedores_id=1;\n $u->fecha_pago=date(\"Y-m-d H:i:s\");\n $u->ctipo_factura_id=2;\n\t\t$fecha=explode(\" \", $_POST['fecha']);\n\t\t$u->fecha=$fecha[2].\"/\".$fecha[1].\"/\".$fecha[0];\n\t\tunset($_POST['fecha']);\n\t\tunset($_POST['tipo_entrada']);\n\t\t$related = $u->from_array($_POST);\n\t\t// save with the related objects\n\t\t\n\t\tif($u->save($related)){\n //Dar de alta el lote si el proveedor no es el inicial\n if($u->cproveedores_id>0){\n $l=new Lote();\n $l->fecha_recepcion=$u->fecha;\n $l->espacio_fisico_inicial_id=$u->espacios_fisicos_id;\n $l->pr_factura_id=$u->id;\n $l->save(); \n $u->lote_id=$l->id;\n $u->save();\n }\n }\n\t\t\techo \"<input type='hidden' name='id' id='id' value='$u->id'>\";\n \n\t}", "function alta_compra(){\n\t\t$u= new Pr_pedido();\n\t\t$u->get_by_id($_POST['id']);\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$usuario=$this->usuario->get_usuario($GLOBALS['usuarioid']);\n\t\t//Encargada de Tienda\n\t\tif ($usuario->puesto_id==6 or $usuario->puesto_id==7) {\n\t\t\t$u->corigen_pedido_id=3;\n\t\t\t$u->usuario_validador_id=$u->usuario_id;\n\t\t} else {\n\t\t\t$u->corigen_pedido_id=2;\n\t\t}\n\t\t$u->fecha_alta=date(\"Y-m-d H:i:s\");\n\t\t$related = $u->from_array($_POST);\n\t\t//Adecuar las Fechas al formato YYYY/MM/DD\n\t\t$fecha_pago=explode(\" \", $_POST['fecha_pago']);\n\t\t$fecha_entrega=explode(\" \", $_POST['fecha_entrega']);\n\t\t$u->fecha_pago=\"\".$fecha_pago[2].\"-\".$fecha_pago[1].\"-\".$fecha_pago[0];\n\t\t$u->fecha_entrega=\"\".$fecha_entrega[2].\"-\".$fecha_entrega[1].\"-\".$fecha_entrega[0] ;\n\t\t// save with the related objects\n\t\tif($u->save($related)) {\n\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\techo '<button type=\"submit\" id=\"boton1\" style=\"display:none;\">Actualizar Registro</button>';\n\t\t\techo \"<p id=\\\"response\\\">Datos Generales Guardados<br/><b>Capturar los detalles del pedido</b></p>\";\n\t\t} else\n\t\t\tshow_error(\"\".$u->error->string);\n\t}", "function reporteCotizacion(){\n\t\t$this->procedimiento='adq.f_cotizacion_sel';\n\t\t$this->transaccion='ADQ_COTREP_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t$this->setCount(false);\n\t\t\n\t\t$this->setParametro('id_cotizacion','id_cotizacion','int4');\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('estado','varchar');\n\t\t$this->captura('fecha_adju','date');\n\t\t$this->captura('fecha_coti','date');\n\t\t$this->captura('fecha_entrega','date');\n\t\t$this->captura('fecha_venc','date');\n\t\t$this->captura('id_moneda','int4');\n\t\t$this->captura('moneda','varchar');\n\t\t$this->captura('id_proceso_compra','int4');\n\t\t$this->captura('codigo_proceso','varchar');\n\t\t$this->captura('num_cotizacion','varchar');\n\t\t$this->captura('num_tramite','varchar');\n\t\t$this->captura('id_proveedor','int4');\n\t\t$this->captura('desc_proveedor','varchar');\n\t\t$this->captura('id_persona','int4');\n\t\t$this->captura('id_institucion','int4');\n\t\t$this->captura('dir_per', 'varchar');\n\t\t$this->captura('tel_per1', 'varchar');\n\t\t$this->captura('tel_per2', 'varchar');\n\t\t$this->captura('cel_per','varchar');\n\t\t$this->captura('correo','varchar');\n\t\t$this->captura('nombre_ins','varchar');\n\t\t$this->captura('cel_ins','varchar');\n\t\t$this->captura('dir_ins','varchar');\n\t\t$this->captura('fax','varchar');\n\t\t$this->captura('email_ins','varchar');\n\t\t$this->captura('tel_ins1','varchar');\n\t\t$this->captura('tel_ins2','varchar');\t\t\n\t\t$this->captura('lugar_entrega','varchar');\n\t\t$this->captura('nro_contrato','varchar');\t\t\n\t\t$this->captura('numero_oc','varchar');\n\t\t$this->captura('obs','text');\n\t\t$this->captura('tipo_entrega','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function actualizarsoloparesin($idkardex,$talla,$cantidad1,$iddetalleingreso,$idmodelodetalle,$precionuevo,$lineanuevo,$colornuevo,$materialnuevo,$return = false ){\n\n // $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n $sqlA[] = \"UPDATE historialkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla' and idperiodo='3';\";\n $sqlmarca = \" SELECT tabla,mesrango,idperiodo,fechainicio,fechafin FROM administrakardex WHERE idkardex = '$idkardex' \";\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"tabla\");\n $tabla = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"mesrango\");\n $mesrango = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"idperiodo\");\n $idperiodo = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"fechainicio\");\n $fechain = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"fechafin\");\n $fechafin = $opcionkardex['resultado'];\n if($fechafin==null ||$fechafin == \"\"){\n $fechaf = Date(\"Y-m-d\");}\n\n$select1 = \"SUM(i.cantidad) AS Pares\";\n $from1 = \"itemventa i,adicionkardextienda k, ventasdetalle vent\";\n $where1 = \"k.idcalzado = '$iddetalleingreso' AND i.idventa=vent.idventadetalle AND i.idkardextienda=k.idkardextienda AND\nk.talla='$talla' AND vent.fecha >= '$fechain'AND vent.fecha <= '$fechaf' and i.estado!='cambiado' \";\n $sql21 = \"SELECT \".$select1.\" FROM \".$from1. \" WHERE \".$where1;\n $almacenA1 = findBySqlReturnCampoUnique($sql21, true, true, 'Pares');\n $pares1 = $almacenA1['resultado'];\n if($pares1==NULL || $pares1 =='' || $pares1 == \"\"){ $pares1=\"0\"; }\n if($pares1=='0' ||$pares1==0){\n\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n\n } else{\n\n $cantidad1=$cantidad1-$pares1;\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n}\n//MostrarConsulta($sqlA);\nejecutarConsultaSQLBeginCommit($sqlA);\n\n}", "function index(){\r\n\r\n $data['sistema'] = $this->sistema;\r\n if($this->acceso(24)){\r\n \r\n \r\n //**************** inicio contenido ***************\r\n $producto_codigo = $this->input->post('producto_codigo');\r\n $parametros = $this->Parametro_model->get_parametros();\r\n $data['parametro'] = $parametros[0];\r\n \r\n $data['almacenes'] = $this->Inventario_model->get_almacenes();\r\n \r\n \r\n if ($producto_codigo==''){\r\n \r\n $data['rolusuario'] = $this->session_data['rol'];\r\n $empresa_id = 1;\r\n $data['page_title'] = \"Inventario\";\r\n $data['empresa'] = $this->Empresa_model->get_empresa($empresa_id);\r\n $data['_view'] = 'sucursales/index';\r\n $this->load->view('layouts/main',$data);\r\n \r\n }\r\n else{\r\n// \r\n $data['rolusuario'] = $this->session_data['rol'];\r\n $empresa_id = 1;\r\n \r\n $data['page_title'] = \"centralizador\";\r\n $data['empresa'] = $this->Empresa_model->get_empresa($empresa_id);\r\n \r\n $sql = \"select * from inventario i, inventario_sucursales s where i.producto_codigobarra = '\".$producto_codigo.\"' and i.producto_id = s.producto_id\";\r\n $inventario = $this->Venta_model->consultar($sql);\r\n \r\n $data['inventario'] = $inventario;\r\n \r\n $data['_view'] = 'sucursales/index';\r\n $this->load->view('layouts/main',$data);\r\n// \r\n }\r\n\t\r\n //**************** fin contenido ***************\r\n\r\n }\r\n\t\t\t\r\n }", "public function getSimulacionReajuste(){\n //calculando según el IPC acumulado\n //entre el último reajuste realizado y ahora. \n $mes_actual = (int)date(\"m\");\n $agno_actual = (int)date('Y');\n $mes_inicio = $mes_actual - $this->reajusta_meses;\n $agno_inicio = $agno_actual;\n if($mes_inicio <= 0){\n $agno_inicio -= 1;\n $mes_inicio+= 12;\n }\n $ipcs = array();\n if($agno_inicio != $agno_actual){\n $ipcs = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes >= :m and agno = :a','params'=>array(':m'=>$mes_inicio,':a'=>$agno_inicio)));\n $ipcs_actual = Ipc::model()->findAll(array('order'=>'mes','condition'=>'mes < :m and agno = :a','params'=>array(':m'=>$mes_actual,':a'=>$agno_actual)));\n foreach($ipcs_actual as $ipc){\n $ipcs[] = $ipc;\n }\n }\n else{\n $ipcs = Ipc::model()->findAll(array('condition'=>'mes >= :m1 and mes < :m2 and agno = :a','params'=>array(':m1'=>$mes_inicio,':m2'=>$mes_actual,':a'=>$agno_actual)));\n }\n\n $ipc_acumulado = 0;\n foreach($ipcs as $ipc){\n //sumo los ipcs para generar el ipc acumulado\n $ipc_acumulado+= $ipc->porcentaje;\n }\n //para hacer el cálculo según porcentaje\n $ipc_acumulado /= 100;\n\n //saco el último debe pagar para ver cuánto era lo que tenía que pagar antes\n $debePagars = DebePagar::model()->findAllByAttributes(array('contrato_id'=>$this->id),array('order'=>'id DESC'));\n $debePagar = $debePagars[0];\n \n $debeNuevo = new DebePagar();\n $debeNuevo->agno = $agno_actual;\n $debeNuevo->mes = $mes_actual;\n $debeNuevo->dia = $debePagar->dia;\n $debeNuevo->contrato_id = $this->id;\n //ahora hay que reajustar los montos del contrato dependiendo del ipc_acumulado\n //el precio base debe ser el valor anterior en debe pagar\n $debeNuevo->monto_gastocomun = intval($debePagar->monto_gastocomun*(1+$ipc_acumulado));\n $debeNuevo->monto_gastovariable = intval($debePagar->monto_gastovariable*(1+$ipc_acumulado));\n $debeNuevo->monto_mueble = intval($debePagar->monto_mueble*(1+$ipc_acumulado));\n $debeNuevo->monto_renta = intval($debePagar->monto_renta*(1+$ipc_acumulado));\n \n return array('actual'=>$debePagar, 'nuevo'=>$debeNuevo);\n }", "function entradas()\n\t{\n\t\t$listaProductos = $this->InventariosModel->listaProductos();\n\t\t$listaAlmacenes = $this->InventariosModel->listaAlmacenes(0,0);\n\t\t$salidasSinExistencia = $this->InventariosModel->salidasSinExistencia();\n\t\t$configuracionPeriodos = $this->InventariosModel->configPeriodos();\n\t\t$primer_ejercicio = $this->InventariosModel->ejerciciosDisponibles('ASC',$configuracionPeriodos['permitir_cerrados']);\n\t\t$ultimo_ejercicio = $this->InventariosModel->ejerciciosDisponibles('DESC',$configuracionPeriodos['permitir_cerrados']);\n $this->InventariosModel->generarAlmacenTransito('999');\n\n\t\trequire(\"views/inventarios/entradas.php\");\n\t}", "static public function ctrCrearVenta(){\n\n\t\tif(isset($_POST[\"nuevaVenta\"])){\n\n\t\t\t/*=============================================\n\t\t\tACTUALIZAR LAS COMPRAS DEL CLIENTE Y REDUCIR EL STOCK Y AUMENTAR LAS VENTAS DE LOS PRODUCTOS\n\t\t\t=============================================*/\n\n\t\t\tif($_POST[\"listaProductos\"] == \"\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"error\",\n\t\t\t\t\t title: \"La venta no se ha ejecuta si no hay productos\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"ventas\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\t$listaProductos = json_decode($_POST[\"listaProductos\"], true);\n\n\t\t\t$totalProductosComprados = array();\n\n\t\t\tforeach ($listaProductos as $key => $value) {\n\n\t\t\t array_push($totalProductosComprados, $value[\"cantidad\"]);\n\t\t\t\t\n\t\t\t $tablaProductos = \"productos\";\n\n\t\t\t $item = \"id\";\n\t\t\t $valor = $value[\"id\"];\n\t\t\t $orden = \"id\";\n\n\t\t\t $traerProducto = ModeloProductos::mdlMostrarProductos($tablaProductos, $item, $valor, $orden);\n\n\t\t\t\t$item1a = \"ventas\";\n\t\t\t\t$valor1a = $value[\"cantidad\"] + $traerProducto[\"ventas\"];\n\n\t\t\t $nuevasVentas = ModeloProductos::mdlActualizarProducto($tablaProductos, $item1a, $valor1a, $valor);\n\n\t\t\t\t$item1b = \"stock\";\n\t\t\t\t$valor1b = $value[\"stock\"];\n\n\t\t\t\t$nuevoStock = ModeloProductos::mdlActualizarProducto($tablaProductos, $item1b, $valor1b, $valor);\n\n\t\t\t}\n\n\t\t\t$tablaClientes = \"clientes\";\n\n\t\t\t$item = \"id\";\n\t\t\t$valor = $_POST[\"seleccionarCliente\"];\n\n\t\t\t$traerCliente = ModeloClientes::mdlMostrarClientes($tablaClientes, $item, $valor);\n\n\t\t\t$item1a = \"compras\";\n\t\t\t$valor1a = array_sum($totalProductosComprados) + $traerCliente[\"compras\"];\n\n\t\t\t$comprasCliente = ModeloClientes::mdlActualizarCliente($tablaClientes, $item1a, $valor1a, $valor);\n\n\t\t\t$item1b = \"ultima_compra\";\n\n\t\t\tdate_default_timezone_set('America/Bogota');\n\n\t\t\t$fecha = date('Y-m-d');\n\t\t\t$hora = date('H:i:s');\n\t\t\t$valor1b = $fecha.' '.$hora;\n\n\t\t\t$fechaCliente = ModeloClientes::mdlActualizarCliente($tablaClientes, $item1b, $valor1b, $valor);\n\n\t\t\t/*=============================================\n\t\t\tGUARDAR LA COMPRA\n\t\t\t=============================================*/\t\n\n\t\t\t$tabla = \"ventas\";\n\n\t\t\t$datos = array(\"id_vendedor\"=>$_POST[\"idVendedor\"],\n\t\t\t\t\t\t \"id_cliente\"=>$_POST[\"seleccionarCliente\"],\n\t\t\t\t\t\t \"codigo\"=>$_POST[\"nuevaVenta\"],\n\t\t\t\t\t\t \"productos\"=>$_POST[\"listaProductos\"],\n\t\t\t\t\t\t \"impuesto\"=>$_POST[\"nuevoPrecioImpuesto\"],\n\t\t\t\t\t\t \"neto\"=>$_POST[\"nuevoPrecioNeto\"],\n\t\t\t\t\t\t \"total\"=>$_POST[\"totalVenta\"],\n\t\t\t\t\t\t \"metodo_pago\"=>$_POST[\"listaMetodoPago\"]);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\techo'<script>\n\n\t\t\t\tlocalStorage.removeItem(\"rango\");\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"success\",\n\t\t\t\t\t title: \"La venta ha sido guardada correctamente\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"ventas\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function verDetalleUltimaCompra() {\n if ($this->input->is_ajax_request()) {\n $dato = $this->input->post('id');\n //campos: c.*,v.cod_venta,v.fecha,v.total,d.modelo,d.cantidad,d.precio,p.imagen\n $resp=$this->Cliente_model->detalleUltimaCompra($dato);//recibe una tabla con campos\n $html=\"<h4 class='pull-right'> Telf: \".$resp[0]->telefono.\"</h4>\";\n $html = $html . \"<p class='h4 text-primary'>\".$resp[0]->cod_venta.\"</p><span class='h4 pull-right'>fecha: \".$resp[0]->fecha.\"</span>\";\n $html = $html . \"<table class='table table-condensed table-hover'>\";\n $html = $html . \"<thead><th class='text-center'>Cant</th><th class='text-center'>Modelo</th><th class='text-center'>Precio</th><th class='text-center'>Subtotal</th></thead><tbody>\";\n foreach ($resp as $campo) {\n $html = $html . \"<tr class='text-center'><td>\".$campo->cantidad.\"</td>\";\n $html = $html . \"<td class='td-imagen'><img class='accional' src='\".base_url().\"sources/ups/\".$campo->imagen.\"'>\".$campo->modelo.\"</td>\";\n $html = $html . \"<td>\".$campo->precio.\"</td>\";\n $html = $html . \"<td>\".($campo->cantidad*$campo->precio).\"</td></tr>\";\n }\n $html = $html . \"<tr><td colspan='4' align='right'><h4> Total Bs. \".$resp[0]->total.\"</h4></td></tr></tbody>\";\n $html = $html . \"</table></div>\";\n \n echo $html;\n } else {\n show_404();\n }\n }", "public function actionCreate($id,$id_localizacion)\n {\n \n $desbloqueo=\"\"; $total_cargado=0;\n\n $model= new AccionCentralizadaVariableEjecucion();\n //buscando el modelo de la programacion\n $model_programacion = AccionCentralizadaVariableProgramacion::find()->where(['id_localizacion' => $id_localizacion])->All();\n //sacando el total de los trimestres de la programacion asociada a esta ejecución\n $total=$model_programacion[0]['TotalTrimestre']==\"\" ? 0 : $model_programacion[0]['TotalTrimestre'];\n $model_inicial = AccionCentralizadaVariableEjecucion::find()->where(['id_programacion'=> $model_programacion[0]['id']])->asArray()->One();\n $model->id_programacion=$model_programacion[0]['id'];\n $model->id_usuario=Yii::$app->user->getId();\n \n $hoy = getdate();\n $fecha=$hoy['year'].\"/\".$hoy['mon'].\"/\".$hoy['mday'].\" \".$hoy['hours'].\":\".$hoy['minutes'].\":\".$hoy['seconds'];\n $model->fecha=$fecha;\n $desbloqueo[0]=0; \n\n //verificar campos bloqueado\n if($model_inicial==NULL)\n {\n //primera vez que carga, deberia habilitarse solamente enero\n $desbloqueo[0]=1;\n\n }else\n {\n //verificar mes pendiente con la fecha o ultima carga realizada y fecha\n if($model_inicial['diciembre']==NULL && (($hoy['mon']==12 && $hoy['mday']>=5) || ($hoy['mon']>12)))\n $desbloqueo[0]=12;\n if($model_inicial['noviembre']==NULL && (($hoy['mon']==11 && $hoy['mday']>=5) || ($hoy['mon']>11)))\n $desbloqueo[0]=11;\n if($model_inicial['octubre']==NULL && (($hoy['mon']==10 && $hoy['mday']>=5) || ($hoy['mon']>10)))\n $desbloqueo[0]=10;\n if($model_inicial['septiembre']==NULL && (($hoy['mon']==9 && $hoy['mday']>=5) || ($hoy['mon']>9)))\n $desbloqueo[0]=9;\n if($model_inicial['agosto']==NULL && (($hoy['mon']==8 && $hoy['mday']>=5) || ($hoy['mon']>8)))\n $desbloqueo[0]=8;\n if($model_inicial['julio']==NULL && (($hoy['mon']==7 && $hoy['mday']>=5) || ($hoy['mon']>7)))\n $desbloqueo[0]=7;\n if($model_inicial['junio']==NULL && (($hoy['mon']==6 && $hoy['mday']>=5) || ($hoy['mon']>6)))\n $desbloqueo[0]=6;\n if($model_inicial['mayo']==NULL && (($hoy['mon']==5 && $hoy['mday']>=5) || ($hoy['mon']>5)))\n $desbloqueo[0]=5;\n if($model_inicial['abril']==NULL && (($hoy['mon']==4 && $hoy['mday']>=5) || ($hoy['mon']>4)))\n $desbloqueo[0]=4;\n if($model_inicial['marzo']==NULL && (($hoy['mon']==3 && $hoy['mday']>=5) || ($hoy['mon']>3)))\n $desbloqueo[0]=3;\n if($model_inicial['febrero']==NULL && (($hoy['mon']==2 && $hoy['mday']>=5) || ($hoy['mon']>2)))\n $desbloqueo[0]=2;\n\n //verificamos si desde el backend se le dio permiso para habilitar campos\n $permisos_espe = AccionCentralizadaDesbloqueoMes::find()->where(['id_ejecucion'=> $model_inicial['id']])->asArray()->All();\n \n if($permisos_espe!=\"\")\n {\n\n foreach ($permisos_espe as $key) \n {\n // se cargan los meses que se le dio permiso de carga\n \n $desbloqueo[$key['mes']]='1';\n }\n }\n\n $model = $this->findModel($model_inicial['id']);\n $total_cargado=$model->enero+$model->febrero+$model->marzo+$model->abril+$model->mayo+$model->junio+$model->julio+$model->agosto+$model->septiembre+$model->octubre+$model->noviembre+$model->diciembre;\n\n }//fin else modelo con datos\n\n\n \n\n if ($model->load(Yii::$app->request->post()) && $model->save()) \n {\n return $this->redirect(['create', 'id' => $id, 'id_localizacion' => $id_localizacion]);\n }\n else \n {\n return $this->render('create', [\n 'model' => $model,\n 'model_programacion' => $model_programacion,\n 'total' => $total,\n 'desbloqueo' => $desbloqueo,\n 'total_cargado' => $total_cargado,\n\n ]);\n }\n }", "public function generaReemplazo(){\n\t\tif( $this->idTipoInhabilidad->reemplazo ){\n\t\t\t//Valida si inhabilidad solicita fecha inicio\n\t\t\tif( $this->idTipoInhabilidad->fecha_inicio ){\n\t\t\t\t//Valida fecha inicio igual a hoy\n\t\t\t\tif( strtotime($this->fecha_inicio) == strtotime(date(\"Y-m-d\")) ){\n\t\t\t\t\t$casos = Trazabilidad::model()->findAllByAttributes(array(\"user_asign\"=>$this->usuario, \"estado\"=>\"1\"));\n\t\t\t\t\tif($casos){\n\t\t\t\t\t\tforeach ($casos as $traza){\n\t\t\t\t\t\t\t$modelAusente = new AusenteTrazabilidad;\n\t\t\t\t\t\t\t$modelAusente->usuario = $this->usuario;\n\t\t\t \t\t$modelAusente->id_trazabilidad = $traza->id;\n\t\t\t \t\tif($modelAusente->save()){\n\t\t\t \t\t\t$traza->user_asign = $this->reemplazo;\n\t\t\t \t\t\t$traza->update();\n\t\t\t \t\t}\n\t\t\t \t\t$observacion_traza = new ObservacionesTrazabilidad;\n\t\t\t \t\t$observacion_traza->id_trazabilidad = $traza->id;\n\t\t\t \t\t$observacion_traza->observacion = \"Caso reasignado por inhabilidad de usuario\";\n\t\t\t \t\t$observacion_traza->usuario = Yii::app()->user->usuario;\n\t\t\t \t\t$observacion_traza->na = $traza->na;\n\t\t\t \t\t$observacion_traza->save();\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}else if(empty($this->idTipoInhabilidad->fecha_inicio) && $this->id_tipo_inhabilidad == \"4\"){\n\t\t\t\t$casos = Trazabilidad::model()->findAllByAttributes(array(\"user_asign\"=>$this->usuario, \"estado\"=>\"1\"));\n\t\t\t\tif($casos){\n\t\t\t\t\tforeach ($casos as $traza){\n\t\t\t\t\t\t$modelAusente = new AusenteTrazabilidad;\n\t\t\t\t\t\t$modelAusente->usuario = $this->usuario;\n\t\t \t\t$modelAusente->id_trazabilidad = $traza->id;\n\t\t \t\tif($modelAusente->save()){\n\t\t \t\t\t$traza->user_asign = $this->reemplazo;\n\t\t \t\t\t$traza->update();\n\t\t \t\t}\n\t\t \t\t$observacion_traza = new ObservacionesTrazabilidad;\n\t\t \t\t$observacion_traza->id_trazabilidad = $traza->id;\n\t\t \t\t$observacion_traza->observacion = \"Caso reasignado por inhabilidad de usuario\";\n\t\t \t\t$observacion_traza->usuario = Yii::app()->user->usuario;\n\t\t \t\t$observacion_traza->na = $traza->na;\n\t\t \t\t$observacion_traza->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.70804447", "0.7056116", "0.70163125", "0.7016204", "0.69603395", "0.69470924", "0.69459856", "0.69406796", "0.69257", "0.68913454", "0.68781406", "0.6835421", "0.68307877", "0.68129164", "0.680103", "0.6781885", "0.6760402", "0.6752206", "0.6743059", "0.67291486", "0.6726979", "0.6702124", "0.6689308", "0.6686136", "0.6678029", "0.66719365", "0.6670224", "0.6662415", "0.66519076", "0.6648706", "0.6644967", "0.66437787", "0.66394997", "0.6628677", "0.6627909", "0.66233915", "0.6620872", "0.661116", "0.66033447", "0.6602435", "0.6592145", "0.6586628", "0.6577704", "0.65770483", "0.65769285", "0.6569574", "0.6566647", "0.65507835", "0.6548928", "0.6548191", "0.6535736", "0.65337586", "0.6532994", "0.65324974", "0.6530014", "0.652923", "0.6523978", "0.6519705", "0.65176356", "0.6515105", "0.65095186", "0.6508741", "0.6503952", "0.64982826", "0.64965826", "0.6477248", "0.6474326", "0.6471476", "0.6471182", "0.64699453", "0.6469265", "0.6465843", "0.6465317", "0.64554363", "0.64542943", "0.6452412", "0.6451001", "0.64433444", "0.6439378", "0.64386857", "0.6435742", "0.64351386", "0.6435062", "0.6431061", "0.6429712", "0.6428073", "0.6427043", "0.64211357", "0.6414516", "0.64144236", "0.6413544", "0.64135337", "0.64122343", "0.64102775", "0.64078295", "0.6400107", "0.6394972", "0.6393354", "0.6391612", "0.63883346", "0.6386508" ]
0.0
-1
Display a listing of the resource.
public function index() { $packages = Package::latest()->paginate(10); return view('admin.packages.index',compact('packages')); }
{ "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() { return view('admin.packages.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(StorePackageRequest $request) { $request->persist(); return redirect()->back()->with('status' , __('admin.created') ); }
{ "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($id) { $package = Package::find($id); return view('admin.packages.show',compact('package')); }
{ "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($id) { $package = Package::find($id); return view('admin.packages.edit',compact('package')); }
{ "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(EditPackageRequest $request, $id) { $request->persist($id); return redirect()->back()->with('status' , __('admin.updated') ); }
{ "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(Request $request, $id) { if ($request->ajax()) { Package::find($id)->delete(); return response(['msg' => 'deleted', 'status' => 'success']); } }
{ "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
this file contain utility functions. Display any one dimensional array.
function array_display($array_name) { $r = ''; $r .= '<style> table,td,th{border: solid 2px black;}</style>'; $r .= '<table>'; $r .= '<tr>'; $r .= '<th>Index/Key</th>'; $r .= '<th>Value</th>'; $r .= '</tr>'; foreach ($array_name as $index => $value) { $r .= '<tr>'; $r .= '<td> '.$index.' </td>'; if ($index == 'price') { $r .= '<td> $'.$value.' </td>'; $r .= '</tr>'; } else { $r .= '<td>'.$value.' </td>'; $r .= '</tr>'; } } $r .= '</table>'; return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function DisplayArray($array)\r\n {\r\n $depth = 0;\r\n if (is_array($array))\r\n {\r\n echo \"Array (<br />\";\r\n for($i = 0; $i < count($array); $i ++)\r\n {\r\n if (is_array($array[$i]))\r\n {\r\n DisplayInlineArray($array[$i], $depth + 1, $i);\r\n }\r\n else\r\n {\r\n echo \"[\" . $i . \"] => \" . $array[$i];\r\n echo \"<br />\";\r\n $depth = 0;\r\n }\r\n }\r\n echo \")<br />\";\r\n }\r\n else\r\n {\r\n echo \"Variabele is geen array\";\r\n }\r\n }", "function DisplayArray($array) {\n foreach ($array as $value) {\n if (is_array($value)) {\n DisplayArray($value);\n } else {\n echo $value . \"<br>\";\n }\n }\n }", "function diplayArray($array){\n echo '<pre>';\n var_dump($array);\n echo'</pre>';\n}", "public static function print2DArray($array, $border) {\r\n\r\n/* This function loops through an associative\r\n array and prints out all the values in a \r\n table. This is used for diagnostic\r\n purposes primarily, although there \r\n can be other applications. */\r\n \r\n // Check that the array exists\r\n if (!$array) {\r\n echo \"No array specified.<BR><BR>\";\r\n return;\r\n }\r\n \r\n else {\r\n // Start table\r\n echo \"<TABLE BORDER=$border>\";\r\n \r\n // Print the array in table cells\r\n while (list($key, $value) = each ($array)) {\r\n echo \"<TR><TD>$key</TD><TD>$value</TD></TR>\"; \r\n } // end of while loop\r\n \r\n // End table and return\r\n echo \"</TABLE>\";\r\n return;\r\n } // end of else\r\n\r\n}", "private function printArray($array){\n\t\techo \"<pre>\".print_r($array,true).\"</pre>\";\n\t}", "function printArray($array){\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n }", "public static function printArray($array, $border) {\r\n\r\n/* This function loops through a simple (1D)\r\n array and prints out all the values in a \r\n table. This is used for diagnostic\r\n purposes primarily, although there \r\n can be other applications. */\r\n \r\n // Check that the array exists\r\n if (!$array) {\r\n echo \"No array specified.<BR><BR>\";\r\n return;\r\n }\r\n \r\n else {\r\n // Start table\r\n echo \"<TABLE BORDER=$border>\";\r\n \r\n // Print the array in table cells\r\n foreach ($array as $value) {\r\n echo \"<TR><TD>$value</TD></TR>\"; \r\n } // end of while loop\r\n \r\n // End table and return\r\n echo \"</TABLE>\";\r\n return;\r\n } // end of else\r\n\r\n}", "function angela_print_array($arr, $spaces = 0)\n{\n\t$sp=$spaces+1;\n\t\n\tif (is_array($arr))\n\t\tforeach ( $arr as $arrkey => $arrval )\n\t\t{\n\t\t\tfor ($i=0; $i<$spaces; $i++) echo \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"; \n\t\t\techo \"[$arrkey] => <br>\\n\";\n\t\t\tangela_print_array($arrval, $sp);\n\t\t}\n\telse\n\t{\n\t\tfor ($i=0; $i<$spaces; $i++) echo \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"; \n\t\tif (!isset($arr))\n\t\t\techo \"-- empty --<br>\";\n\t\telse\n\t\t\techo \"$arr <br>\";\n\t}\n}", "function print_array($array) {\n\n echo \"<pre>\";\n\n print_r($array);\n\n echo \"</pre>\";\n\n }", "function printArray($array)\n\t{\n\t\tif (empty($array) and !is_array($array) ){\n\t\t\treturn FALSE;\n\t\t}else{\n\t\t\techo \"<pre>\";\n\t\t\tprint_r( $array );\n\t\t\techo \"</pre>\";\n\t\t}\n\t\t\n\t}", "function printArray($array){\n print '<pre>';\n print_r($array);\n print '</pre>';\n}", "function myShowArray($data)\n{\n echo '<pre>';\n print_r($data);\n echo '</pre>';\n}", "function print_array($array)\r\n{\r\n\techo '<pre>';\r\n\tprint_r($array);\r\n\techo '</pre>';\r\n}", "static function printr($array)\n {\n echo '<pre>' . print_r($array, true) . '</pre>';\n }", "function printArray($data)\r\n{\r\n\techo \"<pre>\";\r\n\tprint_r($data);\r\n\techo \"</pre>\";\r\n}", "function display2DArray($array,$printoptionsflag){\n\t\tif($array==null){\n\t\t\tprint \"No results were found!\";\n\t\t} else {\n\t\t\tprint \"<table class=\\\"clients\\\"><tr>\";\n\t\t\t$first = $array[0];\n\t\t\t$keys = array_keys($first); //Return the keys of the array, use first element;\n\t\t\tfor ($i=0;$i<count($keys);$i++){\n\t\t\t\tprint \"<td>\".$keys[$i].\"</td>\\n\";\n\t\t\t}\n\t\t\tprint \"</tr>\";\n\t\t\tfor ($j=0;$j<count($array);$j++){\n\t\t\t\tprint \"<tr>\";\n\t\t\t\tfor ($i=0;$i<(count($keys));$i++){\n\t\t\t\t\tprint \"<td>\".$array[$j][$keys[$i]].\"</td>\\n\";\n\t\t\t\t}\n\t\t\t\tif ($printoptionsflag){\n\t\t\t\t\t$this->printOptions($array[$j]['Client_ID']);\n\t\t\t\t}\n\t\t\t\tprint \"</tr>\\n\";\n\t\t\t}\n\t\t\tprint \"</table>\\n\";\n\t\t}\n\t}", "function printarr($a, $descr = '') \r\n{\r\n\tif (!is_array($a)) \r\n\t{\r\n\t\tob_start();\r\n\t\tif (!empty($descr))\r\n\t\t{\r\n\t\t\tprintbr('<b>' . $descr . '</b>');\r\n\t\t}\r\n\t\tvar_dump($a);\r\n\t\t$str = ob_get_clean();\r\n\t\tprintNicely($str);\r\n\t} else {\r\n\t\tob_start();\r\n\t\tprint '<pre>';\r\n\t\tif (!empty($descr))\r\n\t\t{\r\n\t\t\tprint('<b>' . $descr . '</b>' . \"\\n\");\r\n\t\t}\r\n\t\tprint_r($a);\r\n\t\tprint '</pre>';\r\n\t\t$str = ob_get_clean();\r\n\t\tprintNicely($str);\r\n\t}\r\n}", "function usingArraysMult()\r\n{ \r\n echo '<span style=\"color:teal;\r\n margin-left:-15px;\">\r\n 1) Print arrays elements by using Multidimensional Arrays.\r\n </span>'. \"<br>\";\r\n echo \"<br>\";\r\n \r\n $fullForms = array (\r\n array(\"HTML \", \"Hypertext\",\" Markup Language\"),\r\n array(\"CSS \",\"Cascading\",\" Style Sheets\"),\r\n array(\"JS \",\"Java\",\"Script\")\r\n );\r\n \r\n $sizeOfArray = count($fullForms); \r\n \r\n if($sizeOfArray<1)\r\n {\r\n throw new Exception(\"Array is empty!!!\");\r\n } \r\n \r\n echo $fullForms[0][0].\": \".$fullForms[0][1].$fullForms[0][2].\".<br><br>\";\r\n echo $fullForms[1][0].\": \".$fullForms[1][1].$fullForms[1][2].\".<br><br>\";\r\n echo $fullForms[2][0].\": \".$fullForms[2][1].$fullForms[2][2].\".<br><br>\";\r\n}", "function print_array($data){\n echo '<pre>';\n print_r($data);\n echo '</pre>';\n }", "function print_r_html ($arr) {\n\techo \"<pre>\";\n print_r($arr);\n echo \"</pre>\";\n}", "function printArray($array){\n\t\tforeach ($array as $key => $value) {\n\t\t\tprint(\"{$key}: $value<br />\");\n\t\t}\n\t}", "function display($arr)\r\n {\r\n $str = implode($arr);\r\n echo $str.'<br />';\r\n\r\n }", "function printr($array, $print = true) { //imprime o devuelve la cadena\n if ($print)\n return print_r($array, true);\n else\n echo '<pre>' . print_r($array, true) . '</pre>'; //tabula bien gracias a los <pre>\n }", "function printArray($objArray) {\r\n\t\tglobal $global_config;\r\n\t\tif($global_config[\"debug_mode\"] == \"1\"){\r\n\t\t\tif(is_array($objArray)) {\r\n\t\t\t\tprint \"<PRE>\";\r\n\t\t\t\tprint_r($objArray);\r\n\t\t\t\tprint \"</PRE>\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint $objArray.\" <br> \";\r\n\t\t}\t\r\n\t}", "function printArr( $array )\n{\n foreach($array as $x)\n {\n echo \"$x <br>\";\n }\n}", "function dump($array) {\n\treturn \"<pre>\" . htmlentities(print_r($array, 1)) . \"</pre>\";\n}", "function _pre($array) { echo '<pre>'; print_r ($array); echo '</pre>'; }", "function dump_array($the_array)\n{\n echo \"<ul>\";\n\n foreach ($the_array as $key1 => $value1) {\n echo \"<li><span class='key'>$key1</span>\";\n\n # If the value is itself an array, then print that as well.\n if (is_array($value1)) {\n echo \"<ul>\";\n foreach ($value1 as $key2 => $value2) {\n $pvalue = $value2;\n if (is_array($value2)) {\n $pvalue = \"&lt;an array&gt;\";\n }\n echo \"<li><span class='key'>$key2</span><span class='value'> $pvalue</span></li>\\n\";\n } # end inner foreach ($value1 as $key2 => $value2)\n echo \"</ul></li>\\n\";\n } else {\n echo \"<span class='value'> $value1</span></li>\\n\";\n }\n } # end outer foreach ($the_array as $key1 => $value1)\n echo \"</ul>\\n\";\n}", "function pr($array)\n{\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n}", "function l($array) {\n\techo '<div style=\"position: absolute; z-index: 2000; background: #66cc99; '\n\t.'bottom: 30px; right: 30px; height: 40%; '\n\t.'width: 75%; padding:5px; overflow: auto; -moz-opacity: 0.88\">';\n\techo \"<pre>\";\n\tprint_r($array);\n\techo '</div>';\n}", "function dump_array($array)\n{\n\n\t$_str = \"<table bgcolor = '%s'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table><br>\";\n\n\tif(is_array($array)){\n\n\t\t$size = count($array);\n\t\t$string = \"\";\n\n\t\tif($size) {\n\n\t\t\t$string .= \"{ <br>\";\n\n\t\t\tforeach($array as $a => $b) {\n\n\t\t\t\tif(is_array($b)) { $b = dump_array($b); }\n\t\t\t\tif(is_object($b)) { $b = dump_array(object_to_array($b)); }\n\t\t\t\t$string .= \"&nbsp;&nbsp;&nbsp;&nbsp;<b>$a = '$b'</b><br>\";\n\n \t\t}\n\n\t\t\t$string .= \" }<br>\";\n\t\t}\n\n\t\t$r = sprintf($_str, '#DACE0B', $string);\n\n\t\treturn $r;\n\n } else { return $array; }\n}", "function show_array($array, $die=true){\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n if($die){\n die();\n }\n}", "function echoResult($myarray){\n\t\t\t$ctr = 1;\n\t\t\tforeach($myarray as $entry){\n\t\t\t\techo \"<p>$ctr : $entry</p>\";\n\t\t\t\t$ctr += 1;\n\t\t\t}\n\t\t}", "function print_array($array,$exit = false) {\n echo '<pre>';\n print_r($array);\n echo '</pre>';\n if($exit) {\n exit();\n }\n}", "function preShow( $arr, $returnAsString=false ) {\n $ret = '<pre>' . print_r($arr, true) . '</pre>';\n if ($returnAsString)\n return $ret;\n else\n echo $ret;\n}", "function da( $TheArray ){ // Note: the function is recursive\r\n\tif(!is_array($TheArray)){\r\n\t\treturn \"no array\";\r\n\t}\r\n\techo \"<table border=0>\\n\";\r\n\t$Keys = array_keys( $TheArray );\r\n\tforeach( $Keys as $OneKey ){\r\n\t\techo \"<tr>\\n\";\r\n\t\techo \"<td bgcolor='#727450'>\";\r\n\t\techo \"<B>\" . $OneKey . \"</B>\";\r\n\t\techo \"</td>\\n\";\r\n\t\techo \"<td bgcolor='#C4C2A6'>\";\r\n\t\tif ( is_array($TheArray[$OneKey]) ){\r\n\t\t\tda($TheArray[$OneKey]);\r\n\t\t}else{\r\n\t\t\techo $TheArray[$OneKey];\r\n\t\t}\r\n\t\techo \"</td>\\n\";\r\n\t\techo \"</tr>\\n\";\r\n\t}\r\n\techo \"</table>\\n\";\r\n}", "function htmldump ( $array ) {\r\n\t\tforeach($array as $key => $val) {\r\n\t\t\t$return .= $this->ul(\r\n\t\t\t\t\t\t$this->li($this->font($key)) .\r\n\t\t\t\t\t\t\t$this->ul(\r\n\t\t\t\t\t\t\t\t$this->font(is_array($val) ? $this->htmldump($val) : $this->li($val))\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\treturn $return;\r\n\t}", "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}", "function pprint($array, $file_name='array'){\n /**\n * Pretty print Arrays - in collapsible and scrollable boxes\n *\n * @param Array to be printed\n * @param String as name of the printed box\n *\n * @return HTML non semantic...\n */\n $id = random_int(0, 999);\n echo '<style type=\"text/css\">input#'.$id.':checked ~ div.ijwe {display: none;}</style>';\n echo '<br><div style=\"background-color:#b1b1b1; border: 1px solid #949494; width:96%; margin: auto;\">';\n echo '<input type=\"checkbox\" id=\"toggle-'.$id.'\" style=\"display:inline; width:15px; background-color:transparent;\"><label style=\" white-space:nowrap; clear: both; width:0px;\" for=\"toggle-'.$id.'\"><h3 style=\"display:inline; line-height: 2px; margin: 1em;\">'.$file_name.':</h3></label>';\n echo '<div class=\"ijwe\" style=\"background-color:#c4c4c4; overflow-y: scroll; padding: 0.3em; max-height:400px;\"><pre><xmp>';\n print_r($array);\n echo '</xmp></pre></div>';\n echo '</div>';\n}", "function display_result($array) {\n\tforeach ($array as $entry) {\n\t\tif ($entry != '')\n\t\t\techo \"<li>\" . $entry . \"</li>\\n\";\n\t}\n}", "public function easyPrint($array, $die = 0) {\n\t\tprint \"<pre>\";\n\t\tprint_r($array);\n\t\tprint \"</pre>\";\t\n $die == 1 ? die() : \"\";\n\t}", "function pr ($arr) \n{\n echo '<pre>'; print_r($arr); echo '</pre>';\n}", "function xmp_print($array, $title = '') {\n\tif (!empty($title)) {\n\t\techo \"$title:<br>\\n\";\n\t}\n\techo \"<xmp>\";\n\tprint_r($array);\n\techo \"</xmp>\";\n}", "function debug($arr)\n{\n echo '<pre>' . print_r($arr, true) . '</pre>';\n}", "function debug($arr)\n{\n echo '<pre>' . print_r($arr, true) . '</pre>';\n}", "public static function printTwoDArray($rows, $cols, $arr)\n {\n // echo \"enter 1 :Integer 2: string\";\n echo \"enter the \" . $rows * $cols . \" elements\";\n\n /** enter the values into an array */\n for ($i = 0; $i < $rows; $i++) {\n for ($j = 0; $j < $cols; $j++) {\n $twoDArr[$i][$j] = Utility::readInt();\n }\n }\n\n /**print the array */\n for ($i = 0; $i < $rows; $i++) {\n for ($j = 0; $j < $cols; $j++) {\n print $twoDArr[$i][$j] . \" \";\n }\n echo \"\\n\";\n }\n// print_r($twoDArr);\n }", "function\teeps_printr($a, $level)\t{\n if (is_array($a))\t{\n $name = key($a);\n echo\t\"<br>\";\n for ($i = 0; $i < $level*2; $i++)\techo \"&nbsp;&nbsp;\";\n echo \"<strong>ARRAY $name</strong>\";\n foreach ($a as $e)\t{\n eeps_printr($e, $level + 1);\n }\n }\n else {\n if (strlen($a) != 0)\t{\n echo\t\"<br>\";\n for ($i = 0; $i < $level*2; $i++)\techo \"&nbsp;&nbsp;\";\n echo \"$a\";\n }\n }\n}", "function debug($arr) {\n echo \"<pre>\" . print_r($arr, true) . \"</pre>\";\n}", "protected function renderArray() {}", "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 viewArray($array_in) {\n\t\tif (is_array($array_in)) {\n\t\t\t$result = '<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"white\">';\n\t\t\tif (count($array_in) == 0) {\n\t\t\t\t$result .= '<tr><td><font face=\"Verdana,Arial\" size=\"1\"><strong>EMPTY!</strong></font></td></tr>';\n\t\t\t} else {\n\t\t\t\tforeach ($array_in as $key => $val) {\n\t\t\t\t\t$result .= '<tr><td valign=\"top\"><font face=\"Verdana,Arial\" size=\"1\">' . htmlspecialchars((string)$key) . '</font></td><td>';\n\t\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t\t$result .= self::viewArray($val);\n\t\t\t\t\t} elseif (is_object($val)) {\n\t\t\t\t\t\t$string = '';\n\t\t\t\t\t\tif (method_exists($val, '__toString')) {\n\t\t\t\t\t\t\t$string .= get_class($val) . ': ' . (string)$val;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$string .= print_r($val, TRUE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result .= '<font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' . nl2br(htmlspecialchars($string)) . '<br /></font>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (gettype($val) == 'object') {\n\t\t\t\t\t\t\t$string = 'Unknown object';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$string = (string)$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result .= '<font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' . nl2br(htmlspecialchars($string)) . '<br /></font>';\n\t\t\t\t\t}\n\t\t\t\t\t$result .= '</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result .= '</table>';\n\t\t} else {\n\t\t\t$result = '<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"white\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' .\n\t\t\t\tnl2br(htmlspecialchars((string)$array_in)) .\n\t\t\t\t'<br /></font></td>\n\t\t\t</tr>\n\t\t</table>'; // Output it as a string.\n\t\t}\n\t\treturn $result;\n\t}", "function pre_print_r($array){\n\n\techo '<pre style=\"font-family: monospace; font-size: 14px; text-align:left!important\">';\n\tprint_r($array);\n\techo '</pre>';\n\n}", "function printr($array, $return = false) {\n $str = '<pre>' . print_r($array, true) . '</pre>';\n if (!$return) {\n echo $str;\n } else {\n return $str;\n }\n}", "function dbga($array){\n echo '<div class=\"dbg\"><pre>';\n print_r($array);\n echo '</pre></div>';\n }", "function printc($data)\n{\n if(is_array($data)) {\n print_r($data);\n } else {\n print($data.\"\\n\");\n }\n}", "function tfjecho($array) {\r\n die(json_encode($array));\r\n }", "function print_pre($array){\n\t\techo '<pre>';\n\t\tprint_r($array);\n\t\techo '</pre>';\n\t}", "public function print_array($title, $array)\n {\n\n if (is_array($array)) {\n echo $title .\n \"||---------------------------------||\" . PHP_EOL;\n print_r($array);\n echo \"END \" . $title .\n \"||---------------------------------||\" . PHP_EOL;\n } else {\n echo $title . \" is not an array.\";\n }\n }", "function dumpArray($elements) {\n $result = \"<ol>\\n\";\n foreach ($elements as $key => $value) {\n if (is_array($value)) {\n $result .= \"<li>Key <b>$key</b> is an array\n containing:\\n\" . dumpArray($value) . \"</li>\";\n } else {\n $value = nl2br(htmlspecialchars($value));\n $result .= \"<li>Key <b>$key</b> has value [<b>$value</b>]</li>\\n\";\n }\n }\n return $result . \"</ol>\\n\";\n}", "function echoContents($data)\r\n{\r\n if (is_array($data))\r\n {\r\n foreach ($data as $subItem)\r\n {\r\n echoContents($subItem);\r\n }\r\n }\r\n \r\n else\r\n { \r\n echo $data;\r\n }\r\n}", "function displayArray(Array $a)\n{\n $sum = array_sum($a);\n \n return $sum;\n}", "function alist ($array) { //This function prints a text array as an html list.\n $alist = \"<ul>\";\n for ($i = 0; $i < sizeof($array); $i++) {\n $alist .= \"<li>$array[$i]\";\n }\n $alist .= \"</ul>\";\n return $alist;\n}", "public function outputFunction($array, $depth=0, $tab=\"&nbsp;&nbsp;\") {\n foreach ($array as $key=>$value) {\n // line break\n for ($i=0; $i<$depth; $i++) echo $tab;\n if (is_numeric($key)) {\n echo $key.' => ';\n }\n else {\n echo '\\''.$key.'\\' => ';\n }\n if (is_array($value)) {\n echo 'array('.\"\\n\";\n $this->outputFunction($value, $depth+1);\n // line break\n for ($i=0; $i<$depth; $i++) echo $tab;\n echo '),'.\"\\n\";\n }\n else {\n // value\n if (is_numeric($value)) {\n echo $value.','.\"\\n\";\n }\n else {\n echo '\\''.$value.'\\','.\"\\n\";\n }\n }\n }\n }", "public function displayArray()\r\n\t{\r\n\t\t$this->addThingsToPrint(\"<h2><a href=\\\"\" . $this->contentURL . \"\\\">\" . $this->contentURL . \"</a></h2>\");\r\n\t\t$this->addThingsToPrint(\"<pre>\" . print_r(json_decode($this->getJsonData()), TRUE) . \"</pre>\");\r\n\t\t$fullContent = RestUtils::getHTTPHeader('Testing') . $this->dataToPrint . RestUtils::getHTTPFooter(); \r\n\t\tRestUtils::sendResponse(200, $fullContent);\r\n\t}", "function dump($title, $array) {\n echo '---=[ ' . $title . ' ]=---'. PHP_EOL;\n var_dump($array);\n}", "function show($data)\n{\n echo \"<pre>\";\n print_r($data);\n echo \"</pre>\";\n}", "function list_array( $des_array ){\n\tif( is_array( $des_array ) ){\n\t\techo '<ul>';\n\t\tforeach( $des_array as $item ){\n\t\t\techo '<li>' . $item . '</li>';\n\t\t}\n\t\techo '</ul>';\n\t}\n}", "function print_r_xml($arr,$first=true)\r\n{\r\n $output = \"\";\r\n if ($first) $output .= \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<data>\\n\";\r\n foreach($arr as $key => $val)\r\n {\r\n if (is_numeric($key)) $key = \"arr_\".$key; // <0 is not allowed\r\n switch (gettype($val))\r\n {\r\n case \"array\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='array' size='\".count($val).\"'>\".\r\n print_r_xml($val,false).\"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n case \"boolean\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='bool'>\".($val?\"true\":\"false\").\r\n \"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n case \"integer\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='integer'>\".\r\n htmlspecialchars($val).\"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n case \"double\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='double'>\".\r\n htmlspecialchars($val).\"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n case \"string\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='string' size='\".strlen($val).\"'>\".\r\n htmlspecialchars($val).\"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n default:\r\n $output .= \"<\".htmlspecialchars($key).\" type='unknown'>\".gettype($val).\r\n \"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n }\r\n }\r\n if ($first) $output .= \"</data>\\n\";\r\n return $output;\r\n}", "function print_r_slim($arr, $no_print=false)\r\n{\r\n $out = print_r($arr, true);\r\n\r\n $out = str_replace(\" \", \"\", $out);\r\n $out = str_replace(\"\\n\", \", \", $out);\r\n $out = str_replace(\", )\", \"), \", $out);\r\n $out = str_replace(\", , \", \"\", $out);\r\n $out = str_replace(\", (, \", \"(\", $out);\r\n $out = str_replace(\"Array, \", \"Array\", $out);\r\n $out = str_replace(\"Object\", \" Object\", $out);\r\n\r\n if (!$no_print)\r\n {\r\n echo $out;\r\n return;\r\n }\r\n\r\n return $out;\r\n}", "function displayClass($arr) {\n\t\techo \"------------***---------------<br>\";\n\t\t$i = 1;\n\t\tforeach($arr as $arrNew) {\n\t\t\techo $i.', '.$arrNew['name'].' - '.$arrNew['birthday'].' - '.$arrNew['email'].'<br>';\n\t\t\t$i++;\n\t\t}\n\t}", "public function DebugArray($array)\n\t{\n\t\t\n\t\techo '<pre>';\n\t\tvar_dump($array);\n\t\tprint_r($array);\n\t\techo '</pre>';\n\t\tdie();\n\t\t\n\t}", "private function arrayToPrint()\n\t{\n\t\t$this->view->addToReplace($this->langArr);\n\t\t$this->view->addToReplace($this->arrRender);\n\t\t$this->arrRender['CONTENT'] = $this->view\n\t\t\t->setTemplateFile('employeeedit')->renderFile();\n\t\t$this->view->addToReplace($this->arrRender);\n\t\t$this->view->setTemplateFile('index')->templateRender();\n\t}", "function dump($name, $array) {\n\t\tif(!is_array($array)) {\n\t\t\tprint \"\\$\".$name.\" = \".$array.\"<br>\\n\";\n\t\t\treturn;\n\t\t}\n\t\tforeach($array as $key=>$val) {\n\t\t\tif(is_array($val)) {\n\t\t\t\tdump($name.\"[\".$key.\"]\", $val);\n\t\t\t} else {\n\t\t\t\tprint $name.\"[\".$key.\"] = \";\n if(is_object($val) && !method_exists($val, \"__toString\")) {\n print get_class($val).\"<br>\\n\";\n } else {\n print $val.\"<br>\\n\";\n }\n\t\t\t}\n\t\t}\n\t}", "function printJSON($array){\n\t\t\techo '<code>'. json_encode($array) .'</code>';\n\t\t}", "function tt( $data_array )\n {\n\techo \"data: $data_array[0] / $data_array[1] / $data_array[2] <br>\";\n }", "public static function print_r($array, $name = null)\r\n\t{\r\n\t\techo \"<pre>\" . (( $name ) ? \"$name: \" : \"\");\r\n\t\tprint_r($array);\r\n\t\techo \"</pre>\\n\";\r\n\t}", "function printTable($array,$m,$n){\necho \"<br>\"; \nfor ($i = 0; $i <= $m; $i++) \n{ \nfor ($j = 0; $j <= $n; $j++) \n{ \n echo $array[$i][$j].\" \";\n}\n echo \"<br>\";\n}\n\n echo \"<br>\";\n echo \"<br>\";\n}", "function printTable($arg_array)\r\n\t\t{\r\n\t\techo \"<table border=1>\";\r\n\t\tforeach($arg_array[0] as $key=>$value)\r\n\t\t\t{\r\n\t\t\techo \"<th>\".$key.\"</th>\";\r\n\t\t\t}\r\n\t\techo \"<tr>\";\r\n\t\tforeach($arg_array as $row =>$record)\r\n\t\t\t{\r\n\t\t\tforeach($record as $column_head => $value)\r\n\t\t\t\t{\r\n\t\t\t\techo \"<td>\".$value.\"</td>\";\r\n\t\t\t\t}\r\n\t\t\techo \"</tr>\";\t\r\n\t\t\t}\r\n\t\techo \"</table>\";\r\n\t\t}", "function arrayToTable($array_assoc):void {\n if (is_array($array_assoc)) {\n echo '<table class=\"table\">';\n echo '<thead>';\n echo '<tr>';\n list($table_title) = $array_assoc;\n foreach ($table_title as $key => &$value):\n echo '<th>' . $key . '</th>';\n endforeach;\n echo '</tr>';\n echo '</thead>';\n foreach ($array_assoc as &$master):\n echo '<tr>';\n foreach ($master as &$slave):\n echo '<td>' . $slave . '</td>';\n endforeach;\n echo '</tr>';\n endforeach;\n echo '</table>';\n }\n}", "function mostrarArray($vector){\n\t\tforeach ($vector as $indice=>$elemento){ //foreach por que desconocemos los indices\n\t\t\techo \"$elemento |\";\n\t\t}\n\t\t//y mostrar el máximo al final\n\t\techo max($vector).\" |\";echo \"<br />\";\n\t\t\n\t\t//recorrer vector para mostrar los índices\n\t\tforeach ($vector as $indice=>$elemento){\n\t\t\techo \"$indice |\";\n\t\t}\n\t}", "function pre_r($array){\n echo '<pre>';\n print_r($array);\n echo '</pre>';\n}", "function prn($x)\r\n{\r\n\tif (is_array($x) || is_object($x))\r\n\t{\r\n\t\tprint_r($x);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tprint $x . \"\\n\";\r\n\t}\r\n}", "function printArray($array, $indent = ' > ', $withKey = true)\n{\n if($withKey)\n {\n foreach($array as $key => $value)\n {\n if(is_array($value))\n {\n echo \"$indent$key \\t=> {\" . PHP_EOL;\n printArray($value, \"$indent\\t\");\n echo \"$indent}\" . PHP_EOL;\n }\n else\n {\n echo \"$indent$key \\t=> $value\" . PHP_EOL;\n }\n }\n }\n}", "function debug ($what){\r\n echo '<pre>';\r\n if (is_array($what)) {\r\n\t\tprint_r ($what);\r\n }else{\r\n var_dump ($what);\r\n }\r\n echo '</pre>';\r\n}", "function pa($arr) {\n\t\techo '<pre>';\n\t\tprint_r($arr);\n\t\techo '</pre>';\n\t}", "public function printSourceArray()\n {\n $this->show($this->SourceCodeArray);\n }", "function print_array($file_path=\"\", $row_sep = \"\\n\", $col_sep = \"\\t\") {\n if($this->arr != null && count($this->arr) > 0){\n $row = 0;\n //starting buffer to print\n ob_start();\n foreach($this->arr as $row){\n echo implode($col_sep, $row);\n echo $row_sep;\n }\n $contents = ob_get_contents();\n ob_end_clean(); //clean buffer and close it\n\n //write to a file if it is provided\n if(strlen($file_path) > 0){\n file_put_contents($file_path,$contents);\n } else {\n //print to console\n echo $contents;\n }\n } else {\n echo \"Empty array. Nothing to print.\";\n }\n }", "function multiple_arrayDisplay($multiple_array)\n{\n $r = '';\n $r .= '<style> td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n foreach ($multiple_array[0] as $key => $value) {\n $r .= '<th>'.$key.'</th>';\n }\n $r .= '</tr>';\n foreach ($multiple_array as $key => $value) {\n $r .= '<tr>';\n foreach ($value as $key1 => $value1) {\n if ($key1 == 'price') {\n $r .= '<td> $'.$value1.' </td>';\n } else {\n $r .= '<td>'.$value1.' </td>';\n }\n }\n $r .= '</tr>';\n }\n $r .= '</table>';\n\n return $r;\n}", "function multiple_arrayDisplay($multiple_array)\n{\n $r = '';\n $r .= '<style> td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n foreach ($multiple_array[0] as $key => $value) {\n $r .= '<th>'.$key.'</th>';\n }\n $r .= '</tr>';\n foreach ($multiple_array as $key => $value) {\n $r .= '<tr>';\n foreach ($value as $key1 => $value1) {\n if ($key1 == 'price') {\n $r .= '<td> $'.$value1.' </td>';\n } else {\n $r .= '<td>'.$value1.' </td>';\n }\n }\n $r .= '</tr>';\n }\n $r .= '</table>';\n\n return $r;\n}", "public static function print_rHTML($array)\r\n\t{\r\n\t\tif( ! self::isHTML() ) return;\r\n\t\tCommon::print_r($text);\r\n\t}", "function printArray($tempArray)\n{\n\tfor ($i = 0; $i < count($tempArray); $i++)\n\t{\n\t\tfor ($j = 0; $j < count($tempArray[$i]); $j++)\n\t\t{\n\t\t\tif ($tempArray[$i][$j] == $tempArray[$i][\"0\"])\n\t\t\t{\n\t\t\t\techo \"<h2>\" . \"----=\" . $tempArray[$i][$j] . \"=----<br>\" . \"</h2>\" ;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $j . \". \" . $tempArray[$i][$j]. \"<br>\";\n\t\t\t}\n\t\t}\n\t\techo \"<br>\";\n\t}\n}", "abstract function display();", "abstract function display();", "protected function prettyPrint(array $arr)\r\n {\r\n echo '<pre>', print_r($arr, 1), '</pre>';\r\n }", "function pre_r ( $array ) {\n\t\t\t\t\techo '<pre>';\n\t\t\t\t\tprint_r($array);\n\t\t\t\t\techo'</pre>';\n\n\t\t\t\t\t//hhahahahahahahhahahahah borges\n\t\t\t\t}", "public function summary(array $array);", "function mostrar($data)\n\t{\n\t\tif (is_array($data) || is_object($data))\n\t\t{\n\t\t\tprint_r(json_encode($data).\"\\n\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprint_r($data.\"\\n\");\n\t\t}\n\t}", "public function dump()\n {\n foreach ($this->sudoku as $y => $row) {\n foreach ($row as $x => $value) {\n echo \"{$value} \";\n }\n\n echo \"\\n\";\n }\n\n echo \"\\n\";\n }" ]
[ "0.80476594", "0.7499233", "0.7270005", "0.7220955", "0.72057635", "0.7188512", "0.71643245", "0.7163542", "0.7153869", "0.7047916", "0.7042678", "0.70073354", "0.7004684", "0.6985143", "0.6974765", "0.6940716", "0.69273895", "0.6926022", "0.6877305", "0.67691374", "0.67454726", "0.67283833", "0.6721043", "0.66587615", "0.6618826", "0.66135496", "0.66073716", "0.6604597", "0.65903336", "0.65489876", "0.64883596", "0.6469214", "0.646707", "0.6460906", "0.64546204", "0.6448111", "0.64333254", "0.642108", "0.6384511", "0.63770586", "0.6340027", "0.63301736", "0.6314178", "0.63091326", "0.63091326", "0.63028723", "0.6292363", "0.6281205", "0.62749934", "0.6262377", "0.6259598", "0.62588066", "0.6227459", "0.6221845", "0.62126493", "0.6205698", "0.61995816", "0.61977774", "0.6194414", "0.6178675", "0.61750734", "0.6169314", "0.61607045", "0.6157407", "0.61240095", "0.6121975", "0.6100679", "0.6090742", "0.60883486", "0.6064011", "0.6056354", "0.60488987", "0.6045042", "0.6012749", "0.60124844", "0.6001346", "0.5998335", "0.59870946", "0.5973661", "0.5958677", "0.5951016", "0.59495074", "0.59280735", "0.59262526", "0.59223664", "0.5916393", "0.59156144", "0.5915006", "0.5915006", "0.59073216", "0.59023213", "0.58920854", "0.58920854", "0.5880877", "0.58668894", "0.5865542", "0.5864673", "0.58643997" ]
0.6392114
40
MultiDimensional Array Display Function.
function multiple_arrayDisplay($multiple_array) { $r = ''; $r .= '<style> td,th{border: solid 2px black;}</style>'; $r .= '<table>'; $r .= '<tr>'; foreach ($multiple_array[0] as $key => $value) { $r .= '<th>'.$key.'</th>'; } $r .= '</tr>'; foreach ($multiple_array as $key => $value) { $r .= '<tr>'; foreach ($value as $key1 => $value1) { if ($key1 == 'price') { $r .= '<td> $'.$value1.' </td>'; } else { $r .= '<td>'.$value1.' </td>'; } } $r .= '</tr>'; } $r .= '</table>'; return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function DisplayArray($array)\r\n {\r\n $depth = 0;\r\n if (is_array($array))\r\n {\r\n echo \"Array (<br />\";\r\n for($i = 0; $i < count($array); $i ++)\r\n {\r\n if (is_array($array[$i]))\r\n {\r\n DisplayInlineArray($array[$i], $depth + 1, $i);\r\n }\r\n else\r\n {\r\n echo \"[\" . $i . \"] => \" . $array[$i];\r\n echo \"<br />\";\r\n $depth = 0;\r\n }\r\n }\r\n echo \")<br />\";\r\n }\r\n else\r\n {\r\n echo \"Variabele is geen array\";\r\n }\r\n }", "function DisplayArray($array) {\n foreach ($array as $value) {\n if (is_array($value)) {\n DisplayArray($value);\n } else {\n echo $value . \"<br>\";\n }\n }\n }", "function usingArraysMult()\r\n{ \r\n echo '<span style=\"color:teal;\r\n margin-left:-15px;\">\r\n 1) Print arrays elements by using Multidimensional Arrays.\r\n </span>'. \"<br>\";\r\n echo \"<br>\";\r\n \r\n $fullForms = array (\r\n array(\"HTML \", \"Hypertext\",\" Markup Language\"),\r\n array(\"CSS \",\"Cascading\",\" Style Sheets\"),\r\n array(\"JS \",\"Java\",\"Script\")\r\n );\r\n \r\n $sizeOfArray = count($fullForms); \r\n \r\n if($sizeOfArray<1)\r\n {\r\n throw new Exception(\"Array is empty!!!\");\r\n } \r\n \r\n echo $fullForms[0][0].\": \".$fullForms[0][1].$fullForms[0][2].\".<br><br>\";\r\n echo $fullForms[1][0].\": \".$fullForms[1][1].$fullForms[1][2].\".<br><br>\";\r\n echo $fullForms[2][0].\": \".$fullForms[2][1].$fullForms[2][2].\".<br><br>\";\r\n}", "function display2DArray($array,$printoptionsflag){\n\t\tif($array==null){\n\t\t\tprint \"No results were found!\";\n\t\t} else {\n\t\t\tprint \"<table class=\\\"clients\\\"><tr>\";\n\t\t\t$first = $array[0];\n\t\t\t$keys = array_keys($first); //Return the keys of the array, use first element;\n\t\t\tfor ($i=0;$i<count($keys);$i++){\n\t\t\t\tprint \"<td>\".$keys[$i].\"</td>\\n\";\n\t\t\t}\n\t\t\tprint \"</tr>\";\n\t\t\tfor ($j=0;$j<count($array);$j++){\n\t\t\t\tprint \"<tr>\";\n\t\t\t\tfor ($i=0;$i<(count($keys));$i++){\n\t\t\t\t\tprint \"<td>\".$array[$j][$keys[$i]].\"</td>\\n\";\n\t\t\t\t}\n\t\t\t\tif ($printoptionsflag){\n\t\t\t\t\t$this->printOptions($array[$j]['Client_ID']);\n\t\t\t\t}\n\t\t\t\tprint \"</tr>\\n\";\n\t\t\t}\n\t\t\tprint \"</table>\\n\";\n\t\t}\n\t}", "function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}", "function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}", "function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}", "public static function print2DArray($array, $border) {\r\n\r\n/* This function loops through an associative\r\n array and prints out all the values in a \r\n table. This is used for diagnostic\r\n purposes primarily, although there \r\n can be other applications. */\r\n \r\n // Check that the array exists\r\n if (!$array) {\r\n echo \"No array specified.<BR><BR>\";\r\n return;\r\n }\r\n \r\n else {\r\n // Start table\r\n echo \"<TABLE BORDER=$border>\";\r\n \r\n // Print the array in table cells\r\n while (list($key, $value) = each ($array)) {\r\n echo \"<TR><TD>$key</TD><TD>$value</TD></TR>\"; \r\n } // end of while loop\r\n \r\n // End table and return\r\n echo \"</TABLE>\";\r\n return;\r\n } // end of else\r\n\r\n}", "function angela_print_array($arr, $spaces = 0)\n{\n\t$sp=$spaces+1;\n\t\n\tif (is_array($arr))\n\t\tforeach ( $arr as $arrkey => $arrval )\n\t\t{\n\t\t\tfor ($i=0; $i<$spaces; $i++) echo \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"; \n\t\t\techo \"[$arrkey] => <br>\\n\";\n\t\t\tangela_print_array($arrval, $sp);\n\t\t}\n\telse\n\t{\n\t\tfor ($i=0; $i<$spaces; $i++) echo \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"; \n\t\tif (!isset($arr))\n\t\t\techo \"-- empty --<br>\";\n\t\telse\n\t\t\techo \"$arr <br>\";\n\t}\n}", "function display($arr)\r\n {\r\n $str = implode($arr);\r\n echo $str.'<br />';\r\n\r\n }", "private function printArray($array){\n\t\techo \"<pre>\".print_r($array,true).\"</pre>\";\n\t}", "protected function renderArray() {}", "public static function printArray($array, $border) {\r\n\r\n/* This function loops through a simple (1D)\r\n array and prints out all the values in a \r\n table. This is used for diagnostic\r\n purposes primarily, although there \r\n can be other applications. */\r\n \r\n // Check that the array exists\r\n if (!$array) {\r\n echo \"No array specified.<BR><BR>\";\r\n return;\r\n }\r\n \r\n else {\r\n // Start table\r\n echo \"<TABLE BORDER=$border>\";\r\n \r\n // Print the array in table cells\r\n foreach ($array as $value) {\r\n echo \"<TR><TD>$value</TD></TR>\"; \r\n } // end of while loop\r\n \r\n // End table and return\r\n echo \"</TABLE>\";\r\n return;\r\n } // end of else\r\n\r\n}", "function printArray($array){\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n }", "function diplayArray($array){\n echo '<pre>';\n var_dump($array);\n echo'</pre>';\n}", "function myShowArray($data)\n{\n echo '<pre>';\n print_r($data);\n echo '</pre>';\n}", "function print_array($array) {\n\n echo \"<pre>\";\n\n print_r($array);\n\n echo \"</pre>\";\n\n }", "public function displayArray()\r\n\t{\r\n\t\t$this->addThingsToPrint(\"<h2><a href=\\\"\" . $this->contentURL . \"\\\">\" . $this->contentURL . \"</a></h2>\");\r\n\t\t$this->addThingsToPrint(\"<pre>\" . print_r(json_decode($this->getJsonData()), TRUE) . \"</pre>\");\r\n\t\t$fullContent = RestUtils::getHTTPHeader('Testing') . $this->dataToPrint . RestUtils::getHTTPFooter(); \r\n\t\tRestUtils::sendResponse(200, $fullContent);\r\n\t}", "function l($array) {\n\techo '<div style=\"position: absolute; z-index: 2000; background: #66cc99; '\n\t.'bottom: 30px; right: 30px; height: 40%; '\n\t.'width: 75%; padding:5px; overflow: auto; -moz-opacity: 0.88\">';\n\techo \"<pre>\";\n\tprint_r($array);\n\techo '</div>';\n}", "public function box_multi($array=null)\n {\n if( is_array($array) )\n {\n foreach($array as $key => $value)\n {\n $this->html($value , $key);\n }\n }\n }", "function label($array){\n //\n //Get the fields \n $fields= $this->fields->get_array();\n //\n //Ouptut a table\n echo \"<div name='{$this->entity->name}'>\";\n echo $this->header();\n //\n //Loop through the array and display the results in a table \n foreach ($array as $row) {\n //\n //Step through the columns\n foreach($fields as $field){\n //\n //Get the indexes of the field\n $name= is_null($field->alias) ? $field->column->name:$field->alias;\n //\n //Get the field value\n $value = $row[$name];\n \n echo \"<span> $name :<span>$value></span>\"; \n }\n }\n echo \"</div>\"; \n }", "public function outputFunction($array, $depth=0, $tab=\"&nbsp;&nbsp;\") {\n foreach ($array as $key=>$value) {\n // line break\n for ($i=0; $i<$depth; $i++) echo $tab;\n if (is_numeric($key)) {\n echo $key.' => ';\n }\n else {\n echo '\\''.$key.'\\' => ';\n }\n if (is_array($value)) {\n echo 'array('.\"\\n\";\n $this->outputFunction($value, $depth+1);\n // line break\n for ($i=0; $i<$depth; $i++) echo $tab;\n echo '),'.\"\\n\";\n }\n else {\n // value\n if (is_numeric($value)) {\n echo $value.','.\"\\n\";\n }\n else {\n echo '\\''.$value.'\\','.\"\\n\";\n }\n }\n }\n }", "function printArray($array){\n print '<pre>';\n print_r($array);\n print '</pre>';\n}", "function printTable($array,$m,$n){\necho \"<br>\"; \nfor ($i = 0; $i <= $m; $i++) \n{ \nfor ($j = 0; $j <= $n; $j++) \n{ \n echo $array[$i][$j].\" \";\n}\n echo \"<br>\";\n}\n\n echo \"<br>\";\n echo \"<br>\";\n}", "function makeMultiDimTable($array)\n {\n $totalkeys = 0;\n $totalvalues = 0;\n echo \"<table>\";\n echo \"<thead><tr><td>Keys</td><td>Values</td></tr></thead>\";\n echo \"<tbody>\";\n foreach($array as $key => $value)\n {\n echo \"<tr><td>\" . $key . \"</td><td>\" . $value . \"</td></tr>\";\n $totalkeys += $key;\n $totalvalues += $value;\n }\n echo \"<tr><td colspan=2>Totals</td></tr>\";\n echo \"<tr><td>\" . $totalkeys . \"</td><td>\" . $totalvalues . \"</td></tr>\";\n echo \"</tbody>\";\n }", "function echoResult($myarray){\n\t\t\t$ctr = 1;\n\t\t\tforeach($myarray as $entry){\n\t\t\t\techo \"<p>$ctr : $entry</p>\";\n\t\t\t\t$ctr += 1;\n\t\t\t}\n\t\t}", "function printArray($data)\r\n{\r\n\techo \"<pre>\";\r\n\tprint_r($data);\r\n\techo \"</pre>\";\r\n}", "function print_array($data){\n echo '<pre>';\n print_r($data);\n echo '</pre>';\n }", "function printArray($array){\n\t\tforeach ($array as $key => $value) {\n\t\t\tprint(\"{$key}: $value<br />\");\n\t\t}\n\t}", "function print_r_html ($arr) {\n\techo \"<pre>\";\n print_r($arr);\n echo \"</pre>\";\n}", "function print_array($array)\r\n{\r\n\techo '<pre>';\r\n\tprint_r($array);\r\n\techo '</pre>';\r\n}", "function printArray($objArray) {\r\n\t\tglobal $global_config;\r\n\t\tif($global_config[\"debug_mode\"] == \"1\"){\r\n\t\t\tif(is_array($objArray)) {\r\n\t\t\t\tprint \"<PRE>\";\r\n\t\t\t\tprint_r($objArray);\r\n\t\t\t\tprint \"</PRE>\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint $objArray.\" <br> \";\r\n\t\t}\t\r\n\t}", "function printArray($array)\n\t{\n\t\tif (empty($array) and !is_array($array) ){\n\t\t\treturn FALSE;\n\t\t}else{\n\t\t\techo \"<pre>\";\n\t\t\tprint_r( $array );\n\t\t\techo \"</pre>\";\n\t\t}\n\t\t\n\t}", "function preShow( $arr, $returnAsString=false ) {\n $ret = '<pre>' . print_r($arr, true) . '</pre>';\n if ($returnAsString)\n return $ret;\n else\n echo $ret;\n}", "function displayClass($arr) {\n\t\techo \"------------***---------------<br>\";\n\t\t$i = 1;\n\t\tforeach($arr as $arrNew) {\n\t\t\techo $i.', '.$arrNew['name'].' - '.$arrNew['birthday'].' - '.$arrNew['email'].'<br>';\n\t\t\t$i++;\n\t\t}\n\t}", "function dump_array($the_array)\n{\n echo \"<ul>\";\n\n foreach ($the_array as $key1 => $value1) {\n echo \"<li><span class='key'>$key1</span>\";\n\n # If the value is itself an array, then print that as well.\n if (is_array($value1)) {\n echo \"<ul>\";\n foreach ($value1 as $key2 => $value2) {\n $pvalue = $value2;\n if (is_array($value2)) {\n $pvalue = \"&lt;an array&gt;\";\n }\n echo \"<li><span class='key'>$key2</span><span class='value'> $pvalue</span></li>\\n\";\n } # end inner foreach ($value1 as $key2 => $value2)\n echo \"</ul></li>\\n\";\n } else {\n echo \"<span class='value'> $value1</span></li>\\n\";\n }\n } # end outer foreach ($the_array as $key1 => $value1)\n echo \"</ul>\\n\";\n}", "function display($map,$longeur,$largeur)\n{\n for($x_x = 0 ; $x_x < $largeur ; $x_x++)\n {\n for($y_y = 0 ; $y_y < $longeur ; $y_y++)\n {\n echo \"&nbsp;&nbsp;\".$map[$x_x][$y_y].\"&nbsp;&nbsp;\";//affichage de la valeur\n }\n echo \"<br>\";\n }\n}", "function pre_print_r($array){\n\n\techo '<pre style=\"font-family: monospace; font-size: 14px; text-align:left!important\">';\n\tprint_r($array);\n\techo '</pre>';\n\n}", "function display() {\n\t\tforeach($this as $prop => $val) {\n\t\t\techo $val;\n\t\t}\n\t}", "function printArray($tempArray)\n{\n\tfor ($i = 0; $i < count($tempArray); $i++)\n\t{\n\t\tfor ($j = 0; $j < count($tempArray[$i]); $j++)\n\t\t{\n\t\t\tif ($tempArray[$i][$j] == $tempArray[$i][\"0\"])\n\t\t\t{\n\t\t\t\techo \"<h2>\" . \"----=\" . $tempArray[$i][$j] . \"=----<br>\" . \"</h2>\" ;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $j . \". \" . $tempArray[$i][$j]. \"<br>\";\n\t\t\t}\n\t\t}\n\t\techo \"<br>\";\n\t}\n}", "static function printr($array)\n {\n echo '<pre>' . print_r($array, true) . '</pre>';\n }", "public function printMatrix() {\n echo __CLASS__ . PHP_EOL;\n for ($i = 0; $i < $this->row; ++$i) {\n for ($j = 0; $j < $this->col; ++$j) {\n printf('%lf ', $this->data[$i * $this->col + $j]);\n }\n echo PHP_EOL;\n }\n }", "private function arrayToPrint()\n\t{\n\t\t$this->view->addToReplace($this->langArr);\n\t\t$this->view->addToReplace($this->arrRender);\n\t\t$this->arrRender['CONTENT'] = $this->view\n\t\t\t->setTemplateFile('employeeedit')->renderFile();\n\t\t$this->view->addToReplace($this->arrRender);\n\t\t$this->view->setTemplateFile('index')->templateRender();\n\t}", "public static function viewArray($array_in) {\n\t\tif (is_array($array_in)) {\n\t\t\t$result = '<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"white\">';\n\t\t\tif (count($array_in) == 0) {\n\t\t\t\t$result .= '<tr><td><font face=\"Verdana,Arial\" size=\"1\"><strong>EMPTY!</strong></font></td></tr>';\n\t\t\t} else {\n\t\t\t\tforeach ($array_in as $key => $val) {\n\t\t\t\t\t$result .= '<tr><td valign=\"top\"><font face=\"Verdana,Arial\" size=\"1\">' . htmlspecialchars((string)$key) . '</font></td><td>';\n\t\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t\t$result .= self::viewArray($val);\n\t\t\t\t\t} elseif (is_object($val)) {\n\t\t\t\t\t\t$string = '';\n\t\t\t\t\t\tif (method_exists($val, '__toString')) {\n\t\t\t\t\t\t\t$string .= get_class($val) . ': ' . (string)$val;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$string .= print_r($val, TRUE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result .= '<font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' . nl2br(htmlspecialchars($string)) . '<br /></font>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (gettype($val) == 'object') {\n\t\t\t\t\t\t\t$string = 'Unknown object';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$string = (string)$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result .= '<font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' . nl2br(htmlspecialchars($string)) . '<br /></font>';\n\t\t\t\t\t}\n\t\t\t\t\t$result .= '</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result .= '</table>';\n\t\t} else {\n\t\t\t$result = '<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"white\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' .\n\t\t\t\tnl2br(htmlspecialchars((string)$array_in)) .\n\t\t\t\t'<br /></font></td>\n\t\t\t</tr>\n\t\t</table>'; // Output it as a string.\n\t\t}\n\t\treturn $result;\n\t}", "function printarr($a, $descr = '') \r\n{\r\n\tif (!is_array($a)) \r\n\t{\r\n\t\tob_start();\r\n\t\tif (!empty($descr))\r\n\t\t{\r\n\t\t\tprintbr('<b>' . $descr . '</b>');\r\n\t\t}\r\n\t\tvar_dump($a);\r\n\t\t$str = ob_get_clean();\r\n\t\tprintNicely($str);\r\n\t} else {\r\n\t\tob_start();\r\n\t\tprint '<pre>';\r\n\t\tif (!empty($descr))\r\n\t\t{\r\n\t\t\tprint('<b>' . $descr . '</b>' . \"\\n\");\r\n\t\t}\r\n\t\tprint_r($a);\r\n\t\tprint '</pre>';\r\n\t\t$str = ob_get_clean();\r\n\t\tprintNicely($str);\r\n\t}\r\n}", "protected function aggregate_multidimensional()\n {\n }", "public static function printTwoDArray($rows, $cols, $arr)\n {\n // echo \"enter 1 :Integer 2: string\";\n echo \"enter the \" . $rows * $cols . \" elements\";\n\n /** enter the values into an array */\n for ($i = 0; $i < $rows; $i++) {\n for ($j = 0; $j < $cols; $j++) {\n $twoDArr[$i][$j] = Utility::readInt();\n }\n }\n\n /**print the array */\n for ($i = 0; $i < $rows; $i++) {\n for ($j = 0; $j < $cols; $j++) {\n print $twoDArr[$i][$j] . \" \";\n }\n echo \"\\n\";\n }\n// print_r($twoDArr);\n }", "function da( $TheArray ){ // Note: the function is recursive\r\n\tif(!is_array($TheArray)){\r\n\t\treturn \"no array\";\r\n\t}\r\n\techo \"<table border=0>\\n\";\r\n\t$Keys = array_keys( $TheArray );\r\n\tforeach( $Keys as $OneKey ){\r\n\t\techo \"<tr>\\n\";\r\n\t\techo \"<td bgcolor='#727450'>\";\r\n\t\techo \"<B>\" . $OneKey . \"</B>\";\r\n\t\techo \"</td>\\n\";\r\n\t\techo \"<td bgcolor='#C4C2A6'>\";\r\n\t\tif ( is_array($TheArray[$OneKey]) ){\r\n\t\t\tda($TheArray[$OneKey]);\r\n\t\t}else{\r\n\t\t\techo $TheArray[$OneKey];\r\n\t\t}\r\n\t\techo \"</td>\\n\";\r\n\t\techo \"</tr>\\n\";\r\n\t}\r\n\techo \"</table>\\n\";\r\n}", "function showResultArray($resultArray)\n{\n for ($count = 0; $count < count($resultArray); $count++) {\n echo $resultArray[$count][\"Title\"] . \"<br/>\";\n }\n}", "function display_result($array) {\n\tforeach ($array as $entry) {\n\t\tif ($entry != '')\n\t\t\techo \"<li>\" . $entry . \"</li>\\n\";\n\t}\n}", "function htmldump ( $array ) {\r\n\t\tforeach($array as $key => $val) {\r\n\t\t\t$return .= $this->ul(\r\n\t\t\t\t\t\t$this->li($this->font($key)) .\r\n\t\t\t\t\t\t\t$this->ul(\r\n\t\t\t\t\t\t\t\t$this->font(is_array($val) ? $this->htmldump($val) : $this->li($val))\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\treturn $return;\r\n\t}", "function dispArr($vals,$yr,$rates){\n\t\t\t\tfor($idx=0;$idx<$yr;$idx++){\n\t\t\t\t\techo(\"<tr>\");\n\t\t\t\t\tfor($jdx=0;$jdx<$rates+2;$jdx++){\n\t\t\t\t\t\tif($jdx===0){\n\t\t\t\t\t\t\techo(\"<td align='right'>\".$vals[$idx][$jdx].\"</td>\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo(\"<td align='right'>$\".(number_format($vals[$idx][$jdx],2)).\"</td>\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\techo(\"</tr>\");\n\t\t\t\t}\n\t\t\t}", "function displayPostArray($postarray){\n\n foreach ($postarray as $technologies => $score) {\n // code...\n echo \"$technologies\" . \"=\" . \"$score <br>\";\n }\n }", "function _pre($array) { echo '<pre>'; print_r ($array); echo '</pre>'; }", "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}", "function displayArray(Array $a)\n{\n $sum = array_sum($a);\n \n return $sum;\n}", "function printr($array, $print = true) { //imprime o devuelve la cadena\n if ($print)\n return print_r($array, true);\n else\n echo '<pre>' . print_r($array, true) . '</pre>'; //tabula bien gracias a los <pre>\n }", "function dump($array) {\n\treturn \"<pre>\" . htmlentities(print_r($array, 1)) . \"</pre>\";\n}", "abstract function display();", "abstract function display();", "function printArr( $array )\n{\n foreach($array as $x)\n {\n echo \"$x <br>\";\n }\n}", "function displayNarrow($arr)\n\t{\n\t\t\n\t\tif((count($arr))>0)\n\t\t{\n\t\t\t$id=(int)$_GET['subcatid'];\n\t\t\t$cnt=count($arr);\n\t\t\tfor($i=0;$i<$cnt;$i++)\n\t\t\t{\n\t\t\t\t$val=count($arr[$i]);\n\t\t\t\tif(!array_key_exists($arr[$i][0]['attrib_name'],$_SESSION['search_option']))\n\t\t\t\t{\n\t\t\t\t\t$output.='<ul><span>'.$arr[$i][0]['attrib_name'].'</span>';\n\t\t\t\t\tfor($j=0;$j<$val;$j++)\n\t\t\t\t\t{\n\t\t\t\t\tif($arr[$i][$j]['products_count'] > 0 ) \n\t\t\t\t\t\t$output.='<li><a href=\"'.$_SESSION['base_url'].'/index.php?do=featured&action=showfeaturedproduct&subcatid='.$id.'&type='.$arr[$i][0]['attrib_name'].'&val='.$arr[$i][$j]['attrib_value_id'].'\">'.$arr[$i][$j]['attrib_value'].' ('.$arr[$i][$j]['products_count'].')</a></li>';\n\t\t\t\t}\n\t\t\t\t\t$output.='</ul>';\n\t\t\t\t}\n\t\t\t}\n\t\t\n \t\t}\n \t\treturn $output;\n\t}", "function mostrarArray($vector){\n\t\tforeach ($vector as $indice=>$elemento){ //foreach por que desconocemos los indices\n\t\t\techo \"$elemento |\";\n\t\t}\n\t\t//y mostrar el máximo al final\n\t\techo max($vector).\" |\";echo \"<br />\";\n\t\t\n\t\t//recorrer vector para mostrar los índices\n\t\tforeach ($vector as $indice=>$elemento){\n\t\t\techo \"$indice |\";\n\t\t}\n\t}", "function dump_array($array)\n{\n\n\t$_str = \"<table bgcolor = '%s'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table><br>\";\n\n\tif(is_array($array)){\n\n\t\t$size = count($array);\n\t\t$string = \"\";\n\n\t\tif($size) {\n\n\t\t\t$string .= \"{ <br>\";\n\n\t\t\tforeach($array as $a => $b) {\n\n\t\t\t\tif(is_array($b)) { $b = dump_array($b); }\n\t\t\t\tif(is_object($b)) { $b = dump_array(object_to_array($b)); }\n\t\t\t\t$string .= \"&nbsp;&nbsp;&nbsp;&nbsp;<b>$a = '$b'</b><br>\";\n\n \t\t}\n\n\t\t\t$string .= \" }<br>\";\n\t\t}\n\n\t\t$r = sprintf($_str, '#DACE0B', $string);\n\n\t\treturn $r;\n\n } else { return $array; }\n}", "public function listDisplayElements();", "function printArray($myArray, $n) { \n for ($i = 0; $i < $n; $i++) \n echo $myArray[$i].\" \"; \n echo \"\\n\";\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}", "function printArray($value, $key) {\n echo $key . \" : \" . $value . \"<br>\";\n }", "function pprint($array, $file_name='array'){\n /**\n * Pretty print Arrays - in collapsible and scrollable boxes\n *\n * @param Array to be printed\n * @param String as name of the printed box\n *\n * @return HTML non semantic...\n */\n $id = random_int(0, 999);\n echo '<style type=\"text/css\">input#'.$id.':checked ~ div.ijwe {display: none;}</style>';\n echo '<br><div style=\"background-color:#b1b1b1; border: 1px solid #949494; width:96%; margin: auto;\">';\n echo '<input type=\"checkbox\" id=\"toggle-'.$id.'\" style=\"display:inline; width:15px; background-color:transparent;\"><label style=\" white-space:nowrap; clear: both; width:0px;\" for=\"toggle-'.$id.'\"><h3 style=\"display:inline; line-height: 2px; margin: 1em;\">'.$file_name.':</h3></label>';\n echo '<div class=\"ijwe\" style=\"background-color:#c4c4c4; overflow-y: scroll; padding: 0.3em; max-height:400px;\"><pre><xmp>';\n print_r($array);\n echo '</xmp></pre></div>';\n echo '</div>';\n}", "function printFormatted($return=false){\n\t\t\tif($return){\n\t\t\t\treturn '<pre>'.print_r( $this->asArray(), true ).'</pre>';\n\t\t\t}else{\n\t\t\t\techo '<pre>'.print_r( $this->asArray(), true ).'</pre>';\n\t\t\t}\n\t\t}", "function pr($array)\n{\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n}", "function xmp_print($array, $title = '') {\n\tif (!empty($title)) {\n\t\techo \"$title:<br>\\n\";\n\t}\n\techo \"<xmp>\";\n\tprint_r($array);\n\techo \"</xmp>\";\n}", "function display() {\r\n echo '<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\r\n echo '<tr>'; \r\n for ($pos = 0; $pos < 9; $pos++) { \r\n echo $this->show_cell($pos); \r\n if ($pos % 3 == 2) {\r\n echo '</tr><tr>';\r\n } \r\n }\r\n echo '</tr>';\r\n echo '</table>';\r\n }", "function arrayToTable($array_assoc):void {\n if (is_array($array_assoc)) {\n echo '<table class=\"table\">';\n echo '<thead>';\n echo '<tr>';\n list($table_title) = $array_assoc;\n foreach ($table_title as $key => &$value):\n echo '<th>' . $key . '</th>';\n endforeach;\n echo '</tr>';\n echo '</thead>';\n foreach ($array_assoc as &$master):\n echo '<tr>';\n foreach ($master as &$slave):\n echo '<td>' . $slave . '</td>';\n endforeach;\n echo '</tr>';\n endforeach;\n echo '</table>';\n }\n}", "function display($content)\n{\n foreach($content as $key => $value) \n {\n\t print_r($key.\"=>\");\n print_r($value);\n print_r(\"\\n\");\n }\n}", "public function printSourceArray()\n {\n $this->show($this->SourceCodeArray);\n }", "function dbga($array){\n echo '<div class=\"dbg\"><pre>';\n print_r($array);\n echo '</pre></div>';\n }", "private function display_grid($grid) \n\t{\n\t\techo \"<table border=1>\";\n\t\tforeach ($grid as $row =>$columns) {\n\t\t\t\techo \"<tr><td></td>\";\n\t\t\tforeach ($columns as $key =>$value) {\n\t\t\t\t\n\t\t\t\techo \"<td>$value</td>\";\n\t\t\t\t\n\t\t\t}\n\t\t\techo \"</tr>\";\n\t\t}\n\t\techo \"</table>\";\n\t\t\n\t\t\n\t}", "function PrintData($DepthArray,$Value)\n{\n\tglobal $LastItem,$Item;\n\tif ((count($DepthArray) > 1 )) { $LastItem;}\n\t$DepthString=implode(\":\",$DepthArray);\n\t$DepthStringLength=strlen($DepthString);\n\tif( $DepthStringLength <80 ) { printf(\"%-80.80s%s\\n\",$DepthString,$Value); }\n\telse if( $DepthStringLength <120 ) { printf(\"%-120.120s%s\\n\",$DepthString,$Value); }\n\telse { printf(\"%s %s\\n\",$DepthString,$Value); }\n\treturn(0);\n}", "public static function render(array $grid) {\n\n $gridOutput = '';\n $rows = self::getRowsArray();\n $cols = self::getColumnsArray();\n\n foreach ($rows as $rowKey => $rowLetter) {\n foreach($cols as $colKey => $colNumber) {\n\n if ($colKey == 0) {\n $gridOutput .= \"\\n $rowLetter \";\n }\n\n $gridOutput .= $grid[$rowLetter][$colNumber];\n }\n }\n\n return $gridOutput;\n }", "function pr ($arr) \n{\n echo '<pre>'; print_r($arr); echo '</pre>';\n}", "public static function print_r($array, $name = null)\r\n\t{\r\n\t\techo \"<pre>\" . (( $name ) ? \"$name: \" : \"\");\r\n\t\tprint_r($array);\r\n\t\techo \"</pre>\\n\";\r\n\t}", "function display() {\n echo'<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\n echo'<tr>'; //first row\n for ($pos = 0; $pos < 9; $pos++) {\n echo $this->show_cell($pos);\n if ($pos % 3 == 2)\n echo '</tr><tr>'; //next square is in a new row\n }\n echo'</tr>';\n echo'</table>';\n }", "public function dump()\n {\n foreach ($this->sudoku as $y => $row) {\n foreach ($row as $x => $value) {\n echo \"{$value} \";\n }\n\n echo \"\\n\";\n }\n\n echo \"\\n\";\n }", "function printArray($array, $indent = ' > ', $withKey = true)\n{\n if($withKey)\n {\n foreach($array as $key => $value)\n {\n if(is_array($value))\n {\n echo \"$indent$key \\t=> {\" . PHP_EOL;\n printArray($value, \"$indent\\t\");\n echo \"$indent}\" . PHP_EOL;\n }\n else\n {\n echo \"$indent$key \\t=> $value\" . PHP_EOL;\n }\n }\n }\n}", "function alist ($array) { //This function prints a text array as an html list.\n $alist = \"<ul>\";\n for ($i = 0; $i < sizeof($array); $i++) {\n $alist .= \"<li>$array[$i]\";\n }\n $alist .= \"</ul>\";\n return $alist;\n}", "public function simpleDraw(){\n\t\t$pile = array();\n\t\t$root = array();\n\t\t$root['deep'] = 0;\n\t\t$root['cat'] = $this;\n\t\t$pile[] = $root;\n\n\t\twhile(count($pile)){\n\t\t\t$cat_array = array_pop($pile);\n\t\t\t$cat = $cat_array['cat'];\n\t\t\t$deep = $cat_array['deep'];\n\n\t\t\t\tfor($i =0; $i<$deep ; $i++){\n\t\t\t\techo '|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n\t\t\t}\n\t\t\techo (($cat->hasSubCategories())?'|-':'&nbsp;&nbsp;');\n\t\t\techo '\t'.$cat->getLabel().'<br/>';\n\n\t\t\tforeach($cat->getSubCategories() as $c){\n\t\t\t\t$s = array();\n\t\t\t\t$s['deep'] = $deep + 1;\n\t\t\t\t$s['cat'] = $c;\n\t\t\t\t$pile[] = $s;\n\t\t\t}\n\t\t}\n\t}", "function showSubCategory($arr)\n\t{\n\t\t$output ='<div id=\"9\" class=\"anylinkcss\" style=\"width: 160px; background-color: #f7f7f5\">';\n\t\t$cnt=count($arr);\n\t\tfor($i=0;$i<$cnt;$i++)\n\t\t\t$output .='<a href=\"#\">'.$arr[$i]['SubCategory'].'</a>';\n\t\t$output.='</div>';\n\t\treturn $output;\n\t}", "function dump($name, $array) {\n\t\tif(!is_array($array)) {\n\t\t\tprint \"\\$\".$name.\" = \".$array.\"<br>\\n\";\n\t\t\treturn;\n\t\t}\n\t\tforeach($array as $key=>$val) {\n\t\t\tif(is_array($val)) {\n\t\t\t\tdump($name.\"[\".$key.\"]\", $val);\n\t\t\t} else {\n\t\t\t\tprint $name.\"[\".$key.\"] = \";\n if(is_object($val) && !method_exists($val, \"__toString\")) {\n print get_class($val).\"<br>\\n\";\n } else {\n print $val.\"<br>\\n\";\n }\n\t\t\t}\n\t\t}\n\t}", "function printArray($arr, $n) \n{ \n\tfor ($i = 0; $i < $n; ++$i) \n\t\tprint($arr[$i].\" \"); \n}", "protected function RenderArray()\n {\n if ($this->m_QueryONRender && !$this->m_ActiveRecord && $this->m_DataObjName) {\n if (!$this->_run_search($resultRecords, $this->m_ClearSearchRule))\n return $this->ProcessDataObjError($ok);\n $this->UpdateActiveRecord($resultRecords[0]);\n }\n\n $columns = $this->m_RecordRow->RenderColumn();\n foreach($columns as $key=>$val) {\n $fields[$key][\"label\"] = $val;\n $fields[$key][\"required\"] = $this->GetControl($key)->m_Required;\n $fields[$key][\"description\"] = $this->GetControl($key)->m_Description;\n $fields[$key][\"value\"] = $this->GetControl($key)->m_Value;\t \n }\n\n $controls = $this->m_RecordRow->Render();\n if ($this->CanShowData()) {\n foreach($controls as $key=>$val) {\n $fields[$key][\"control\"] = $val;\n }\n }\n return $fields;\n }", "public abstract function display();", "public function summary(array $array);", "function show($data)\n{\n echo \"<pre>\";\n print_r($data);\n echo \"</pre>\";\n}", "function tt( $data_array )\n {\n\techo \"data: $data_array[0] / $data_array[1] / $data_array[2] <br>\";\n }", "function printTable($arg_array)\r\n\t\t{\r\n\t\techo \"<table border=1>\";\r\n\t\tforeach($arg_array[0] as $key=>$value)\r\n\t\t\t{\r\n\t\t\techo \"<th>\".$key.\"</th>\";\r\n\t\t\t}\r\n\t\techo \"<tr>\";\r\n\t\tforeach($arg_array as $row =>$record)\r\n\t\t\t{\r\n\t\t\tforeach($record as $column_head => $value)\r\n\t\t\t\t{\r\n\t\t\t\techo \"<td>\".$value.\"</td>\";\r\n\t\t\t\t}\r\n\t\t\techo \"</tr>\";\t\r\n\t\t\t}\r\n\t\techo \"</table>\";\r\n\t\t}", "function\teeps_printr($a, $level)\t{\n if (is_array($a))\t{\n $name = key($a);\n echo\t\"<br>\";\n for ($i = 0; $i < $level*2; $i++)\techo \"&nbsp;&nbsp;\";\n echo \"<strong>ARRAY $name</strong>\";\n foreach ($a as $e)\t{\n eeps_printr($e, $level + 1);\n }\n }\n else {\n if (strlen($a) != 0)\t{\n echo\t\"<br>\";\n for ($i = 0; $i < $level*2; $i++)\techo \"&nbsp;&nbsp;\";\n echo \"$a\";\n }\n }\n}", "function dumpArray($elements) {\n $result = \"<ol>\\n\";\n foreach ($elements as $key => $value) {\n if (is_array($value)) {\n $result .= \"<li>Key <b>$key</b> is an array\n containing:\\n\" . dumpArray($value) . \"</li>\";\n } else {\n $value = nl2br(htmlspecialchars($value));\n $result .= \"<li>Key <b>$key</b> has value [<b>$value</b>]</li>\\n\";\n }\n }\n return $result . \"</ol>\\n\";\n}", "public function displayGridlines() {\n\t}" ]
[ "0.7384269", "0.6975198", "0.6926616", "0.6807112", "0.6619322", "0.6619322", "0.6619322", "0.6522776", "0.64492434", "0.6446065", "0.63740855", "0.6367178", "0.6297108", "0.62789", "0.6263028", "0.625825", "0.625113", "0.6126222", "0.6108217", "0.6086835", "0.6082916", "0.6072773", "0.6068595", "0.6066991", "0.604826", "0.6028217", "0.60202295", "0.6017974", "0.59991497", "0.5951501", "0.59440476", "0.59286016", "0.59097874", "0.58579373", "0.5857729", "0.5852502", "0.5852468", "0.5850615", "0.58336014", "0.5831359", "0.58295727", "0.5820417", "0.58039385", "0.5786955", "0.57830936", "0.57755685", "0.5775562", "0.57714057", "0.57597107", "0.5757244", "0.57513446", "0.57273805", "0.57220787", "0.5705659", "0.5704361", "0.5702319", "0.5690096", "0.568905", "0.5684836", "0.5684836", "0.5678861", "0.563443", "0.5632624", "0.56317747", "0.5609923", "0.5603945", "0.5589292", "0.5587466", "0.55788493", "0.55568", "0.55472064", "0.5540589", "0.55381864", "0.5522688", "0.55221313", "0.5517199", "0.5516504", "0.5504041", "0.5487869", "0.5482786", "0.5459669", "0.54578245", "0.5439932", "0.5439768", "0.5439591", "0.54318196", "0.54291064", "0.54142666", "0.54120225", "0.5406747", "0.53935134", "0.53873247", "0.53858924", "0.53849536", "0.5376472", "0.5370319", "0.53702366", "0.5364204", "0.53608954" ]
0.6437139
10
table_display($table) display any 2d table.
function table_display($table) { $out = ''; $out = '<style> td,th{border: solid 2px black;}</style>'; if (count($table) == 0) { //table is empty return 'table is empty'; } $out .= '<table>'; //table header $col_names = array_keys($table[0]); $out .= '<tr>'; foreach ($col_names as $col_name) { $out .= '<th>'.$col_name.'</th>'; } $out .= '</tr>'; //table data $out .= '</tr>'; foreach ($table as $one_row) { $out .= '<tr>'; foreach ($one_row as $key => $col_name) { if ($key == 'price' and gettype($key) != 'integer') { $out .= '<td> $'.$col_name.' </td>'; } else { $out .= '<td>'.$col_name.' </td>'; } } $out .= '</tr>'; } $out .= '</table>'; return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display() {\r\n echo '<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\r\n echo '<tr>'; \r\n for ($pos = 0; $pos < 9; $pos++) { \r\n echo $this->show_cell($pos); \r\n if ($pos % 3 == 2) {\r\n echo '</tr><tr>';\r\n } \r\n }\r\n echo '</tr>';\r\n echo '</table>';\r\n }", "function display() {\n echo'<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\n echo'<tr>'; //first row\n for ($pos = 0; $pos < 9; $pos++) {\n echo $this->show_cell($pos);\n if ($pos % 3 == 2)\n echo '</tr><tr>'; //next square is in a new row\n }\n echo'</tr>';\n echo'</table>';\n }", "public static function print2DArray($array, $border) {\r\n\r\n/* This function loops through an associative\r\n array and prints out all the values in a \r\n table. This is used for diagnostic\r\n purposes primarily, although there \r\n can be other applications. */\r\n \r\n // Check that the array exists\r\n if (!$array) {\r\n echo \"No array specified.<BR><BR>\";\r\n return;\r\n }\r\n \r\n else {\r\n // Start table\r\n echo \"<TABLE BORDER=$border>\";\r\n \r\n // Print the array in table cells\r\n while (list($key, $value) = each ($array)) {\r\n echo \"<TR><TD>$key</TD><TD>$value</TD></TR>\"; \r\n } // end of while loop\r\n \r\n // End table and return\r\n echo \"</TABLE>\";\r\n return;\r\n } // end of else\r\n\r\n}", "function printTable($arg_array)\r\n\t\t{\r\n\t\techo \"<table border=1>\";\r\n\t\tforeach($arg_array[0] as $key=>$value)\r\n\t\t\t{\r\n\t\t\techo \"<th>\".$key.\"</th>\";\r\n\t\t\t}\r\n\t\techo \"<tr>\";\r\n\t\tforeach($arg_array as $row =>$record)\r\n\t\t\t{\r\n\t\t\tforeach($record as $column_head => $value)\r\n\t\t\t\t{\r\n\t\t\t\techo \"<td>\".$value.\"</td>\";\r\n\t\t\t\t}\r\n\t\t\techo \"</tr>\";\t\r\n\t\t\t}\r\n\t\techo \"</table>\";\r\n\t\t}", "private function display_grid($grid) \n\t{\n\t\techo \"<table border=1>\";\n\t\tforeach ($grid as $row =>$columns) {\n\t\t\t\techo \"<tr><td></td>\";\n\t\t\tforeach ($columns as $key =>$value) {\n\t\t\t\t\n\t\t\t\techo \"<td>$value</td>\";\n\t\t\t\t\n\t\t\t}\n\t\t\techo \"</tr>\";\n\t\t}\n\t\techo \"</table>\";\n\t\t\n\t\t\n\t}", "function print_table($data)\n{\n\t$col_width = array();\n\n\t// pre-calculate column width\n\tforeach ($data as $row) {\n\t\tforeach ($row as $col => $value) {\n\t\t\t$col_width[$col] = max(@$col_width[$col], mb_strlen(var_export($value, true)));\n\t\t}\n\t}\n\n\t// include key width\n\tforeach ($col_width as $label => & $width) {\n\t\t$width = max(mb_strlen($label), $width);\n\t}\n\t\n\t// show table header\n\techo \"\\n \";\n\tforeach ($col_width as $label => $width) {\n\t\techo \"+\", str_repeat('-', $width + 2);\n\t}\n\techo \"+\\n \";\n\tforeach ($col_width as $label => $width) {\n\t\t$pad = ($width - mb_strlen($label)) / 2.;\n\t\techo \"| \", str_repeat(' ', floor($pad)), $label, str_repeat(' ', ceil($pad)), \" \";\n\t}\n\techo \"|\\n \";\n\tforeach ($col_width as $label => $width) {\n\t\techo \"+\", str_repeat('-', $width + 2);\n\t}\n\techo \"+\\n \";\n\n\t// show table\n\tforeach ($data as $row) {\n\t\tforeach ($row as $col => $value) {\n\t\t\t$value_str = var_export($value, true);\n\t\t\t$pad = $col_width[$col] - mb_strlen($value_str);\n\t\t\tif (is_numeric($value)) {\n\t\t\t\techo \"| \", str_repeat(' ', $pad), $value_str, \" \";\n\t\t\t} else {\n\t\t\t\techo \"| \", $value_str, str_repeat(' ', $pad), \" \";\n\t\t\t}\n\t\t}\n\t\techo \"|\\n \";\n\t}\n\n\tforeach ($col_width as $label => $width) {\n\t\techo \"+\", str_repeat('-', $width + 2);\n\t}\n\techo \"+\\n\\n\";\n}", "function print_table($query_result) {\n echo \"<table>\";\n echo \"<tr>\";\n for ($i = 0; $i < pg_num_fields($query_result); $i++) {\n $fieldname = pg_field_name($query_result, $i);\n echo \"<th>$fieldname</th>\";\n }\n echo \"</tr>\";\n\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n echo \"<td>$row[$i]</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "function display2DArray($array,$printoptionsflag){\n\t\tif($array==null){\n\t\t\tprint \"No results were found!\";\n\t\t} else {\n\t\t\tprint \"<table class=\\\"clients\\\"><tr>\";\n\t\t\t$first = $array[0];\n\t\t\t$keys = array_keys($first); //Return the keys of the array, use first element;\n\t\t\tfor ($i=0;$i<count($keys);$i++){\n\t\t\t\tprint \"<td>\".$keys[$i].\"</td>\\n\";\n\t\t\t}\n\t\t\tprint \"</tr>\";\n\t\t\tfor ($j=0;$j<count($array);$j++){\n\t\t\t\tprint \"<tr>\";\n\t\t\t\tfor ($i=0;$i<(count($keys));$i++){\n\t\t\t\t\tprint \"<td>\".$array[$j][$keys[$i]].\"</td>\\n\";\n\t\t\t\t}\n\t\t\t\tif ($printoptionsflag){\n\t\t\t\t\t$this->printOptions($array[$j]['Client_ID']);\n\t\t\t\t}\n\t\t\t\tprint \"</tr>\\n\";\n\t\t\t}\n\t\t\tprint \"</table>\\n\";\n\t\t}\n\t}", "public function displayTableData($table, $format=\"html\")\n\t{\n\t\t$db = new mysql_db();\n\n\t\t$result = $db->query(\"SELECT * FROM {$table}\");\n\t\t\n\t\tif($db->num_rows($result) == 0)\n\t\t{\n\t\t\theader (\"Content-Type:text/html\");\n\t\t\tprint \"No records found.\";\n\t\t}\n\t\telseif($format == \"xml\")\n\t\t{\n\t\t\theader (\"Content-Type:text/xml\");\n\t\t\t$xml = $db->MYSQL2XML2($result, \"ThinkFunProject\", $table);\n\t\t\tprint $xml;\n\t\t}\n\t\telseif($format == \"html\")\n\t\t{\n\t\t\theader (\"Content-Type:text/html\");\n\t\t\tprint \"<HTML>\\n\";\n\t\t\tprint \"<BODY>\\n\";\n\t\t\t\t$html = $db->MYSQL2HTML($result, \"ThinkFunProject\", $table);\n\t\t\t\tprint $html;\n\t\t\tprint \"</BODY>\\n\";\n\t\t\tprint \"</HTML>\\n\";\n\t\t}\n\t\t\n\t\t$db->close_connection();\n\t}", "function printTable ($rows, $cols) {\n echo \"<table border=1>\";\n\n for ($i=0; $i<$rows; $i++) {\n echo \"<tr>\";\n for ($j=0; $j<$cols; $j++) {\n echo \"<td> Content </td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "public function drawTable()\n {\n echo \"<table border='1'>\";\n for ($i = 0; $i < $this->m; $i++) {\n echo \"<tr>\";\n for ($j = 0; $j < $this->n; $j++) {\n if ($this->isInSolution($i, $j, $this->matrix)) {\n echo \"<td bgcolor='#9acd32'>\";\n } else {\n echo \"<td>\";\n }\n echo $this->matrix[$i][$j];\n echo \"</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "private function displayTableData($table, $format = \"html\") {\n\t\t$db = new mysql_db();\n\n\t\t$result = $db -> query(\"SELECT * FROM {$table}\");\n\n\t\tif ($db -> num_rows($result) == 0) {\n\t\t\theader(\"Content-Type:text/html\");\n\t\t\tprint \"No records found.\";\n\t\t} elseif ($format == \"xml\") {\n\t\t\theader(\"Content-Type:text/xml\");\n\t\t\t$xml = $db -> MYSQL2XML2($result, \"ThinkFunBrainLab\", $table);\n\t\t\tprint $xml;\n\t\t} elseif ($format == \"html\") {\n\t\t\theader(\"Content-Type:text/html\");\n\t\t\tprint \"<HTML>\\n\";\n\t\t\tprint \"<BODY>\\n\";\n\t\t\t$html = $db -> MYSQL2HTML($result, \"ThinkFunBrainLab\", $table);\n\t\t\tprint $html;\n\t\t\tprint \"</BODY>\\n\";\n\t\t\tprint \"</HTML>\\n\";\n\t\t}\n\n\t\t$db -> close_connection();\n\t}", "function arrayToTable($array_assoc):void {\n if (is_array($array_assoc)) {\n echo '<table class=\"table\">';\n echo '<thead>';\n echo '<tr>';\n list($table_title) = $array_assoc;\n foreach ($table_title as $key => &$value):\n echo '<th>' . $key . '</th>';\n endforeach;\n echo '</tr>';\n echo '</thead>';\n foreach ($array_assoc as &$master):\n echo '<tr>';\n foreach ($master as &$slave):\n echo '<td>' . $slave . '</td>';\n endforeach;\n echo '</tr>';\n endforeach;\n echo '</table>';\n }\n}", "function printWhole($tableName)\n{\n $result = executePlainSQL(\"SELECT * FROM {$tableName}\");\n OCICommit($db_conn);\n\n echo \"<br>Table [{$tableName}]:<br>\";\n\n // table head\n $ncols = oci_num_fields($result);\n echo \"<table><tr>\";\n for ($i = 1; $i <= $ncols; $i++) {\n $column_name = oci_field_name($result, $i);\n echo \"<th>{$column_name}</th>\";\n }\n echo \"</tr>\";\n\n // table data\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\";\n for ($i = 0; $i < $ncols; $i++) {\n echo \"<td>{$row[$i]}</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "function displayResult($result, $sql) {\n if ($result->num_rows > 0) {\n echo \"<table border='1'>\\n\";\n // print headings (field names)\n $heading = $result->fetch_assoc( );\n echo \"<tr>\\n\";\n // print field names \n foreach($heading as $key=>$value){\n echo \"<th>\" . $key . \"</th>\\n\";\n }\n echo \"</tr>\\n\";\n \n // Print values for the first row\n echo \"<tr>\\n\";\n foreach($heading as $key=>$value){\n echo \"<td>\" . $value . \"</td>\\n\";\n }\n \n // output rest of the records\n while($row = $result->fetch_assoc()) {\n //print_r($row);\n //echo \"<br />\";\n echo \"<tr>\\n\";\n // print data\n foreach($row as $key=>$value) {\n echo \"<td>\" . $value . \"</td>\\n\";\n }\n echo \"</tr>\\n\";\n }\n echo \"</table>\\n\";\n } else {\n echo \"<strong>zero results using SQL: </strong>\" . $sql;\n }\n }", "function printTable($table)\r\n {\r\n //Get the column names\r\n $columnNames = array();\r\n $columns = parent::prepare(\"PRAGMA table_info($table);\");\r\n $columns->execute();\r\n foreach ($columns as $column) {\r\n array_push($columnNames, $column['name']);\r\n }\r\n\r\n //Get the table tuples\r\n $results = parent::prepare(\"SELECT * FROM $table;\");\r\n $results->execute();\r\n\r\n $out = \"\";\r\n\r\n //If there are results in the table, print the table\r\n if ($results != null) {\r\n print \"<table border=1 style='margin: 20px;border-collapse: collapse;'><tr style='padding: 4px;background: #eee;' >\";\r\n\r\n //Print each column name as headder\r\n foreach ($columnNames as $column) {\r\n $out .= \"<th style='padding: 4px;' >$column</th>\";\r\n }\r\n print $out;\r\n print \"</tr>\";\r\n\r\n //Print out the table rows\r\n while ($row = $results->fetch()) {\r\n $out = \"<tr>\";\r\n foreach ($columnNames as $column) {\r\n $out .= \"<td style='padding: 4px;'>$row[$column]</td>\";\r\n }\r\n print \"<tr>\";\r\n print $out;\r\n print \"</tr>\";\r\n }\r\n print \"</table>\";\r\n }\r\n }", "function test($query)\n{\n\techo '<table style=\"border:1px solid black; text-align:center; width:50%; margin-left:25%;\">';\n\tif($result = db_query($query))\n\t{\n\t\twhile($row = mysqli_fetch_row($result))\n\t\t{\n\t\t\techo '<tr>';\n\t\t\tforeach($row as $r)\n\t\t\t\techo \"<td style=\\\"border:1px solid black;\\\">$r</td>\";\n\t\t\techo '</tr>';\n\t\t}\n\t}\n\tmysqli_free_result($result);\n\techo '</table>';\n}", "function print_table($database_connection, $table_name) {\r\n\r\n $attributes = get_attributes($database_connection, $table_name);\r\n $tuples = get_rows($database_connection, $table_name);\r\n\r\n print(\"<table>\\n\");\r\n print(\"<tr>\\n\");\r\n for($i = 0; $i < count($attributes); $i++) {\r\n print(\"<th>{$attributes[$i]}</th>\\n\");\r\n }\r\n print(\"</tr>\\n\");\r\n for($j = 0; $j < count($tuples); $j++) {\r\n print(\"<tr>\\n\");\r\n foreach($attributes as $attribute) {\r\n print(\"<td>{$tuples[$j][$attribute]}</td>\\n\");\r\n }\r\n print(\"</tr>\\n\");\r\n }\r\n\r\n print(\"</table>\\n\");\r\n }", "function printTable($rows, $cols){\n\techo \"<table border=1>\";\n\n\tfor ($i=0; $i < $rows; $i++) { \n\t\techo \"<tr>\";\n\t\tfor ($j=0; $j < $cols; $j++) { \n\t\t\techo \"<td> Content </td>\";\n\t\t}\n\n\t\techo \"</tr>\";\n\n\t}\n\n\techo \"</table>\";\n}", "function make_table($table) {\n return print_table($table, true);\n}", "function printResult($result)\n{\n echo \"<br>Result:<br>\";\n\n // table head\n $ncols = oci_num_fields($result);\n echo \"<table><tr>\";\n for ($i = 1; $i <= $ncols; $i++) {\n $column_name = oci_field_name($result, $i);\n echo \"<th>{$column_name}</th>\";\n }\n echo \"</tr>\";\n\n // table data\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\";\n for ($i = 0; $i < $ncols; $i++) {\n echo \"<td>{$row[$i]}</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "function createTableDisplay($STID){\n\n\n echo \"<table border='1'>\\n\";\n while ($row = oci_fetch_array($STID, OCI_ASSOC+OCI_RETURN_NULLS)) {\n echo \"<tr>\\n\";\n foreach ($row as $item) {\n echo \" <td>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</td>\\n\";\n }\n echo \"</tr>\\n\";\n }\n echo \"</table>\\n\";\n\n }", "function printTable($resultFromSQL, $namesOfColumnsArray)\n{\n echo \"<br>Here is the output, nicely formatted:<br>\";\n echo \"<table>\";\n echo \"<tr>\";\n // iterate through the array and print the string contents\n foreach ($namesOfColumnsArray as $name) {\n echo \"<th>$name</th>\";\n }\n echo \"</tr>\";\n\n while ($row = OCI_Fetch_Array($resultFromSQL, OCI_BOTH)) {\n echo \"<tr>\";\n $string = \"\";\n\n // iterates through the results returned from SQL query and\n // creates the contents of the table\n for ($i = 0; $i < sizeof($namesOfColumnsArray); $i++) {\n $string .= \"<td>\" . $row[\"$i\"] . \"</td>\";\n }\n echo $string;\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "function DisplayDBasTable($db, $sql, $showID)\n {\n $showHeader=true;\n \t$result = $db->query($sql);\n //echo $sql . '<br>';\n \techo \"<table border='1'>\";\n \t$rowCounter=0;\n \twhile ($row = $result->fetch_assoc()){\n \t $rowCounter++;\n if ($showHeader)\n {\n \t\techo \"<tr onclick='myFolderFunction(this)'>\";\n \t foreach ($row as $key => $value)\n \t {\n \t\t\tif (($showID) || ($key!='id'))\n \t\t\t{\n \t\t\t echo \"<th>$key</th>\";\n \t\t\t};\n \t\t};\n \t\techo \"</tr>\";\n $showHeader=false;\n };\n reset($row);\n debug_to_console($rowCounter);\n \t echo \"<tr\";\n if($rowCounter%2 > 0){ \n echo \" class='even'\";\n } \n else{ \n \n };\n echo \" onclick='myFolderFunction(this)'>\";\n \t foreach ($row as $key => $value)\n \t {\n \t\t\tif (($showID) || ($key!='id'))\n \t\t\t{\n \t\t echo '<td>'.$value . ' </td>';\n \t\t\t};\n \t };\n \t\techo \"</tr>\";\n \t};\n \techo \"</table>\";\n \treturn true;\n }", "function printTable($array,$m,$n){\necho \"<br>\"; \nfor ($i = 0; $i <= $m; $i++) \n{ \nfor ($j = 0; $j <= $n; $j++) \n{ \n echo $array[$i][$j].\" \";\n}\n echo \"<br>\";\n}\n\n echo \"<br>\";\n echo \"<br>\";\n}", "public function table()\n\t{\n\t\t$this->datatables->select('testcat.test_id AS test_id, testcat_id, gender, age, score, percentile, percentile.id AS id');\n\t\t$this->datatables->from('percentile');\n\t\t$this->datatables->join('testcat', 'testcat.id = percentile.testcat_id');\n\n\t\t$this->datatables->edit_column('test_id', '$1', 'test_get_link_by_id(test_id)');\n\t\t$this->datatables->edit_column('testcat_id', '$1', 'testcat_get_link_by_id(testcat_id)');\n\t\t$this->datatables->edit_column('gender', '$1', 'gender(gender)');\n\t\t$this->datatables->edit_column('id', '$1', 'percentile_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}", "public function print(): void\n {\n $values = $this->table->getValues();\n $size = $this->table->getSize();\n echo \"<table>\";\n foreach ($values as $index => $row) {\n if ($index === 1) {\n echo \"<tr><th>*</th>\";\n foreach ($row as $cell) {\n echo \"<th style='width:\" . (100 / ($size + 1)) . \"%'>\" . $cell . \"</th>\";\n }\n echo \"</tr>\";\n }\n echo \"<tr>\";\n echo \"<th style='width:\" . (100 / ($size + 1)) . \"%'>{$index}</th>\";\n foreach ($row as $cell) {\n echo \"<td style='width:\" . (100 / ($size + 1)) . \"%'>\" . $cell . \"</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "function showtable()\r\n {\r\n $c=$this->connector();\r\n $r='';\r\n $r.=$this->logout();\r\n $r.=\"<div id='isi'>\r\n <center><a href='?act=mysql'>Show Database</a></center><br />\r\n <table width=50% align='center' class='xpltab' cellspacing=0 ><tr><th style='border-left:thin solid #f00;'>Table</th><th>Column count</th><th>Dump</th><th>Drop</th></tr>\";\r\n $db=$_GET['db'];\r\n $query=$this->qe(\"SHOW TABLES FROM $db\");\r\n while($data=mysql_fetch_array($query))\r\n {\r\n\r\n $iml=$this->qe(\"SHOW COLUMNS FROM $db.$data[0]\");\r\n $h=(mysql_num_rows($iml))?mysql_num_rows($iml):0;\r\n $r.= \"<tr><td><a href='?act=showcon&db=$db&table=$data[0]'>$data[0]</td><td>$h</td><td><a href='?act=downdb&db=$db&table=$data[0]'>Dump</a></td><td><a href='?act=dropdb&db=$db&tbl=$data[0]'>Drop</a></td></tr>\";\r\n \r\n }\r\n \r\n $r.= \"</table>\".$this->sqlcommand().\"</div>\";\r\n return $r;\r\n $this->free($query);\r\n $this->free($iml);\r\n mysql_close($c);\r\n }", "function showTable(&$database)\n{\n $columns = $database->query(\"SHOW TABLES\")->fetchAll();\n\n foreach ($columns as $col) {\n echo '<a href=\"./table.php?name=' . $col[0] . '\" >';\n echo \"$col[0] </a> <br/>\";\n }\n\n\n}", "public function show_table_sturcture()\n\t{\n\t\t$str_input_html = \"\";\n\t\t$table = \"default_module_test\";\n\t\t$table = $this->db->escape_str($table);\n\t\t//$sql = \"DESCRIBE `$table`\";\n\t\t//$desc = $this->db->where('Field','sorts')->query($sql)->row();\n\t\t$desc = Easy_Database_Manage::get_table_desc($table);\n\t\techo \"<pre>\";\n\t\techo print_r($desc);\n\t\techo \"</pre>\";\n\t\n\t}", "public function showTable($table){\n\n\t\t$query = $this->db->prepare(\"SELECT * FROM $table\");\n\t\t$query->execute();\n\n\t\t//Returns an indexed array\n\t\treturn $query->fetchAll(PDO::FETCH_NUM);\n\t}", "public function show(Table $table)\n {\n //\n }", "function displayData($table, $tableID = \"\")\r\n {\r\n if (!is_null($this->data)) {\r\n echo $this->db->getDataByID($table, $tableID, $this->data);\r\n } else {\r\n if (empty($this->db->retriveData($table))) {\r\n echo json_encode($this->db->getColumnName($table));\r\n } else {\r\n echo json_encode($this->db->retriveData($table));\r\n }\r\n }\r\n }", "function print_tables($database_connection) {\r\n\r\n $tables = get_tables($database_connection);\r\n\r\n foreach($tables as $table) {\r\n print(\"<h3>{$table}</h3>\");\r\n print_table($database_connection, $table);\r\n print(\"<br><br>\");\r\n }\r\n }", "function displayTable($filename)\r\n\t\t{\r\n\t\t\t$myTable = \"\\n<table border='1'>\";\r\n\r\n\t\t\t$myTable .= \"<tr>\";\r\n\t\t\t$myTable .= \" <th>Last name</th>\";\r\n\t\t\t$myTable .= \" <th>First name</th>\";\r\n\t\t\t$myTable .= \"</tr>\\n\\n\";\r\n\r\n\t\t\t$line_ctr = 0;\r\n\r\n\t\t\t$fp = fopen($filename, 'r');\r\n\t\t\tif ($fp){\r\n\t\t\t\twhile(true){\r\n\t\t\t\t\t$line = fgets($fp);\r\n\t\t\t\t\tif (feof($fp)){\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$line_ctr++;\r\n\r\n\t\t\t\t\t$line_ctr_remainder = $line_ctr % 2;\r\n\t\t\t\t\tif ($line_ctr_remainder == 0){\r\n\t\t\t\t\t\t$style = \"style='background-color: #ffc;'\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$style = \"style='background-color: #fff;'\";\r\n\t\t\t\t\t} // if for line_ctr_remainder\r\n\t\t\t\t\tlist($lastname, $firstname) = explode('|',$line);\r\n\r\n\t\t\t\t\t$myTable .=\"<tr $style>\";\r\n\t\t\t\t\t\t$myTable .=\"<td>\".$lastname.\"</td>\";\r\n\t\t\t\t\t\t$myTable .=\"<td>\".$firstname.\"</td>\";\r\n\t\t\t\t\t$myTable .=\"</tr> \\n\"; // add new line fot html formating\r\n\t\t\t\t} // end while\r\n\t\t\t\tfclose($fp);\r\n\t\t\t\t$myTable .= \"</table>\";\r\n\t\t\t\t$rtn = array($line_ctr, $myTable);\r\n\t\t\t} else {\r\n\t\t\t\t$rtn = array(\"No file\",\"Dummy\");\r\n\t\t\t}\r\n\t\t\treturn $rtn;\r\n\t\t}", "function display_plugins_table()\n {\n }", "function ispis_tablice($ucenici)\n {\n echo '<table border=1>';\n foreach ($ucenici as $key => $ime) {\n echo '<tr><td>'\n .$key.'</td>;\n <td>'.$ime.'</td>;\n </tr>';\n }\n echo '</table>';\n }", "public static function show_tables( $table_name ){\n $tables = Capsule::schema()->getAllTables();\n \n if( $tables ) {\n for( $i = 0; $i < count( $tables ); $i++ ) {\n echo Message::color_text( ' TABLE ', '44') .\n Message::color_text( $tables[$i]->$table_name, '104' ) . PHP_EOL;\n }\n }\n }", "function printTable($array2d, $keys)\n\t{\n\t\t// Begin table\n\t\techo \"<table class='table table-hover'>\";\t\t// added table style\n\t\t\n\t\t// Add table head row from keys\n\t\techo \"<thead>\";\n\t\tforeach ($keys as $rowHead)\n\t\t{\n\t\t\t\techo \"<th class='success'>$rowHead</th>\";\t\t// added text color style\n\t\t}\n\t\techo \"</thead>\";\n\t\t\n\t\t// Add table rows of content for each event\n\t\tforeach ($array2d as $indexR=>$record)\n\t\t{\n\t\t\techo \"<tr>\";\n\t\t\t// Iterate through each array element's contents and place in a table cell\n\t\t\tforeach ($record as $indexF=>$field)\n\t\t\t{\t\n\t\t\t\tif ($indexF == \"Time\")\t\t\t// This seems like a bad practice have the keys as an parameter but hard code this statement\n\t\t\t\t\techo \"<td>\" . date('j M Y g:i a', $field) . \"</td>\";\n\t\t\t\telse\n\t\t\t\t\techo \"<td>$field</td>\";\n\t\t\t}\n\t\t\t\t\t\n\t\t\t// This seems like a bad practice to have the keys as a parameter but hard code this statement\n\t\t\t// If the current array element's eventId is the same as the session's userId, add an extra edit/delete option.\n\t\t\tif ($record['User ID'] == $_SESSION[\"userId\"])\n\t\t\t{\n\t\t\t\t$i = $record['Event ID'];\n\t\t\t\techo \"<td><a href='ecmain.php?action=EditEvent&EventId=$i'>edit</a>&nbsp;/&nbsp;<a href='ecmain.php?action=DeleteEvent&EventId=$i'>delete</a></td>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<td></td>\";\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\t\t\n\t\t// End table\n\t\techo \"</table>\";\n\t}", "function display_table($tab_name) {\n $mysqli = $this->mysqli;\n $sql = \"SELECT * FROM $tab_name\";\n if ($val = $mysqli->query($sql)) return $val;\n else {\n echo $mysqli->error;\n }\n }", "function dumpTable($passedArray) {\n\techo '<br><table border=\"1\" cellpadding=\"3\" frame=\"border\" rules=\"all\">';\n\tforeach($passedArray as $row) {\n\t\techo '<tr><td>';\n\t\techo implode('</td><td>', $row);\n\t\techo '</td></tr>';\n\t}\n\techo '</table><br>';\n\t@ob_flush();\n\t@flush();\t\n\treturn;\n}", "private function _display_data_table(){\n\t\t\t$fields = array();\n\t\t\t$query = \"DESCRIBE `\".$this->class_settings['database_name'].\"`.`\".$this->table_name.\"`\";\n\t\t\t$query_settings = array(\n\t\t\t\t'database'=>$this->class_settings['database_name'],\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'DESCRIBE',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n\t\t\t$sql_result = execute_sql_query($query_settings);\n\t\t\t\n\t\t\tif($sql_result && is_array($sql_result)){\n\t\t\t\tforeach($sql_result as $sval)\n\t\t\t\t\t$fields[] = $sval;\n\t\t\t}else{\n\t\t\t\t//REPORT INVALID TABLE ERROR\n\t\t\t\t$err = new cError(000001);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t\n\t\t\t\t$err->class_that_triggered_error = 'centry_exit_log.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_display_data_table';\n\t\t\t\t$err->additional_details_of_error = 'executed query '.str_replace(\"'\",\"\",$query).' on line 208';\n\t\t\t\treturn $err->error();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//INHERIT FORM CLASS TO GENERATE TABLE\n\t\t\t$form = new cForms();\n\t\t\t$form->setDatabase( $this->class_settings['database_connection'] , $this->table_name , $this->class_settings['database_name'] );\n\t\t\t$form->uid = $this->class_settings['user_id']; //Currently logged in user id\n\t\t\t$form->pid = $this->class_settings['priv_id']; //Currently logged in user privilege\n\t\t\t\n\t\t\t$this->datatable_settings['current_module_id'] = $this->class_settings['current_module'];\n\t\t\t\n\t\t\t$form->datatables_settings = $this->datatable_settings;\n\t\t\t\n\t\t\t$returning_html_data = $form->myphp_dttables($fields);\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'display-datatable',\n\t\t\t);\n\t\t}", "function printResult($result) {\n\techo \"result from SQL:\";\n echo \"<table>\";\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\\n\";\n foreach ($row as $item) {\n echo \" <td>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</td>\\n\";\n }\n echo \"</tr>\\n\";\n }\n echo \"</table>\\n\";\n}", "function multiple_arrayDisplay($multiple_array)\n{\n $r = '';\n $r .= '<style> td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n foreach ($multiple_array[0] as $key => $value) {\n $r .= '<th>'.$key.'</th>';\n }\n $r .= '</tr>';\n foreach ($multiple_array as $key => $value) {\n $r .= '<tr>';\n foreach ($value as $key1 => $value1) {\n if ($key1 == 'price') {\n $r .= '<td> $'.$value1.' </td>';\n } else {\n $r .= '<td>'.$value1.' </td>';\n }\n }\n $r .= '</tr>';\n }\n $r .= '</table>';\n\n return $r;\n}", "function multiple_arrayDisplay($multiple_array)\n{\n $r = '';\n $r .= '<style> td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n foreach ($multiple_array[0] as $key => $value) {\n $r .= '<th>'.$key.'</th>';\n }\n $r .= '</tr>';\n foreach ($multiple_array as $key => $value) {\n $r .= '<tr>';\n foreach ($value as $key1 => $value1) {\n if ($key1 == 'price') {\n $r .= '<td> $'.$value1.' </td>';\n } else {\n $r .= '<td>'.$value1.' </td>';\n }\n }\n $r .= '</tr>';\n }\n $r .= '</table>';\n\n return $r;\n}", "function dumpTable($passedArray) {\n\t\n\techo '<br><table border=\"1\" cellpadding=\"3\" frame=\"border\" rules=\"all\">';\n\tforeach($passedArray as $row) {\n\t\techo '<tr><td>';\n\t\techo implode('</td><td>', $row);\n\t\techo '</td></tr>';\n\t}\n\techo '</table><br>';\n\t@ob_flush();\n\t@flush();\n\n\treturn;\n}", "private function _display_data_table(){\n\t\t\t$fields = array();\n\t\t\t$query = \"DESCRIBE `\".$this->class_settings['database_name'].\"`.`\".$this->table_name.\"`\";\n\t\t\t$query_settings = array(\n\t\t\t\t'database'=>$this->class_settings['database_name'],\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'DESCRIBE',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n\t\t\t$sql_result = execute_sql_query($query_settings);\n\t\t\t\n\t\t\tif($sql_result && is_array($sql_result)){\n\t\t\t\tforeach($sql_result as $sval)\n\t\t\t\t\t$fields[] = $sval;\n\t\t\t}else{\n\t\t\t\t//REPORT INVALID TABLE ERROR\n\t\t\t\t$err = new cError(000001);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t\n\t\t\t\t$err->class_that_triggered_error = 'cCountry_list.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_display_data_table';\n\t\t\t\t$err->additional_details_of_error = 'executed query '.str_replace(\"'\",\"\",$query).' on line 208';\n\t\t\t\treturn $err->error();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//INHERIT FORM CLASS TO GENERATE TABLE\n\t\t\t$form = new cForms();\n\t\t\t$form->setDatabase( $this->class_settings['database_connection'] , $this->table_name , $this->class_settings['database_name'] );\n\t\t\t$form->uid = $this->class_settings['user_id']; //Currently logged in user id\n\t\t\t$form->pid = $this->class_settings['priv_id']; //Currently logged in user privilege\n\t\t\t\n\t\t\t$this->datatable_settings['current_module_id'] = $this->class_settings['current_module'];\n\t\t\t\n\t\t\t$form->datatables_settings = $this->datatable_settings;\n\t\t\t\n\t\t\t$returning_html_data = $form->myphp_dttables($fields);\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'display-datatable',\n\t\t\t);\n\t\t}", "function viewTable($parks)\n{\n return formatTable($parks);\n}", "public static function printArray($array, $border) {\r\n\r\n/* This function loops through a simple (1D)\r\n array and prints out all the values in a \r\n table. This is used for diagnostic\r\n purposes primarily, although there \r\n can be other applications. */\r\n \r\n // Check that the array exists\r\n if (!$array) {\r\n echo \"No array specified.<BR><BR>\";\r\n return;\r\n }\r\n \r\n else {\r\n // Start table\r\n echo \"<TABLE BORDER=$border>\";\r\n \r\n // Print the array in table cells\r\n foreach ($array as $value) {\r\n echo \"<TR><TD>$value</TD></TR>\"; \r\n } // end of while loop\r\n \r\n // End table and return\r\n echo \"</TABLE>\";\r\n return;\r\n } // end of else\r\n\r\n}", "function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}", "function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}", "function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}", "function showDataTable(){\n\t\t$output = \"\";\n\t\t// print the table\n\t\t$output .= \"<table summary=\\\"\".$this->summary.\"\\\">\\n\";\n\t\t// print the caption\n\t\t$output .= \"<caption>\".$this->caption.\"</caption>\\n\";\n\t\t$output .= $this->showHeader();\n\t\t// initialise variables\n\t\t$altCounter = 0;\n\t\t$altClass = \"\";\n\t\t$h = 1;\n\t\t// loop each row\n\t\tfor ($x=0; $x<count($this->rows); $x++) {\n\t\t\t// if it is time to show the header\n\t\t\tif ($h==$this->headerRepeat){\n\t\t\t\t// show the header\n\t\t\t\t$output .= $this->showHeader();\n\t\t\t\t$h = 1;\n\t\t\t}\n\t\t\t$row = $this->rows[$x];\n\t\t\t// alternate the row classes\n\t\t\tif ($this->altClasses){\n\t\t\t\tif ($this->altClasses[$altCounter]!=\"\"){ $altClass = \" class=\\\"\".$this->altClasses[$altCounter].\"\\\"\"; } else { $altClass=\"\"; }\n\t\t\t\tif ($altCounter==count($this->altClasses)-1){ $altCounter=0; } else { $altCounter++; }\n\t\t\t}\n\t\t\t// set the parameters to nothing\n\t\t\t$params = \"\";\n\t\t\t// if there are parameters for this row set\n\t\t\tif (count($this->rowParams[$x])>0){\n\t\t\t\t// loop the parameters\n\t\t\t\twhile (list($attribute, $parameter) = each($this->rowParams[$x])) {\n\t\t\t\t\t// if the parameter is 'class'\n\t\t\t\t\tif (strtolower($attribute)==\"class\"){\n\t\t\t\t\t\t// replace the altClass variable\n\t\t\t\t\t\t$altClass = \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t} else{\n\t\t\t\t\t\t// otherwise build the parameters\n\t\t\t\t\t\t$params .= \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// print the row\n\t\t\t$output .= \"\t<tr$altClass$params>\\n\";\n\t\t\t\t// set the colSpan to 0\n\t\t\t\t$colSpan = 0;\n\t\t\t\t$colSpanAttribute = \"\";\n\t\t\t\t// if this row has less columns than the number of fields\n\t\t\t\tif (count($row)<count($this->fields)){\n\t\t\t\t\t$colSpan = (count($this->fields)-count($row))+1;\n\t\t\t\t}\n\t\t\t\t// loop each cell\n\t\t\t\tfor ($i=0; $i<count($row); $i++) {\n\t\t\t\t\t$value = $row[$i];\n\t\t\t\t\t$value = $this->formatField($i, $x);\n\t\t\t\t\t// make the colspan attribute\n\t\t\t\t\tif ($colSpan>0 && $i==(count($row)-1)){ $colSpanAttribute = \" colspan=\\\"$colSpan\\\"\"; }\n\t\t\t\t\t// print the cell\n\t\t\t\t\t$output .= \"\t\t<td$colSpanAttribute>\".$value.\"</td>\\n\";\n\t\t\t\t}\n\t\t\t// end the row\n\t\t\t$output .= \"\t</tr>\\n\";\n\t\t\t// increment the header repeat variable\n\t\t\t$h++;\n\t\t}\n\t\t// end the table\n\t\t$output .= \"</table>\\n\\n\";\n\t\tprint $output;\n\t}", "function draw_table($rows) {\n \n echo \"<table border=1 cellspacing=1>\"; //Set up border and spacing\n echo \"<tr>\"; //Begin the table row insertion for header row\n \n foreach($rows[0] as $key => $item) {\n \n echo \"<th>$key</th>\";\n \n }\n \n echo \"</tr>\";\n \n // Insert data into each row\n foreach ($rows as $row) {\n \n echo \"<tr>\";\n \n foreach ($row as $key => $item) {\n \n echo \"<td>$item</td>\"; //Table data\n \n }\n \n echo \"</tr>\";\n \n }\n \n echo \"</table>\";\n \n }", "function display_table($sql, $tid) {\n \n $userdb = userConnect();\n \n try {\n //code to print column headings\n $stmt = $userdb->query($sql . ' LIMIT 1');\n $fields = array_keys($stmt->fetch(PDO::FETCH_ASSOC));\n echo '<table id=\"' . $tid . '\" class=\"recordset\">';\n echo '<thead>';\n echo '<tr id=\"header\">';\n echo '<td></td>'; //empty cell for checkbox column\n for ($i = 1; $i < count($fields); $i++) {\n echo '<td>' . $fields[$i] . '</td>';\n }\n echo '</tr>';\n echo '</thead>';\n $stmt = null;\n \n //code to print records\n $stmt = $userdb->query($sql);\n echo '<tbody>';\n while ($record = $stmt->fetch(PDO::FETCH_NUM)) {\n $rowcount++;\n if ($rowcount % 2 == 0) {\n echo '<tr id=\"' . $record[0] .'\" class=\"altrow\">';\n } else {\n echo '<tr id=\"' . $record[0] .'\">';\n }\n echo '<td><input type=\"checkbox\" class=\"recordselect\" id=\"' . $record[0] . '\"/></td>';\n for ($i = 1; $i < count($record); $i++) {\n echo '<td>' . $record[$i] . '</td>';\n }\n echo '</tr>';\n }\n echo '</tbody>'; \n echo '</table>';\n } catch(PDOException $e) {\n echo $e->getMessage();\n die();\n }\n }", "function make_table($query) {\r\n\t\techo \"<table><tr>\";\r\n\t\t$row = mysqli_fetch_assoc($query);\r\n\t\tforeach ($row as $attr => $value) {\r\n\t\t\techo \"<th>$attr</th>\";\r\n\t\t}\r\n\t\techo \"</tr>\";\r\n\t\twhile ($row = mysqli_fetch_assoc($query)) { \r\n\t\t\techo \"<tr>\";\r\n\t\t\tforeach($row as $value) {\r\n\t\t\t\techo \"<td>$value</td>\";\r\n\t\t\t}\r\n\t\t\techo \"</tr>\";\r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "public function array2table($array, $table = true) {\n $out = '';\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n\n /** if (!isset($tableHeader)) { \n $tableHeader =\n '<tr><th>' .\n implode('</th><th>', array_keys($value)) .\n '</th></tr>';\n } **/ \n array_keys($value);\n\n $out .= \"\\n<tr>\";\n $out .= $this->array2table($value, false);\n $out .= \"</tr>\\n\";\n } else {\n \n $out .= \"<td>$value</td>\";\n\n }\n }\n // build it up \n if ($table) { \n $sort_buttons = $this->BuildSortButtons(); \n \n return \"\\n<table>\\n\" . $sort_buttons . $out . \"\\n</table>\\n\";\n\n } else {\n \n return $out;\n } \n }", "function print_pure_table($query_result, $headers) {\n echo \"<table class=\\\"pure-table pure-table-bordered\\\">\";\n if ($headers) {\n echo $headers;\n } else {\n echo \"<thead><tr>\";\n for ($i = 0; $i < pg_num_fields($query_result); $i++) {\n $fieldname = pg_field_name($query_result, $i);\n echo \"<th>$fieldname</th>\";\n }\n echo \"</tr></thead>\";\n }\n \n echo \"<tbody>\";\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n echo \"<td>$row[$i]</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</tbody>\";\n echo \"</table>\";\n }", "function affichage_sudoku($sudoku) {\n echo \"<table border=1px width=500px><tr>\";\n for ($i = 1; $i <= 9; $i++) {\n for ($j = 1; $j <= 9; $j++) {\n echo \"<td>\" . $sudoku[$i][$j] . \"</td>\";\n }\n if ($i < 9)\n echo \"</tr><tr>\";\n else\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "public function showTable() {\n\t\t$tableName = $this->request->getVariable('id');\n\t\t$this->smarty->assign('dbTableObject',new $tableName());\n\t\t$this->pageDisplay('tools');\n\t}", "private function _display_data_table(){\n\t\t\t$fields = array();\n\t\t\t$query = \"DESCRIBE `\".$this->class_settings['database_name'].\"`.`\".$this->table_name.\"`\";\n\t\t\t$query_settings = array(\n\t\t\t\t'database'=>$this->class_settings['database_name'],\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'DESCRIBE',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n\t\t\t$sql_result = execute_sql_query($query_settings);\n\t\t\t\n\t\t\tif($sql_result && is_array($sql_result)){\n\t\t\t\tforeach($sql_result as $sval)\n\t\t\t\t\t$fields[] = $sval;\n\t\t\t}else{\n\t\t\t\t//REPORT INVALID TABLE ERROR\n\t\t\t\t$err = new cError(000001);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t\n\t\t\t\t$err->class_that_triggered_error = 'cdiscount.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_display_data_table';\n\t\t\t\t$err->additional_details_of_error = 'executed query '.str_replace(\"'\",\"\",$query).' on line 208';\n\t\t\t\treturn $err->error();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//INHERIT FORM CLASS TO GENERATE TABLE\n\t\t\t$form = new cForms();\n\t\t\t$form->setDatabase( $this->class_settings['database_connection'] , $this->table_name , $this->class_settings['database_name'] );\n\t\t\t$form->uid = $this->class_settings['user_id']; //Currently logged in user id\n\t\t\t$form->pid = $this->class_settings['priv_id']; //Currently logged in user privilege\n\t\t\t\n\t\t\t$this->datatable_settings['current_module_id'] = $this->class_settings['current_module'];\n\t\t\t\n\t\t\t$form->datatables_settings = $this->datatable_settings;\n\t\t\t\n\t\t\t$returning_html_data = $form->myphp_dttables($fields);\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'display-datatable',\n\t\t\t);\n\t\t}", "abstract function display();", "abstract function display();", "function printResult($result) {\n echo \"<br>Retrieved data from table demoTable:<br>\";\n echo \"<table>\";\n echo \"<tr><th>ID</th><th>Name</th></tr>\";\n\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[\"ID\"] . \"</td><td>\" . $row[\"NAME\"] . \"</td></tr>\"; //or just use \"echo $row[0]\"\n }\n\n echo \"</table>\";\n }", "function showTestTable(&$dbh,$d)\n {\n $shown = 0;\n $dbh->QueryResult('SELECT ID,VAL FROM OCI8_CLASS_TEST_TABLE ORDER BY ID');\n while($data = $dbh->FetchResult())\n {\n printf(\"%5d. %s%s\",$data['ID'],$data['VAL'],$d['LF']);\n $shown++;\n }\n $dbh->FreeResult();\n if(!$shown)\n {\n printf(\"No data in table.%s\",$d['LF']);\n }\n }", "function outputFormat(array $headers, array $cells, $result, $content_name) {\necho '<h3>'.ucfirst($content_name).' Content</h3>';\necho '<table>';\nforeach ($headers as $val) {\necho '<th>'.$val.'</th>';\n}\nwhile($row = mysqli_fetch_array($result))\n {\n echo '<tr>';\n foreach ($cells as $val) {\n echo '<td>'.$row[$val].'</td>';\n }\n echo '</tr>';\n }\n echo '</table>';\n}", "public function display_table_contents() {\n\t\t// Display what is in the table.\n\t\tprintf(\n\t\t\t'<p>%s</p>',\n\t\t\tesc_html( __( 'Currently in the database:', 'autowpdb-example-plugin' ) )\n\t\t);\n\n\t\tif ( empty( $this->table_contents ) ) {\n\t\t\tesc_html_e( 'Nothing yet.', 'autowpdb-example-plugin' );\n\t\t\treturn;\n\t\t}\n\n\t\t$table_contents = $this->dump_data( $this->table_contents );\n\n\t\tif ( strpos( $table_contents, '<pre' ) !== 0 ) {\n\t\t\t// Classic output.\n\t\t\tprintf( '<pre>%s</pre>', esc_html( $table_contents ) );\n\t\t\treturn;\n\t\t}\n\n\t\t// Xdebug.\n\t\techo wp_kses(\n\t\t\t$table_contents,\n\t\t\t[\n\t\t\t\t'b' => [],\n\t\t\t\t'font' => [\n\t\t\t\t\t'color' => true,\n\t\t\t\t],\n\t\t\t\t'i' => [],\n\t\t\t\t'pre' => [\n\t\t\t\t\t'class' => true,\n\t\t\t\t\t'dir' => true,\n\t\t\t\t],\n\t\t\t\t'small' => [],\n\t\t\t]\n\t\t);\n\t}", "function printTable ($backArray, $geoArray, $socArray, $enerArray, $commArray) {\n \n \n // Variables to check the categories array sizes\n $backSize = count($backArray);\n $geoSize = count($geoArray);\n $socSize = count($socArray);\n $enerSize = count($enerArray);\n $commSize = count($commArray);\n \n \n // Error checking if nothing was selected\n \n if ($backSize != 0 || $geoSize != 0 || $socSize != 0 || $enerSize != 0 || $commSize != 0) {\n \n // open the table border\n print \"<table><tr>\";\n \n if ($backSize != 0) {\n \n for ($i = 0; $i < $backSize; $i++) {\n \n if ($backArray[$i][0] == 0) {\n \n $cleanStr = substr_replace($backArray[$i], \"\", 0,1);\n \n print \"<th>\" . $cleanStr . \"</th>\";\n \n }\n if ($backArray[$i][0] == 1) {\n \n print \"<tr>\";\n \n $cleanStr1 = substr_replace($backArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr1 . \"</td>\";\n \n }\n \n if ($backArray[$i][0] == 2) {\n \n $cleanStr2 = substr_replace($backArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr2 . \"</td>\";\n \n print \"</tr>\";\n \n }\n }\n }\n \n if ($geoSize != 0) {\n \n for ($i = 0; $i < $geoSize; $i++) {\n \n if ($geoArray[$i][0] == 0) {\n \n $cleanStr = substr_replace($geoArray[$i], \"\", 0,1);\n \n print \"<th>\" . $cleanStr . \"</th>\";\n }\n \n if ($geoArray[$i][0] == 1) {\n \n print \"<tr>\";\n \n $cleanStr1 = substr_replace($geoArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr1 . \"</td>\";\n }\n \n if ($geoArray[$i][0] == 2) {\n \n $cleanStr2 = substr_replace($geoArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr2 . \"</td>\";\n \n print \"</tr>\";\n \n }\n }\n }\n \n if ($socSize != 0) {\n for ($i = 0; $i < $socSize; $i++) {\n \n if ($socArray[$i][0] == 0) {\n \n $cleanStr = substr_replace($socArray[$i], \"\", 0,1);\n \n print \"<th>\" . $cleanStr . \"</th>\";\n }\n if ($socArray[$i][0] == 1) {\n \n print \"<tr>\";\n \n $cleanStr1 = substr_replace($socArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr1 . \"</td>\";\n \n }\n if ($socArray[$i][0] == 2) {\n \n $cleanStr2 = substr_replace($socArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr2 . \"</td>\";\n \n print \"</tr>\";\n }\n }\n }\n if ($enerSize != 0) { \n \n for ($i = 0; $i < $enerSize; $i++) {\n \n if ($enerArray[$i][0] == 0) {\n \n $cleanStr = substr_replace($enerArray[$i], \"\", 0,1);\n \n print \"<th>\" . $cleanStr . \"</th>\";\n }\n \n if ($enerArray[$i][0] == 1) {\n \n print \"<tr>\";\n \n $cleanStr1 = substr_replace($enerArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr1 . \"</td>\";\n \n }\n \n if ($enerArray[$i][0] == 2) {\n \n $cleanStr2 = substr_replace($enerArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr2 . \"</td>\";\n \n print \"</tr>\";\n \n }\n }\n } \n if ($commSize != 0) { \n \n for ($i = 0; $i < $commSize; $i++) {\n if ($commArray[$i][0] == 0) {\n \n $cleanStr = substr_replace($commArray[$i], \"\", 0,1);\n \n print \"<th>\" . $cleanStr . \"</th>\";\n }\n if ($commArray[$i][0] == 1) {\n \n print \"<tr>\";\n \n $cleanStr1 = substr_replace($commArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr1 . \"</td>\";\n \n }\n if ($commArray[$i][0] == 2) {\n \n $cleanStr2 = substr_replace($commArray[$i], \"\", 0,1);\n \n print \"<td>\" . $cleanStr2 . \"</td>\";\n \n print \"</tr>\";\n }\n }\n }\n print \"</tr></table>\";\n \n print \"<hr>\";\n \n echo \"<h3>\" . \"Chart of the Data Selected\" . \"</h2>\";\n \n }\n else {\n echo \"<h2>\" . \"No data Selected\" . \"</h2>\";\n \n }\n }", "function html_table_data($dbtable, $sqlquery = NULL){\n\t\t$i = 1;\n\t\t$db = ADONewConnection('mysql'); \n\t $db->debug = true; \n\t $db->Connect('localhost', 'xxxx', 'xxxx', 'xxxx'); \n\t if(!$db)\n\t \tdie(\"Database conn failed\");\n\t \t\n\t $rs = $db->GetAssoc(\"select * from $dbtable\");\n\t if (!$rs) {\n\t \tdie(\"Sql statement error\");\n\t } \n\t print (\"<div id=\\\"demo\\\"><table cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" border=\\\"0\\\" class=\\\"display\\\" id=\\\"example\\\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th>ID</th>\n\t\t\t\t<th>School</th>\n\t\t\t\t<th>Level</th>\n\t\t\t\t<th>Enrollment</th>\n\t\t\t</tr>\n\t\t</thead><tbody>\");\n\t foreach ($rs as $row){\n\t \techo(\"<tr id=\\\"$i\\\" class=\\\"gradeA\\\"><td>\".\n\t \t$row['id'].\"</td><td>\".$row['school'].\"</td><td class=\\\"center\\\">\".\n\t \t$row['level'].\"</td><td class=\\\"center\\\">\".$row['enrollment'].\"</td>\n\t\t\t</tr>\");\n\t \t$i++;\t \t\t\n\t }\n\t\t echo (\"</tbody>\n\t\t\t\t\t<tfoot>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>ID</th>\n\t\t\t\t\t\t<th>School</th>\n\t\t\t\t\t\t<th>Level</th>\n\t\t\t\t\t\t<th>Enrollment</th>\t\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tfoot>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\");\n\t $db->Close();\n\t}", "function printResult($result) {\n echo \"<br>Retrieved data from table demoTable:<br>\";\n echo \"<table>\";\n echo \"<tr><th>ID</th><th>Name</th></tr>\";\n\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[\"ID\"] . \"</td><td>\" . $row[\"NAME\"] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n }\n\n echo \"</table>\";\n }", "function tabla($lista, $totalColumnas) {\n $totalFilas = count($lista) / $totalColumnas;\n echo \"<table border='1'>\";\n for ($fila = 0; $fila < $totalFilas; $fila++) {\n echo \"<tr>\";\n for ($i=0;$i<$totalColumnas;$i++) {\n $posicion = $totalColumnas * $fila + $i;\n if ($posicion < count($lista)) {\n $contenido = $lista[$posicion];\n } else {\n $contenido = \"\";\n }\n echo \"<td>\".$contenido.\"</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "function _showTables() {\n print \"<pre>\";\n print_r($this->_tables);\n print \"</pre>\";\n }", "function startTable(){\n\t?>\t\n\t<div class=\"secondCol\">\n\t\t<table class=\"medTable\">\n\t\t\t<tr>\n\t<?php\n}", "function tableauToHTML(array $tab)\n{\n echo \"<table>\";\n foreach ($tab as $i => $ligne) {\n echo \"<tr>\";\n foreach ($ligne as $j => $valeur) {\n echo \"<td>$valeur</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "function display_machine_types($user) {\r\n echo \"<table class='table table-striped table-bordered dataTable'>\r\n <thead>\r\n <tr>\r\n <th>Name</th>\r\n <th>Description</th>\r\n </tr>\r\n </thead>\r\n <tbody>\\n\";\r\n $machine_types = $user->dbConn->stdQuery(\"SELECT `id`, `name`, `description` FROM `machine_types` ORDER BY `id` ASC\");\r\n while ($machine_type = $machine_types->fetch_assoc()) {\r\n echo \" <tr>\r\n <td><a href='machine_type.php?action=show&id=\".intval($machine_type['id']).\"'>\".escape_output($machine_type['name']).\"</a></td>\r\n <td>\".escape_output($machine_type['description']).\"</td>\r\n </tr>\\n\";\r\n }\r\n echo \" </tbody>\\n</table>\\n\";\r\n}", "function echoObj($obj){\n\techo '<table>';\n\tforeach ($obj as $key => $value) {\n echo \"<tr>\";\n echo \"<td>\";\n echo $key;\n echo \"</td>\";\n echo \"<td>\";\n echo $value;\n echo \"</td>\";\n echo \"</tr>\";\n }\n\techo '</table>';\n}", "public function show(Comptable $comptable)\n {\n //\n }", "public function testDisplaySet() {\n\t\t$table = new Table([\n\t\t\t'table' => 'users',\n\t\t\t'schema' => [\n\t\t\t\t'id' => ['type' => 'string'],\n\t\t\t\t'foo' => ['type' => 'string'],\n\t\t\t\t'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]\n\t\t\t]\n\t\t]);\n\t\t$this->assertEquals('id', $table->displayField());\n\t\t$table->displayField('foo');\n\t\t$this->assertEquals('foo', $table->displayField());\n\t}", "function show($dbname=null, $type=null){\n $this->bind_arg('dbname', $dbname);\n $this->try_bind_arg(\"type\", $type);\n //\n //Execute this sql \n $array= $this->get_sql_data($this->dbname);\n //\n //Ouptut a table\n echo \"<table id='fields' name='{$this->entity->name}'>\";\n echo '<thead>';\n echo $this->header();\n echo '</thead>';\n echo '<tbody id=\"table-body\">';\n //\n //Loop through the array and display each row as a tr element\n foreach ($array as $row) {\n $id= \"{$this->entity->name}\";\n //\n echo \"<tr onclick='record.select(this)' id='$id'>\";\n //\n //loop through the column and out puts its td element.\n foreach ($this->entity->columns as $col){\n //\n //Get the value from the row, remebering that the row is indexed\n //by column name\n $value = $row[$col->name];\n //\n //\n echo $col->show($value);\n }\n //\n echo \"</tr>\";\n }\n \n echo \"</tbody>\";\n echo \"</table>\";\n \n \n }", "function printResult($result) {\n?>\n<table id=\"resultTable\">\n <thead>\n <tr>\n <th width=\"10%\">Student ID</th>\n <th width=\"10%\">First Name</th>\n <th width=\"10%\">Last Name</th>\n <th width=\"10%\">Major</th>\n </tr>\n </thead>\n <tbody>\n <?php\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) : ?>\n\t<tr>\n <td><?php echo $row[\"STID\"]; ?></td>\n <td><?php echo $row[\"FNAME\"]; ?></td>\n <td><?php echo $row[\"LNAME\"]; ?></td>\n <td><?php echo $row[\"MAJOR\"]; ?></td>\n\t</tr>\n <?php endwhile; ?>\n </tbody>\n</table>\n<?php\n}", "public function displayTable () {\r\n\t\t// Echoes html for table containing customer data.\r\n\t\t\r\n\t\t$pdo = Database::connect();\r\n\t\t\r\n\t\t// SQL to execute:\r\n\t\t$sql = 'SELECT * FROM tdg_users ORDER BY id DESC';\r\n\t\t\r\n\t\techo '<table><tr><th>Name</th><th>Email</th><th>Mobile</th><th>Actions</th></tr>'; // echo out table header\r\n\t\t\r\n\t\tforeach ($pdo->query($sql) as $row) { // send query via the connection represented by $pdo\r\n\t\t\t// the query being sent is $sql\r\n\t\t\t// as $row -- as you iterate through, the current row will be named $row\r\n\t\t\t// Now we iterate through the rows selected\r\n\t\t\techo '<tr>';\r\n\t\t\techo '<td>'. $row['name'] . '</td>';\r\n\t\t\techo '<td>'. $row['email'] . '</td>';\r\n\t\t\techo '<td>'. $row['mobile'] . '</td>';\r\n\t\t\techo '<td width=\"250\">';\r\n\t\t\techo '<a class=\"btn\" href=\"read.php?id='. $row['id'].'\">Read</a>';\r\n\t\t\techo '&nbsp;';\r\n\t\t\techo '<a class=\"btn btn-success\" href=\"update.php?id='.$row['id'].'\">Update</a>';\r\n\t\t\techo '&nbsp;';\r\n\t\t\techo '<a class=\"btn btn-danger\" href=\"delete.php?id='.$row['id'].'\">Delete</a>';\r\n\t\t\techo '</td>';\r\n\t\t\techo '</tr>';\r\n\t\t} // End of table drawing loop\r\n\r\n\t\t\techo '</table>';\r\n\t\t\tDatabase::disconnect();\r\n\t}", "public function table()\n\t{\n\t\t$this->datatables->select('experiment_id, user_id_caller, id');\n\t\t$this->datatables->from('caller');\n\n\t\t$this->datatables->edit_column('experiment_id', '$1', 'experiment_get_link_by_id(experiment_id)');\n\t\t$this->datatables->edit_column('user_id_caller', '$1', 'user_get_link_by_id(user_id_caller)');\n\t\t$this->datatables->edit_column('id', '$1', 'caller_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}", "public function printout()\n\t\t{\tif (isset($this->res) && (mysql_num_rows($this->res) > 0))\n\t\t\t{\tmysql_data_seek($this->res, 0);\n\t\t\t\t$num = mysql_num_fields($this->res);\n\n\t\t\t\techo \"<table border=1>\";\n\t\t\t\techo \"<tr>\";\n\n\t\t\t\tfor ($i = 0; $i < $num; $i++)\n\t\t\t\t{\techo \"<th>\";\n\t\t\t\t\techo mysql_field_name($this->res, $i);\n\t\t\t\t\techo \"</th>\";\n\t\t\t\t}\n\t\t\t\techo \"</tr>\";\n\n\t\t\t\twhile ($row = mysql_fetch_row($this->res))\n\t\t\t\t{\techo \"<tr>\";\n\n\t\t\t\t\tforeach($row as $elem)\n\t\t\t\t\t{\techo \"<td>$elem</td>\";\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t}\n\n\t\t\t\techo \"</table>\";\n\t\t\t}\n\n\t\t\telse\n\t\t\t\techo \"There is nothing to print! <br />\";\n\t\t}", "function tabledata($data) {\r\n\techo \"<td>\" . $data . \"</td>\\n\";\r\n}", "public function ListTable()\n {\n echo $this->ListTableText();\n }", "public function displayTable(array $rows): void\n {\n $table = new Table(new ConsoleOutput());\n $table\n ->setHeaders(array_keys($rows[0]))\n ->setRows($rows)\n ;\n $table->render();\n }", "function result_to_table($result)\n\t{\n\n\t\techo \" <TD>\\n\";\n\t\techo \"<table border=1 BGCOLOR=\".\" >\\n\";\n\n\t\t//Header\n\t\t$field_num = mysql_num_fields($result);\n\t\techo \"<tr>\\n\";\n\t\techo \"\\t<td><b>ID</b></td>\\n\";\n\t\techo \"\\t<td><b>Name</b></td>\\n\";\n\t\techo \"\\t<td><b>Vorname</b></td>\\n\";\n\t\t// echo \"\\t<td><b>Orga</b></td>\\n\";\n\t\techo \"\\t<td><b>Charakter</b></td>\\n\";\n\t\techo \"\\t<td><b>email</b></td>\\n\";\n\t\techo \"\\t<td><b>Telefon</b></td>\\n\";\n\t\techo \"</tr>\\n\";\n\n\t\t//Daten\n\t\twhile ($row = mysql_fetch_row($result))\n\t\t{\n\t\t\techo \"<tr>\";\n\t\t\tfor ($i=0; $i<$field_num; $i++)\n\t\t\t{\n\t\t\t\t// if ($i==0) {\n\t\t\t\t//echo \"\\t<td><a href=\\\"\".$PHP_SELF.\"?op=detail&user_id=$row[$i]\\\">$row[$i]</a></td>\\n\";\n\t\t\t\t// }\n\t\t\t\t// echo \"\\t<td>\".$row[$i].\"&nbsp;</td>\\n\";\n\t\t\t\tif ($i==5)\n\t\t\t\t{\n\t\t\t\t\techo \"\\t<td><a href=\\\"mailto:$row[$i]\\\"> $row[$i]</a></td>\\n\";\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\techo \"\\t<td>\".$row[$i].\"&nbsp;</td>\\n\";\n\t\t\t\t};\n\t\t\t}\n\t\t\techo \"<tr>\\n\";\n\t\t}\n\t\techo \"</table>\\n\";\n\t\techo \" </TD>\\n\";\n\t}", "function printQueryResult($result) {\n?>\n<table id=\"queryResultTable\">\n <thead>\n <tr>\n <th width=\"10%\">ID</th>\n <th width=\"10%\">Description</th>\n <th width=\"10%\">Hand-in location</th>\n <th width=\"10%\">Deadline</th>\n </tr>\n </thead>\n <tbody>\n <?php\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) : ?>\n\t<tr>\n <td><?php echo $row[\"ID\"]; ?></td>\n <td><?php echo $row[\"DESCRIPTION\"]; ?></td>\n <td><?php echo $row[\"HAND_IN_LOC\"]; ?></td>\n <td><?php echo $row[\"DEADLINE\"]; ?></td>\n\t</tr>\n <?php endwhile; ?>\n </tbody>\n</table>\n<?php\n}", "public function print_table_description()\n {\n }", "function prikazi_sqltabelu($sql_tabela) {\n\n\tglobal $db;\n\n\techo \"<table class='dt-table'>\";\n\techo \"<h2>\" . $sql_tabela . \"</h2>\";\n\n\t// generisanje headera tabele (prikaz podataka)\n\n\t$komanda_head = \"SELECT * FROM $sql_tabela LIMIT 1\";\n\t$result_head = mysql_query($komanda_head, $db);\t\n\n\twhile ( $red = mysql_fetch_assoc($result_head) ) :\n\n\t\t$m = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_head, $m);\n \t\t\techo \"<td class='dt-table'>\" . $kolona . \"</td>\";\n \t\t\t//echo \"<td>\" . $item . \"</td>\";\n \t\t$m++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\t// generisanje tela tabele (prikaz podataka)\n\n\t$komanda_body = \"SELECT * FROM $sql_tabela\";\n\t$result_body = mysql_query($komanda_body, $db);\n\n\n\twhile ( $red = mysql_fetch_assoc($result_body) ) :\n\n\t\t$n = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_body, $n);\n \t\t\techo \"<td class='dt-table'>\" . $item . \"</td>\";\n \t\t$n++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\techo \"</table>\";\n\n}", "function vievRandomBigArray($array){\n echo '<table border=\"1\">';\n for ($y=0; $y < count($array); $y++){\n echo '<tr>';\n for ($x=0; $x < count($array[$y]); $x++){\n echo \"<td>\".$array[$y][$x].'</td>';\n }\n echo \"</tr>\";\n }\n echo '</table>';\n}", "public function printMultiplicationTable()\n {\n // Use range to make it resistent to mutation testing\n foreach (range(1, 12) as $x) {\n foreach (range(1, 12) as $y) {\n printf(\"%4d\", $x * $y);\n }\n echo \"\\n\";\n }\n }", "function printResult($result) {\n echo \"<br>Retrieved data from table demoTable:<br>\";\n echo \"<table>\";\n echo \"<tr><th>ID</th><th>Name</th></tr>\";\n\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[\"NID\"] . \"</td><td>\" . $row[\"NAME\"] . \"</td></tr>\"; //or just use \"echo $row[0]\"\n }\n\n echo \"</table>\";\n}", "function printResult($result) {\n\techo \"<br>Got data from table tab1:<br>\";\n\techo \"<table>\";\n\techo \"<tr><th>ID</th><th>Name</th></tr>\";\n\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n //echo \"<tr><td>\" . $row[\"NID\"] . \"</td><td>\" . $row[\"NAME\"] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n \"<tr><td>\" . $row[\"Player_Name\"] . \"</tr><td>\" . $row[\"Team_Name\"] . \"</tr><td>\" . $row[\"PPG\"] . \n \"</tr><td>\" . $row[\"Assist\"] . \"</tr><td>\" . $row[\"Rebounds\"] . \"</tr><td>\" . $row[\"Steals\"] . \n \"</tr><td>\" . $row[\"Turnovers\"] . \"</td></tr>\";\n\t}\n\techo \"</table>\";\n}", "function printResult($result) {\n echo \"<br>Employee Info<br>\";\n echo \"<table class='table table-striped'>\";\n echo \"<tr><th>Username</th>\". \" \" .\"<th>Wage</th>\". \" \" .\"<th>Job Type</th>\". \" \" .\"<th>Work Schedule</th></tr>\";\n\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr><td>\" . $row[\"USERNAME\"] . \" </td><td>\" . $row[\"WAGE\"] . \" </td><td>\" . $row[\"JOBT\"] . \"</td><td>\"\n . \" \" . $row[\"WORKS\"] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n }\n echo \"</table>\";\n }", "function mysql04($tabla){\n $qColumnNames = mysql_query(\"SHOW COLUMNS FROM \".$tabla) or die(\"mysql error\");\n $numColumns = mysql_num_rows($qColumnNames);\n $i = 0;\n while ( $i < $numColumns ){\n $colname = mysql_fetch_row($qColumnNames);\n $col[$i] = \"<th>\".$colname[0].\"</th>\";\n $i++;\n }\n $h = 0;\n $resultado[0] = \"<tr>\";\n while ( $h < $numColumns ){\n $resultado[0] = $resultado[0] . $col[$h];\n $h++;\n }\n $resultado[0] = $resultado[0].\"</tr>\";\n $query01=\"SELECT * FROM \".$tabla;\n $query02=mysql_query($query01);\n $numLines = mysql_num_rows($query02);\n\n $j=0;\n while( $rec = mysql_fetch_row($query02) ){\n for( $k = 0; $k != $numColumns ; $k++){\n if ( $resultado[1 + $j] == \"\" ){\n $resultado[1 + $j] = \"<tr>\";\n }\n if ( $rec[$k] == \"\" ){\n $rec[$k] = \"-\";\n }\n $resultado[1 + $j] = $resultado[1 + $j].\"<td>\".$rec[$k].\"</td>\";\n }\n $resultado[1 + $j] = $resultado[1 + $j].\"</tr>\";\n $j++;\n }\n return $resultado;\n/*\nCOMO USARLO\n$tabla = '';\n$resultado = mysql04($tabla);\necho \"<table>\";\n foreach( $resultado as $value ){\n\techo $value;\n}\necho \"</table>\";\n*/\n}", "function table_end(){\n\techo '</table>';\n}", "public static function build_table( $db_array ) {\n\n $display = self::formhead();\n \tforeach ( $db_array[0] as $column => $field ) {\n \t\t$display .= \"<th class='cell100 column1'>$column</th>\\n\";\n \t}\n \t$display .= \"</tr></thead></table></div>\\n\";\n $display .= \"<div class='table100-body '><table><tbody>\" ;\n \tforeach ( $db_array as $record ) {\n \t\t$display .= \"<tr class='row100 body'>\\n\";\n \t\tforeach ( $record as $field ) {\n \t\t\t$display .= \"<td class='cell100 column1'>$field</td>\\n\";\n \t\t}\n \t\t$display .= \"</tr>\\n\";\n \t}\n\n \t$display .= \"</tbody></table>\\n\";\n $display .= \"</div></div>\\n\";\n \t\n \treturn $display;\n }", "function printResult($result) {\n\t\t\t\techo \"<div class='Pokeguide'>\n\t\t\t\techo \"<table>\";\n\n\t\t\t\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n\t\t\t\t\tfor ($i = 0; $i < 15; $i++){\n\t\t\t\t\t\techo \"<tr><td>\" . $row[$i] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\techo \"</table>\";\n\t\t\t\techo \"</div>\";\n\t\t\t}", "public function display_rows()\n {\n }" ]
[ "0.6965441", "0.66469234", "0.65742457", "0.64775217", "0.6408495", "0.6390145", "0.63698506", "0.63594264", "0.63343126", "0.631149", "0.6289206", "0.62838733", "0.626554", "0.62059027", "0.61975217", "0.6184834", "0.61773705", "0.61337674", "0.6118748", "0.61180013", "0.6107603", "0.6100395", "0.6074646", "0.6069551", "0.60573107", "0.6049769", "0.604957", "0.6037649", "0.603096", "0.6021858", "0.6003918", "0.5995875", "0.5987389", "0.598046", "0.597514", "0.59492147", "0.5898811", "0.58955586", "0.58943176", "0.5877208", "0.58687884", "0.585869", "0.5843162", "0.58430773", "0.58430773", "0.5834366", "0.5829482", "0.5815555", "0.58033603", "0.5800059", "0.5800059", "0.5800059", "0.57858455", "0.5783737", "0.5771342", "0.5768316", "0.5765766", "0.5763473", "0.5755335", "0.5736569", "0.5726119", "0.5707524", "0.5707524", "0.56965876", "0.5687273", "0.5682799", "0.56564206", "0.5655351", "0.5641357", "0.5635923", "0.5634823", "0.5631617", "0.56234974", "0.5618447", "0.5616591", "0.5611942", "0.56016296", "0.5565057", "0.5564442", "0.5553425", "0.5552998", "0.5533803", "0.55257994", "0.55247587", "0.5520893", "0.5514746", "0.5507777", "0.54975784", "0.547664", "0.5464987", "0.5462948", "0.5451469", "0.54514563", "0.54482734", "0.54398507", "0.5439006", "0.54365027", "0.54283774", "0.5427855", "0.5425602" ]
0.7068991
0
Check that $_FILE (the uploaded file) contains a valid image extension must be: .jpg , .JPG , .gif ou .png. $file_input the file input name on the HTML form $Max_Size maximum file size in Kb, default 500kb returns "OK" or error message
function Photo_Uploaded_Is_Valid($file_input, $Max_Size = 500000) { //Must havein HTML <form enctype="multipart/form-data" .. //otherwise $_FILE is undefined // $file_input is the file input name on the HTML form if (!isset($_FILES[$file_input])) { return 'No image uploaded'; } if ($_FILES[$file_input]['error'] != UPLOAD_ERR_OK) { return 'Error picture upload: code='.$_FILES[$file_input]['error']; } // Check image size if ($_FILES[$file_input]['size'] > $Max_Size) { return 'Image too big, max file size is '.$Max_Size.' Kb'; } // Check that file actually contains an image $check = getimagesize($_FILES[$file_input]['tmp_name']); if ($check === false) { return 'This file is not an image'; } // Check extension is jpg,JPG,gif,png $imageFileType = pathinfo(basename($_FILES[$file_input]['name']), PATHINFO_EXTENSION); if ($imageFileType != 'jpg' && $imageFileType != 'JPG' && $imageFileType != 'gif' && $imageFileType != 'png') { return 'Invalid image file type, valid extensions are: .jpg .JPG .gif .png'; } return 'OK'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ValidFile($iInput) {\n\t\tif(is_uploaded_file($_FILES[$iInput]['tmp_name'])){ \n\t\t\tif($_FILES[$iInput]['error'] == 0){ //file uploaded succesfully\t\n\t\t\t\t//check if file 12 bytes or larger and an image?\n\t\t\t\tif( preg_match('/^image\\b/',$_FILES[$iInput]['type']) && filesize($_FILES[$iInput]['tmp_name']) > 11 ){\n\t\t\t\t\tif(exif_imagetype($_FILES[$iInput]['tmp_name']) > 0 ) {return \"sent\";}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {return 'BLU::INPUT_EXCEPTION::error';}\t\n\t\t}\n\t\treturn null; //no file will return null.\n\t}", "function validateFile($file){\n\n $check = getimagesize($file[\"tmp_name\"]);\n if($check !== false) {\n $err = \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n $err = \"File is not an image.\";\n $uploadOk = 0;\n }\n// Allow certain file formats\nif($file[\"type\"] != \"jpg\" && $file[\"type\"] != \"png\" && $file[\"type\"] != \"jpeg\"\n&& $file[\"type\"] != \"gif\" ) {\n $err = \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n}\n return ($uploadOk==1)? true : false;\n}", "function Photo_Uploaded_Is_Valid($Max_Size = 500000)\n{\n //sinon $_FILES n'est pas défini\n\n // 'un_fichier' est le nom sur le formulaire HTML\n if (!isset($_FILES['un_fichier'])) {\n return 'Aucune image téléversée';\n }\n\n if ($_FILES['un_fichier']['error'] != UPLOAD_ERR_OK) {\n return 'Erreur téléchargement de la photo: code='.$_FILES['un_fichier']['error'];\n }\n\n // Vérifier taille de l'image\n if ($_FILES['un_fichier']['size'] > $Max_Size) {\n return 'Fichier trop gros, taille maximum = '.$Max_Size.' Kb';\n }\n\n // Vérifier si le fichier contient une image\n $check = getimagesize($_FILES['un_fichier']['tmp_name']);\n if ($check === false) {\n return \"Ce fichier n'est pas une image\";\n }\n\n // Vérifier si extension est jpg,JPG,gif,png\n $imageFileType = pathinfo(basename($_FILES['un_fichier']['name']), PATHINFO_EXTENSION);\n if ($imageFileType != 'jpg' && $imageFileType != 'JPG' && $imageFileType != 'gif' && $imageFileType != 'png') {\n return \"L'extension du fichier est invalide. Doit être parmis: .jpg .JPG .gif .png\";\n }\n\n return 'OK';\n}", "public function imgValid($name_img, $sizeMax = 2000000, $validExtensions = array('.jpg','.jpeg','.png'))\n\t{\n $error = '';\n if ($_FILES[$name_img]['error'] > 0) {\n if ($_FILES[$name_img]['error'] != 4) {\n\t\t\t\t $error= 'Problem: ' . $_FILES[$name_img]['error'] . '<br />';\n\t\t\t }\n } else {\n //print_r($_FILES[$name_img]);\n $file_name = $_FILES[$name_img]['name']; // le nom du fichier\n\t\t\t $file_size = $_FILES[$name_img]['size']; // la taille ( peu fiable depend du navigateur)\n\t\t\t\t// OR $size = filesize($_FILES[$name_img]['tmp_name']);\n\t\t\t $file_tmp = $_FILES[$name_img]['tmp_name']; // le chemin du fichier temporaire\n\t\t\t $file_type = $_FILES[$name_img]['type']; // type MIME (peu fiable, depend du navigateur)\n\n // Taille du fichier (x2)\n if($file_size > $sizeMax || filesize($file_tmp) > $sizeMax){ //limite le fichier a 2mo\n\t\t\t\t $error = 'Le fichier est trop gros (max '. $sizeMax .'mo)';\n\t\t\t } else {\n // array of valid extensions\n $validExtensions = array('.jpg','.jpeg','.png');\n\n //$fileExtension = strrchr($file_name, \".\");\n\t\t\t\t\t$i_point = strrpos($file_name,'.');\n \t\t\t\t$fileExtension = substr($file_name, $i_point ,strlen($file_name) - $i_point);\n\n if (!in_array($fileExtension, $validExtensions)) {\n\t\t\t\t\t\t$error = 'Veuillez télécharger une image de type jpg,jpeg ou png';\n\t\t\t\t\t} else {\n // alternative, sécurité +++++\n\t\t\t\t\t\t$finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension\n\t \t\t\t$mime = finfo_file($finfo, $file_tmp);\n\t\t\t\t\t\tfinfo_close($finfo);\n\n\t\t\t\t\t\t$goodExtension = array('image/jpeg','image/png','image/jpg');\n\n\t\t\t\t\t\tif (!in_array($mime, $goodExtension)) {\n\t\t\t\t\t\t\t$error= 'Veuillez télécharger une image de type jpg,jpeg ou png';\n\t\t\t\t\t\t} else {\n $error = array(\n 'ext' => $fileExtension,\n 'file_tmp' => $file_tmp\n );\n }\n }\n }\n }\n return $error;\n }", "public static function validateImageFile()\n {\n if (!isset($_FILES['logo_file'])) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_IMAGE_UPLOAD_FAILED'));\n return false;\n }\n if ($_FILES['logo_file']['size'] > 5000000) {\n // if input file too big (>5MB)\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_BIG'));\n return false;\n }\n // get the image width, height and mime type\n $image_proportions = getimagesize($_FILES['logo_file']['tmp_name']);\n // if input file too small\n if ($image_proportions[0] < Config::get('AVATAR_SIZE') || $image_proportions[1] < Config::get('AVATAR_SIZE')) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_SMALL'));\n return false;\n }\n if (!($image_proportions['mime'] == 'image/jpeg')) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_WRONG_TYPE'));\n return false;\n }\n return true;\n }", "function isValidFile($fileArray)\n{\n\t# Creating image type array\n\t$imgTypeArr = array('jpg','gif','png','jpeg');\n\t\n\t# image size variable\n\t$fileSize\t= $fileArray['file']['size']; \n\t\n\t# image type variable\n\t$fileType\t= $fileArray['file']['name']; \n\t\n\t# Creating Image extension variable and converting to lowercase\n\t\t$imageExt\t= strtolower(substr($fileType, strrpos($fileType, '.') + 1));\n\t\n\t# Checking weather file type is image and size is less then OR equal to 2 MB\n\tif(in_array($imageExt,$imgTypeArr) && $fileSize <= '2090000'){\n\t\treturn TRUE;\n\t}else{\n\t\treturn FALSE;\n\t}\n}", "function check_file_size($str, $max_size = 0)\n{\n if (!$max_size) {\n $max_size = IMG_UPLOAD_MAX_SIZE;\n }\n $file_size = $str['size'];\n if ($file_size > $max_size)\n return false;\n else\n return true;\n}", "function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}", "function checkImage($file,$maxSize=0,$x=0,$y=0)\n {\n if($file!=\"\")\n {\n if(is_array($file))\n $pfad = $file[tmp_name];\n else $pfad = $file;\n }\n $typ = GetImageSize($pfad);\n $size = $file[size];\n\n\n if($maxSize==0)\n $fileSizeLimit = 10485760; // 10MB in BYTE, 100MB stehen in der upload_max_size\n else\n $fileSizeLimit = $maxSize;\n\n if(0 < $typ[2] && $typ[2] < 4)\n {\n if($size<$fileSizeLimit)\n {\n if($typ[0]>$x && $x!=0)\n $error = \"Das Bild ist zu breit.\";\n if($typ[1]>$y && $y!=0)\n $error = \"Das Bild ist zu hoch.\";\n }else\n $error = \"Die Datei darf eine Gr&ouml;&szlig;e von \".($fileSizeLimit/8388608).\" MB nicht &uuml;berschreiten.\";\n }else\n $error = \"Die Datei muss vom Typ GIF, JPG oder PNG sein\";\n return $error;\n }", "function checkImage($imageField, $num) {\r\n\r\n\t\t\tif ($HTTP_POST_FILES['$imageField']['size'] > $maxsize) {\r\n\r\n\t\t\t\t$errmsg .= \"Image file $num must be less than $maxsizekb MB in size.<br>\";\r\n\r\n\t\t\t\t$errflag = true;\r\n\r\n\t\t\t\tunlink($HTTP_POST_FILES['$imageField']['tmp_name']);\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// image should be of the right type i.e. gif,pjpeg or jpeg\r\n\r\n\t\t\tif($HTTP_POST_FILES['$imageField']['type'] != \"image/gif\" AND\r\n\r\n\t\t\t$HTTP_POST_FILES['$imageField']['type'] != \"image/pjpeg\" AND\r\n\r\n\t\t\t$HTTP_POST_FILES['$imageField']['type'] != \"image/png\" AND\r\n\r\n\t\t\t$HTTP_POST_FILES['$imageField']['type'] !=\"image/jpeg\" ) {\r\n\r\n\t\t\t\t$errmsg .= \"Image $num may only be .gif. .png or .jpeg files.</font><br>\";\r\n\r\n\t\t\t\t$errflag = true;\r\n\r\n\t\t\t\tunlink($HTTP_POST_FILES['$imageField']['tmp_name']);\r\n\r\n\t\t\t}\r\n\r\n}", "function validateFile($fieldname)\n{\n $error = '';\n if (!empty($_FILES[$fieldname]['error'])) {\n switch ($_FILES[$fieldname]['error']) {\n case '1':\n $error = 'Upload maximum file is 4 MB.';\n break;\n case '2':\n $error = 'File is too big, please upload with smaller size.';\n break;\n case '3':\n $error = 'File uploaded, but only halef of file.';\n break;\n case '4':\n $error = 'There is no File to upload';\n break;\n case '6':\n $error = 'Temporary folder not exists, Please try again.';\n break;\n case '7':\n $error = 'Failed to record File into disk.';\n break;\n case '8':\n $error = 'Upload file has been stop by extension.';\n break;\n case '999':\n default:\n $error = 'No error code avaiable';\n }\n } elseif (empty($_FILES[$fieldname]['tmp_name']) || $_FILES[$fieldname]['tmp_name'] == 'none') {\n $error = 'There is no File to upload.';\n } elseif ($_FILES[$fieldname]['size'] > FILE_UPLOAD_MAX_SIZE) {\n $error = 'Upload maximum file is '.number_format(FILE_UPLOAD_MAX_SIZE/1024,2).' MB.';\n } else {\n //$get_ext = substr($_FILES[$fieldname]['name'],strlen($_FILES[$fieldname]['name'])-3,3);\t\n $cekfileformat = check_file_type($_FILES[$fieldname]);\n if (!$cekfileformat) {\n $error = 'Upload File only allow (jpg, gif, png, pdf, doc, xls, xlsx, docx)';\n }\n }\n\n return $error;\n}", "public function ajax_check_banner_image_size() {\n \n $path = $_FILES['banner_image']['name'];\n $ext = pathinfo($path, PATHINFO_EXTENSION); \n \n $allowTypes = array('jpg','jpeg','gif','png');\n if(in_array(strtolower($ext),$allowTypes)){\n list($w, $h) = getimagesize($_FILES[\"banner_image\"][\"tmp_name\"]);\n if ($w == 1346 && $h == 660) echo 'Success'; else echo 'Error';\n } else {\n echo 'File_Ext_Err';\n }\n }", "function validate_image_size( $file ) {\n\t$image = getimagesize($file['tmp_name']);\n\t$maximum = array(\n\t\t'width' => '2500',\n\t\t'height' => '2500'\n\t);\n\t$image_width = $image[0];\n\t$image_height = $image[1];\n\t$too_large = \"Image dimensions are too large. Maximum size is {$maximum['width']} by {$maximum['height']} pixels. Uploaded image is $image_width by $image_height pixels.\";\n\tif ( $image_width > $maximum['width'] || $image_height > $maximum['height'] ) {\n\t\t\t//add in the field 'error' of the $file array the message\n\t\t\t$file['error'] = $too_large; \n\t\t\treturn $file;\n\t}\n\telse {\n\t\treturn $file;\n\t}\n}", "public function isImage(){\n if($this->imageFileType != \"jpg\" && $this->imageFileType != \"png\" && $this->imageFileType != \"jpeg\"\n && $this->imageFileType != \"gif\" ) {\n echo \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }", "function validatePicture($fieldname)\n{\n $error = '';\n if (!empty($_FILES[$fieldname]['error'])) {\n switch ($_FILES[$fieldname]['error']) {\n case '1':\n $error = 'Upload maximum file is '.number_format(IMG_UPLOAD_MAX_SIZE/1024,2).' MB.';\n break;\n case '2':\n $error = 'File is too big, please upload with smaller size.';\n break;\n case '3':\n $error = 'File uploaded, but only halef of file.';\n break;\n case '4':\n $error = 'There is no File to upload';\n break;\n case '6':\n $error = 'Temporary folder not exists, Please try again.';\n break;\n case '7':\n $error = 'Failed to record File into disk.';\n break;\n case '8':\n $error = 'Upload file has been stop by extension.';\n break;\n case '999':\n default:\n $error = 'No error code avaiable';\n }\n } elseif (empty($_FILES[$fieldname]['tmp_name']) || $_FILES[$fieldname]['tmp_name'] == 'none') {\n $error = 'There is no File to upload.';\n } elseif ($_FILES[$fieldname]['size'] > IMG_UPLOAD_MAX_SIZE) {\n $error = 'Upload maximum file is '.number_format(IMG_UPLOAD_MAX_SIZE/1024,2).' MB.';\n } else {\n //$get_ext = substr($_FILES[$fieldname]['name'],strlen($_FILES[$fieldname]['name'])-3,3);\t\n $cekfileformat = check_image_type($_FILES[$fieldname]);\n if (!$cekfileformat) {\n $error = 'Upload Picture only allow (jpg, gif, png)';\n }\n }\n\n return $error;\n}", "protected function validateUpload(\\File $objFile)\n {\n $error = false;\n\n if ($objFile->isImage) {\n $minWidth = \\Image::getPixelValue($this->minImageWidth);\n $minHeight = \\Image::getPixelValue($this->minImageHeight);\n\n $maxWidth = \\Image::getPixelValue($this->maxImageWidth);\n $maxHeight = \\Image::getPixelValue($this->maxImageHeight);\n\n if ($minWidth > 0 && $objFile->width < $minWidth) {\n return sprintf($this->minImageWidthErrorText ?: $GLOBALS['TL_LANG']['ERR']['minWidth'], $minWidth, $objFile->width);\n }\n\n if ($minHeight > 0 && $objFile->height < $minHeight) {\n return sprintf($this->minImageHeightErrorText ?: $GLOBALS['TL_LANG']['ERR']['minHeight'], $minHeight, $objFile->height);\n }\n\n if ($maxWidth > 0 && $objFile->width > $maxWidth) {\n return sprintf($this->maxImageWidthErrorText ?: $GLOBALS['TL_LANG']['ERR']['maxWidth'], $maxWidth, $objFile->width);\n }\n\n if ($maxHeight > 0 && $objFile->height > $maxHeight) {\n return sprintf($this->maxImageHeightErrorText ?: $GLOBALS['TL_LANG']['ERR']['maxHeight'], $maxHeight, $objFile->height);\n }\n }\n\n return $error;\n }", "function validateImage($src) {\n\t\t$imageResult = '';\n\t\tif ($_FILES[$src]['tmp_name'] == '') {\n\t\t\tif (1 == $_FILES[$src]['error']) {\n\t\t\t\t$imageResult = 'Image Size is above server max upload size';\n\t\t\t}\n\t\t\t$imageResult .= '<br/>Image is empty!';\n\t\t}\n\t\tif (!is_uploaded_file($_FILES[$src]['tmp_name'])) {\n\t\t\t$imageResult .= '<br/>Image not uploaded';\n\t\t}\n\t\tif ($_FILES[$src]['size'] == 0) {\n\t\t\t$imageResult .= '<br/>Image size is 0';\n\t\t}\n\t\tif ($_FILES[$src]['size'] > 8388608) {\n\t\t\t$imageResult .= '<br/>Image size is greater than 8mb';\n\t\t}\n\t\t$size = GetImageSize($_FILES[$src]['tmp_name']);\n\t\tif ($size[2] != 1 && $size[2] != 2 && $size[2] != 3) {\n\t\t\t$imageResult .= '<br/>File Not an image';\n\t\t}\n\t\treturn ($imageResult == '') ? true : $imageResult;\n\t}", "protected function validatePhoto(){\n\n $extension = $this->type;\n\n if( !empty($extension)){\n if($extension != 'image/jpeg' && $extension != 'image/png' && $extension != 'image/jpg'){\n $this->errors_on_upload[] = \"Your file should be .jpeg, .jpg or .png\";\n }\n }\n\n if($this->size > Config::MAX_FILE_SIZE){\n $this->errors_on_upload[] = \"Your picture shouldn't be more than 10 Mb\";\n }\n\n if($this->error != 0 && $this->error != 4) { //0 means no error, so if otherwise, display a respective message, 4 no files to upload, we allow that\n $this->errors_on_upload[] = $this->upload_errors_array[$this->error];\n }\n\n }", "function isValidImage( $file ) {\n\n\t$form_errors = array();\n\n\t$part = explode( \".\", $file );\n\t$extension = end( $part );\n\n\tswitch( strtolower( $extension ) ) {\n\n\t\tcase 'jpg':\n\t\tcase 'gif':\n\t\tcase 'bmp':\n\t\tcase 'png':\n\n\t\treturn $form_errors;\n\n\t}\n\n\t$form_errors[] = $extension . \"is not valid image extension\";\n\n\treturn $form_errors;\n\n}", "public function validate() {\n \n if (in_array($this->ext, $this->allow) !==false){\n \n if ($this->size < 10000000 ) {\n if ($this->error === 0) {\n $enc = uniqid('',true).\".\".$this->ext;\n $dest = $_SERVER['DOCUMENT_ROOT'].'/'.'tempSTR/'.$enc;\n\n move_uploaded_file($this->filetmp, $dest);\n \n } else {\n echo \"something wrong with this image\";\n }\n } else {\n echo \"Your file is to big\";\n }\n\n } else {\n echo \"You can't upload image with this exstension\";\n }\n }", "function checkAndMoveFile($filekey, $sizelimit, $newname){\r\n // modified from http://www.php.net/manual/en/features.file-upload.php\r\n // Undefined | Multiple Files | $_FILES Corruption Attack\r\n // if this request falls under any of them, treat it invalid.\r\n if(!isset($_FILES[$filekey]['error']) || is_array($_FILES[$filekey]['error'])) {\r\n $errors['imgpmt'] = true;\r\n }\r\n\r\n // check error value of file\r\n switch ($_FILES[$filekey]['error']) {\r\n case UPLOAD_ERR_OK:\r\n break;\r\n case UPLOAD_ERR_INI_SIZE:\r\n case UPLOAD_ERR_FORM_SIZE:\r\n $errors['imgsize'] = true;\r\n default:\r\n $errors['unknown'] = true;\r\n }\r\n\r\n if ($_FILES[$filekey]['size'] > $sizelimit) {\r\n $errors['imgsize'] = true; // if the file size is too large, display appropriate error message\r\n }\r\n\r\n if (exif_imagetype( $_FILES[$filekey]['tmp_name']) != IMAGETYPE_GIF\r\n and exif_imagetype( $_FILES[$filekey]['tmp_name']) != IMAGETYPE_JPEG\r\n and exif_imagetype( $_FILES[$filekey]['tmp_name']) != IMAGETYPE_PNG){\r\n $errors['imgfmt'] = true; // if the file is not an image, display appropriate error message\r\n }\r\n\r\n $upload_res = move_uploaded_file($_FILES[$filekey]['tmp_name'], $newname); // move the file to the specified location\r\n if(!$upload_res) {\r\n $errors['mvfailure'] = true; // if the move failed, display appropriate error message\r\n }\r\n }", "private function isValidImage() {\r\n\t\t\treturn in_array($this->extension, $this->extAllowed) ? true : false;\r\n\t\t}", "public function isImage(){\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".<br>\";\n $this->uploadOk = 1;\n } else {\n echo \"File is not an image.<br>\";\n $this->uploadOk = 0;\n }\n }\n return $this->uploadOk;\n }", "static function validFile($name,$size,$arrayFileType){\n \n $valid = true;\n \n// //extraer el ultimo componente de la ruta(se busca el nombre del archivo)\n// $file = $dir . basename($_FILES[$name]['name']);\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n// $valFileType = strtolower(pathinfo($file,PATHINFO_EXTENSION));\n //Extraer el tamaño del archivo\n// $valsize = getimagesize($_FILES[$name][\"tmp_name\"]);\n \n // Extenciones permitidas\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n $valFileType = strtolower(pathinfo($_FILES[$name]['name'],PATHINFO_EXTENSION)); \n $true=0;\n// var_dump(count($arrayFileType));\n for($i=0; $i<=count($arrayFileType)-1; $i++){\n \n if($valFileType==$arrayFileType[$i]){\n $true=$true+1;\n } \n $stringFileType .=$arrayFileType[$i].\" \";\n \n }\n \n if($true==0){\n $valid = false;\n $msg.=\"Solo se permiten extensiones \".$stringFileType.\". \"; \n }\n \n //tamaño permitido\n if ($_FILES[$name][\"size\"] > $size) {\n $valid = false;\n $msg.=\"Operacion fallida, este archivo no puede ser mayor a \".($size/100000).\"MB. \"; \n } \n \n \n if($msg!=\"\"){\n// $msg = \"Debe darse un valor al campo: \".$msg ;\n utilities::alert($msg); \n }\n \n \n \n return ($valid); \n }", "public function valid_image($str)\n {\n if ($_FILES['image']['size'] > 0 && $_FILES['image']['error'] == UPLOAD_ERR_OK) {\n\n $imginfo = @getimagesize($_FILES['image']['tmp_name']);\n if (!$imginfo) {\n $this->form_validation->set_message('validImage', 'Only image files are allowed');\n return false;\n }\n\n if (!($imginfo[2] == 1 || $imginfo[2] == 2 || $imginfo[2] == 3)) {\n $this->form_validation->set_message('validImage', 'Only GIF, JPG and PNG Images are accepted.');\n return false;\n }\n }\n return true;\n }", "function check_file_size($file_size) {\nif ($file_size < 1000000) {\nreturn true;\n}else {\necho \"The file is too large to upload, please choose a file less than 500 mega byte\";\n}\n}", "public function filecheck() { \n\t\t\n\t\t$upload_error = $_FILES['prod_pic']['error'][0];\n\n\t\tif ($upload_error === UPLOAD_ERR_NO_FILE) {\n \t\t$num_files = 0;\n\t\t} else {\n \t\t$num_files = count($_FILES['prod_pic']['name']);\n\t\t}\n\t\t\n\t\tif($num_files==0) {\n\t\t\t$this->form_validation->set_message('filecheck', 'No Files Selected');\n\t\t\treturn FALSE;\n\t\t}else if($num_files>3) {\n\t\t\t$this->form_validation->set_message('filecheck','Maximum three files can be selected');\n\t\t\treturn FALSE;\n\t\t}else {\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t}", "function checkInput()\n\t{\n\t\tglobal $lng;\n\n\t\t// remove trailing '/'\n\t\twhile (substr($_FILES[$this->getPostVar()][\"name\"],-1) == '/')\n\t\t{\n\t\t\t$_FILES[$this->getPostVar()][\"name\"] = substr($_FILES[$this->getPostVar()][\"name\"],0,-1);\n\t\t}\n\n\t\t$filename = $_FILES[$this->getPostVar()][\"name\"];\n\t\t$filename_arr = pathinfo($_FILES[$this->getPostVar()][\"name\"]);\n\t\t$suffix = $filename_arr[\"extension\"];\n\t\t$mimetype = $_FILES[$this->getPostVar()][\"type\"];\n\t\t$size_bytes = $_FILES[$this->getPostVar()][\"size\"];\n\t\t$temp_name = $_FILES[$this->getPostVar()][\"tmp_name\"];\n\t\t$error = $_FILES[$this->getPostVar()][\"error\"];\n\n\t\t// error handling\n\t\tif ($error > 0)\n\t\t{\n\t\t\tswitch ($error)\n\t\t\t{\n\t\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_size_exceeds\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t\t\t \n\t\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_size_exceeds\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase UPLOAD_ERR_PARTIAL:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_partially_uploaded\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\t\tif ($this->getRequired())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!strlen($this->getValue()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_no_upload\"));\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t \n\t\t\t\tcase UPLOAD_ERR_NO_TMP_DIR:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_missing_tmp_dir\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t\t\t \n\t\t\t\tcase UPLOAD_ERR_CANT_WRITE:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_cannot_write_to_disk\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t \n\t\t\t\tcase UPLOAD_ERR_EXTENSION:\n\t\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_upload_stopped_ext\"));\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check suffixes\n\t\tif ($_FILES[$this->getPostVar()][\"tmp_name\"] != \"\" &&\n\t\t\tis_array($this->getSuffixes()))\n\t\t{\n\t\t\tif (!in_array(strtolower($suffix), $this->getSuffixes()))\n\t\t\t{\n\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_wrong_file_type\"));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// virus handling\n\t\tif ($_FILES[$this->getPostVar()][\"tmp_name\"] != \"\")\n\t\t{\n\t\t\t$vir = ilUtil::virusHandling($temp_name, $filename);\n\t\t\tif ($vir[0] == false)\n\t\t\t{\n\t\t\t\t$this->setAlert($lng->txt(\"form_msg_file_virus_found\").\"<br />\".$vir[1]);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (is_array($_POST[$this->getPostVar()]))\n\t\t{\n\t\t\tif (($this->getRequired() && strlen($_POST[$this->getPostVar()]['width']) == 0) ||\n\t\t\t\t($this->getRequired() && strlen($_POST[$this->getPostVar()]['height']) == 0))\n\t\t\t{\n\t\t\t\t$this->setAlert($lng->txt(\"msg_input_is_required\"));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (is_array($_POST[$this->getPostVar()]['flash_param_name']))\n\t\t\t{\n\t\t\t\tforeach ($_POST[$this->getPostVar()]['flash_param_name'] as $idx => $val)\n\t\t\t\t{\n\t\t\t\t\tif (strlen($val) == 0 || strlen($_POST[$this->getPostVar()]['flash_param_value'][$idx]) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAlert($lng->txt(\"msg_input_is_required\"));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private function checkSize()\n {\n $allowedSize = intval($this->getSetting('allowed_upload_size', true));\n if ($allowedSize) {\n if ($this->file->getSize() > $allowedSize) {\n throw new FileException(\"File cannot be bigger than $allowedSize bytes\");\n }\n }\n }", "protected function is_valid_image_file($file_path) {\n \treturn false;\n }", "public function file_check($str)\n {\n\n\n\n echo \"sadasd : \";\n print_r($str);\n print_r($_FILES);\n\n die();\n\n $allowed_mime_type_arr = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'svg');\n $mime = get_mime_by_extension($_FILES['file']['name']);\n if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != \"\") {\n if (in_array($mime, $allowed_mime_type_arr)) {\n return true;\n } else {\n $this->form_validation->set_message('file_check', 'por favor selecciona solamente gif/jpg/png file.');\n return false;\n }\n } else {\n $this->form_validation->set_message('file_check', 'Selecciona un archivo.');\n return false;\n }\n }", "function canUpload($file, &$err, &$params)\r\n\t{\r\n\t\tif (empty($file['name'])) {\r\n\t\t\t$err = 'Please input a file for upload';\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (!is_uploaded_file($file['tmp_name'])) {\r\n\t //handle potential malicous attack\r\n\t $err = JText::_('File has not been uploaded');\r\n\t\t\treturn false;;\r\n\t\t}\r\n\r\n\t\tjimport('joomla.filesystem.file');\r\n\t\t$format = strtolower(JFile::getExt($file['name']));\r\n\r\n\t\t$allowable = explode(',', strtolower($params->get('ul_file_types')));\r\n\r\n\t\t$format = FabrikString::ltrimword($format, '.');\r\n\t\t$format2 = \".$format\";\r\n\t\tif (!in_array($format, $allowable) && !in_array($format2, $allowable))\r\n\t\t{\r\n\t\t\t$err = 'WARNFILETYPE';\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$maxSize = (int)$params->get('upload_maxsize', 0);\r\n\t\tif ($maxSize > 0 && (int)$file['size'] > $maxSize)\r\n\t\t{\r\n\t\t\t$err = 'WARNFILETOOLARGE';\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$ignored = array();\r\n\t\t$user = JFactory::getUser();\r\n\t\t$imginfo = null;\r\n\t\tif ($params->get('restrict_uploads',1)) {\r\n\t\t\t$images = explode(',', $params->get('image_extensions'));\r\n\t\t\tif (in_array($format, $images)) { // if its an image run it through getimagesize\r\n\t\t\t\tif (($imginfo = getimagesize($file['tmp_name'])) === FALSE) {\r\n\t\t\t\t\t$err = 'WARNINVALIDIMG';\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else if (!in_array($format, $ignored)) {\r\n\t\t\t\t// if its not an image...and we're not ignoring it\r\n\t\t\t\t/*$allowed_mime = explode(',', $upload_mime);\r\n\t\t\t\t$illegal_mime = explode(',', $upload_mime_illegal);\r\n\t\t\t\tif (function_exists('finfo_open') && $params->get('check_mime',1)) {\r\n\t\t\t\t\t// We have fileinfo\r\n\t\t\t\t\t$finfo = finfo_open(FILEINFO_MIME);\r\n\t\t\t\t\t$type = finfo_file($finfo, $file['tmp_name']);\r\n\t\t\t\t\tif (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) {\r\n\t\t\t\t\t\t$err = 'WARNINVALIDMIME';\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfinfo_close($finfo);\r\n\t\t\t\t} else if (function_exists('mime_content_type') && $params->get('check_mime',1)) {\r\n\t\t\t\t\t// we have mime magic\r\n\t\t\t\t\t$type = mime_content_type($file['tmp_name']);\r\n\t\t\t\t\tif (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) {\r\n\t\t\t\t\t\t$err = 'WARNINVALIDMIME';\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$xss_check = JFile::read($file['tmp_name'], false, 256);\r\n\t\t$html_tags = array('abbr','acronym','address','applet','area','audioscope','base','basefont','bdo','bgsound','big','blackface','blink','blockquote','body','bq','br','button','caption','center','cite','code','col','colgroup','comment','custom','dd','del','dfn','dir','div','dl','dt','em','embed','fieldset','fn','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','iframe','ilayer','img','input','ins','isindex','keygen','kbd','label','layer','legend','li','limittext','link','listing','map','marquee','menu','meta','multicol','nobr','noembed','noframes','noscript','nosmartquotes','object','ol','optgroup','option','param','plaintext','pre','rt','ruby','s','samp','script','select','server','shadow','sidebar','small','spacer','span','strike','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','ul','var','wbr','xml','xmp','!DOCTYPE', '!--');\r\n\t\tforeach ($html_tags as $tag) {\r\n\t\t\t// A tag is '<tagname ', so we need to add < and a space or '<tagname>'\r\n\t\t\tif (JString::stristr($xss_check, '<'.$tag.' ') || JString::stristr($xss_check, '<'.$tag.'>')) {\r\n\t\t\t\t$err = 'WARNIEXSS';\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function validateFile(){\n // Check uploaded errors\t\n if($this->fileError){\n if(array_key_exists($this->fileError, $this->phpFileUploadErrors)){\n $this->addError(['PHP Upload Error',$this->phpFileUploadErrors[$this->fileError]]);\n } \n }else{\n // Check if file was uploaded via the form\n if(!is_uploaded_file($this->tmpLocation)){\n $this->addError(['File Upload', \"File uploading failed. Please upload the file again.\"]);\n }\t\n // Check extension\n if(!in_array($this->fileExt, $this->allowedExtensions)){\n $allowed = implode(', ', $this->allowedExtensions);\n $this->addError(['File Extension',\"Uploading this type of file is not allowed. Allowed file extensions are \".$allowed]);\n }\n // Check size\n if($this->size > $this->maxSize){\n $this->addError(['File Size',\"The file size must be up to \".$this->maxSize]);\n }\n // Check if upload folder exists\n if(!file_exists($this->uploadPath)){\n $this->addError(['Admin Error',\"The chosen upload directory does not exist.\"]);\n }\n } \n if(!$this->_errors){\n return true;\n } \n return false;\t\n }", "public static function validateFile($file, &$message) {\n $hasError = false;\n $message = '';\n $supportedFileextension = ['jpg', 'png', 'gif', 'JPG', 'PNG', 'GIF'];\n\n $fileExtension = $file->getClientOriginalExtension();\n if (!in_array($fileExtension, $supportedFileextension)) {\n $hasError = true;\n $message = 'File is invalid. It should be image.';\n }\n\n return $hasError;\n }", "public function edit_fileupload_check()\n { \n \n // we retrieve the number of files that were uploaded\n $number_of_files = sizeof($_FILES['img']['tmp_name']);\n \n // considering that do_upload() accepts single files, we will have to do a small hack so that we can upload multiple files. For this we will have to keep the data of uploaded files in a variable, and redo the $_FILE.\n $files = $_FILES['img'];\n \n // first make sure that there is no error in uploading the files\n for($i=0; $i<$number_of_files; $i++)\n {\n if($_FILES['img']['error'][$i] != 0)\n {\n // save the error message and return false, the validation of uploaded files failed\n $this->form_validation->set_message('fileupload_check', 'Please add at least one Image');\n return FALSE;\n }\n return TRUE;\n }\n }", "function check_uploadedfile($file, $uploadfolder = VAR_FOLDER, $max_filesize = 2097152)\n{\n if ($file && is_array($file) && array_key_exists('tmp_name', $file)) {\n if (!is_uploaded_file($file['tmp_name'])) {\n throw new Exception(\"file_upload_error\", 1);\n }\n if (filesize($file['tmp_name']) > $max_filesize) {\n throw new Exception(\"file_too_large\", 1);\n }\n } else {\n throw new Exception(\"no_file\", 1);\n }\n}", "function Picture_Save_File($file_input, $target_dir)\n {\n $message = Photo_Uploaded_Is_Valid($file_input); // voir fonction\n if ($message === 'OK') {\n // Check that there is no file with the same name\n // already exists in the target folder\n // using file_exists()\n $target_file = $target_dir.basename($_FILES[$file_input]['name']);\n if (file_exists($target_file)) {\n return 'This file already exists';\n }\n\n // Create the file with move_uploaded_file()\n if (move_uploaded_file($_FILES[$file_input]['tmp_name'], $target_file)) {\n // ALL OK display image for testing\n //echo '<img src=\"'.$target_file.'\">';\n return 'ok';\n } else {\n return 'Error in move_upload_file';\n }\n } else {\n // upload error, invalid image or file too big\n return $message;\n }\n }", "function validateTypeOfFile($type){\n\t$arrFile = ['image/png', 'image/jpg', 'image/jpeg', 'image/gif'];\n\tif(in_array($type, $arrFile)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function CheckImageExtension($filename)\n{\n\tif(strlen($filename)<4)\n\t\treturn false;\n\t$ext=strtoupper(substr($filename,strlen($filename)-4));\n\tif($ext==\".GIF\" || $ext==\".JPG\" || $ext==\"JPEG\" || $ext==\".PNG\" || $ext==\".BMP\")\n\t\treturn $ext;\n\treturn false;\n}", "public function isAllowedFileSize()\n {\n if (empty($this->max_upload_size)) {\n $this->max_upload_size = ini_get('upload_max_filesize');\n }\n\n if ($this->_file_info['size'] > $this->max_upload_size) {\n NUCLEUS_Exceptions::catcher(UPLOAD_FILESIZE_DENIED);\n return false;\n }\n\n return true;\n }", "public function correctImage(){\n parent::isImage();\n parent::exist();\n parent::sizeFile();\n return $this->uploadOk;\n }", "function validate_file($file, $allowed_files = array())\n {\n }", "public function filesizeValid()\n\t{\n\t\tif ($this->files['size'] > $this->max_filesize) {\n\t\t\tthrow new Exception(\"File is too big\",7);\n\t\t}\n\n\t\t//Check that the file is not too less\n\t\tif ($this->files['size'] < $this->min_filesize) {\n\t\t throw new Exception(\"File is too less than\",8);\n\t\t}\n\t\n\t}", "function upload_is_file_too_big($upload)\n {\n }", "public function isValidSize( $size ){ return $size <= MAX_FILE_SIZE;}", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n return 'abort';\n } \n if (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n return 'abort';\n }\n }", "function checkFileSize()\r\n\t{\r\n\t\tif ($this->file_size_max >= 0)\r\n\t\t{\r\n\t\t\t$post \t\t= $_FILES[$this->post_name];\r\n\t\t\t$size \t\t= ( !$this->isArrayPostName ) ? $post['size'] : $post['size'][$this->arrayPostName];\r\n\t\t\tif ($size > $this->file_size_max) return false;\r\n\t\t\telse return true;\r\n\t\t}else return true;\r\n\t}", "public function sizeFile(){\n if ($_FILES[\"fileToUpload\"][\"size\"] > 8300000) {\n echo \"Sorry, your file is too large.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }", "function check_file_uploaded($filename) {\n\t\t// If this request falls under any of them, treat it invalid.\n\t\tif (\n\t\t\t!isset($_FILES[$filename]['error']) ||\n\t\t\tis_array($_FILES[$filename]['error'])\n\t\t) {\n\t\t\tthrow new RuntimeException('Invalid parameters.');\n\t\t}\n\n\t\t// Check $_FILES[$filename]['error'] value.\n\t\tswitch ($_FILES[$filename]['error']) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\tthrow new RuntimeException('No file sent.');\n\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\tthrow new RuntimeException('Exceeded filesize limit.');\n\t\t\tdefault:\n\t\t\t\tthrow new RuntimeException('Unknown errors.');\n\t\t}\n\t}", "function validate_image() {\n if ($_FILES && $_FILES['couponImage']['size'] !== 0) {\n $upload_dir = './images/coupon';\n\n if (!is_dir($upload_dir)) { // Create directory if not exists.\n mkdir($upload_dir, 0777, true);\n }\n $config['upload_path'] = $upload_dir;\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n $config['file_name'] = $_FILES['couponImage']['name'];\n $config['overwrite'] = FALSE;\n $config['max_size'] = 1024; // Default to 1MB.\n\n $this->load->library('upload', $config);\n if (!$this->upload->do_upload('couponImage')) {\n $this->form_validation->set_message('validate_image', 'File size should be <= 1 MB.');\n return FALSE;\n } else {\n $this->upload_data = $this->upload->data();\n return TRUE;\n }\n } else {\n return TRUE;\n }\n }", "function validImageSize($tempFileName)\n{\n\t$validSize = true;\n\t\n // Check if image file is valid size\n $imageStats = getimagesize($tempFileName);\n\t\n\t//invalid if height or width < 256px or > 1024px\n if (($imageStats[0] < 256) || ($imageStats[1] < 256) || ($imageStats[0] > 1280) || ($imageStats[1] > 1280))\n\t{\n $validSize = false;\n\t}\n\t\n\treturn $validSize;\n}", "protected function _checkConfirmUploadFile()\n\t{\n\t\tswitch ($this->_uploadedFile->getError()) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\tthrow new Exception('Empty File Upload ERROR!');\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_FORM_SIZE;\n\t\t\tcase UPLOAD_ERR_INI_SIZE;\n\t\t\t\tthrow new Exception('Too Large File Size ERROR!');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Something ERROR!');\n\t\t\t\tbreak;\n\t\t}\n\t}", "public static function post_image_validation($type,$size){\n\t\t\t$check_type = Posts_image::get_image_type($type);\n\t\t\t$check_size = $size;\n\t\t\t$check_ext = Posts_image::get_image_ext($type);\n\t\t\t\n\t\t\tif($check_type !== \"image\"){\n\t\t\t\tself::$_errors['imagetype'] = \"Your file must be image.\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($check_ext !== \".jpg\" && $check_ext !== \".png\" && $check_ext !== \".gif\"){\n\t\t\t\tself::$_errors['imageext'] = \"Only <b>JPG, PNG and GIF</b> format are allowed.\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($check_size > 4000000){\n\t\t\t\tself::$_errors['imagesize'] = \"Image can't be larger then 4MB.\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif(empty(self::$_errors)){return true;}else{return false;}\n\t\t\t\n\t\t}", "public function fileupload_check()\n { \n \n // we retrieve the number of files that were uploaded\n $number_of_files = sizeof($_FILES['img']['tmp_name']);\n \n // considering that do_upload() accepts single files, we will have to do a small hack so that we can upload multiple files. For this we will have to keep the data of uploaded files in a variable, and redo the $_FILE.\n $files = $_FILES['img'];\n \n // first make sure that there is no error in uploading the files\n for($i=0; $i<$number_of_files; $i++)\n {\n if($_FILES['img']['error'][$i] != 0)\n {\n // save the error message and return false, the validation of uploaded files failed\n $this->form_validation->set_message('fileupload_check', 'Please add at least one Image');\n return FALSE;\n }\n return TRUE;\n }\n }", "public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function file_is_valid_image($path)\n {\n }", "protected function validateFileAndSize (& $file) {\n\t\tif (!is_uploaded_file($file->tmpFullPath))\n\t\t\treturn $this->handleUploadError(static::UPLOAD_ERR_NOT_POSTED);\n\t\t\n\t\tif (!is_file($file->tmpFullPath))\n\t\t\treturn $this->handleUploadError(static::UPLOAD_ERR_NOT_FILE);\n\t\t\n\t\t$fileSize = filesize($file->tmpFullPath);\n\t\tif ($fileSize < 1)\n\t\t\treturn $this->handleUploadError(static::UPLOAD_ERR_EMPTY_FILE);\n\t\t\n\t\tif ($fileSize === FALSE)\n\t\t\treturn $this->handleUploadError(static::UPLOAD_ERR_TOO_LARGE_FILE);\n\t\t\n\t\tif ($this->minSize !== NULL && $fileSize < $this->minSize)\n\t\t\treturn $this->handleUploadError(\n\t\t\t\tstatic::UPLOAD_ERR_MIN_SIZE, [\n\t\t\t\t\t\\MvcCore\\Ext\\Form::ConvertBytesIntoHumanForm($this->minSize)\n\t\t\t\t]\n\t\t\t);\n\t\t\n\t\tif ($this->maxSize !== NULL && $fileSize > $this->maxSize)\n\t\t\treturn $this->handleUploadError(\n\t\t\t\tstatic::UPLOAD_ERR_MAX_SIZE, [\n\t\t\t\t\t\\MvcCore\\Ext\\Form::ConvertBytesIntoHumanForm($this->maxSize)\n\t\t\t\t]\n\t\t\t);\n\n\t\t$file->size = $fileSize;\n\t\treturn TRUE;\n\t}", "protected function validateExtension(UploadedFile $objUploadFile)\n {\n $error = false;\n\n $strAllowed = $this->extensions ?: \\Config::get('uploadTypes');\n\n $arrAllowed = trimsplit(',', $strAllowed);\n\n $strExtension = $objUploadFile->getClientOriginalExtension();\n\n if (!$strExtension || !is_array($arrAllowed) || !in_array($strExtension, $arrAllowed)) {\n return sprintf(sprintf($GLOBALS['TL_LANG']['ERR']['illegalFileExtension'], $strExtension));\n }\n\n // compare client mime type with mime type check result from server (e.g. user uploaded a php file with jpg extension)\n if (!$this->validateMimeType($objUploadFile->getClientMimeType(), $objUploadFile->getMimeType())) {\n return sprintf(sprintf($GLOBALS['TL_LANG']['ERR']['illegalMimeType'], $objUploadFile->getMimeType()));\n }\n\n return $error;\n }", "public function mimeTypeValid()\n\t{\n\t\tif (!in_array($this->files['type'], $this->mime_types)) {\n\t\t\tthrow new Exception(\"Invalid file Extension\",6);\n\t\t}\n\t}", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( KISSIT_MAIN_PRODUCT_WATERMARK_SIZE == 0 ) {\n \tif ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n \t\treturn 'abort';\n \t} \n \tif (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n \t\treturn 'abort';\n \t}\n }\n }", "function file_is_an_image($temporary_path, $new_path)\n {\n $allowed_mime_types = ['image/gif', 'image/jpeg', 'image/png'];\n $allowed_file_extensions = ['gif', 'jpg', 'jpeg', 'png'];\n\n $actual_file_extension = pathinfo($new_path, PATHINFO_EXTENSION);\n $actual_mime_type = getimagesize($temporary_path)['mime'];\n\n $file_extension_is_valid = in_array($actual_file_extension, $allowed_file_extensions);\n $mime_type_is_valid = in_array($actual_mime_type, $allowed_mime_types);\n\n return $file_extension_is_valid && $mime_type_is_valid;\n }", "function callback_imgsize($files_to_upload,$field_info)\n {\n foreach($files_to_upload as $f)\n {\n $imgsize=$f['size'];\n }\n if($imgsize>1048576)///image size in bytes\n return \"The uploaded image size should be less than 1MB\";\n \n }", "function file_input($name, $file_path =USER_FILE_PATH)\n{\n $upload_stat = true;\n $image = checkInput($_FILES[$name]['name']);\n $imagePath = $file_path . basename($image);\n $imageExtension = pathinfo($imagePath, PATHINFO_EXTENSION);\n if ($imageExtension != 'jpg' && $imageExtension != 'jpeg' && $imageExtension != 'png' && $imageExtension != 'gif' && $imageExtension != 'JPG' && $imageExtension != 'JPEG' && $imageExtension != 'PNG' && $imageExtension != 'GIF') {\n $result['message'] = \"<div class=\\\"alert alert-error\\\">le format de votre fichier est invalide <i class=\\\"fas fa-user-times\\\" >&times</i></div>\";\n $upload_stat = false;\n $result['status'] = $upload_stat;\n }\n if (file_exists($imagePath)) {\n $result['message'] = \"<div class=\\\"alert alert-error\\\"> votre fichier existe deja <i class=\\\"fas fa-user-times\\\" >&times</i></div>\";\n $upload_stat = false;\n $result['status'] = $upload_stat;\n }\n if ($_FILES[$name]['size'] > 500000) {\n $result['message'] = \"<div class=\\\"alert alert-error\\\"> votre fichier est trop volumineux <i class=\\\"fas fa-user-times\\\" >&times</i></div>\";\n $upload_stat = false;\n $result['status'] = $upload_stat;\n }\n\n if ($upload_stat) {\n if (!move_uploaded_file($_FILES[$name]['tmp_name'], $imagePath)) {\n $result['message'] = \"<div class=\\\"alert alert-error\\\">l'upload de votre fichier a echouer <i class=\\\"fas fa-user-times\\\" >&times</i></div>\";\n $result['status'] = false;\n } else {\n $result['status'] = $upload_stat;\n $result['name'] = $image;\n }\n\n }\n return $result;\n}", "public function check_image_sizes($image_file){\n\t\t\t$error['error_exists'] = false;\n\t\t\t$error['error_message'] = false;\n\t\t\t\n\t\t\t//if the image file is not there then show error\n\t\t\tif (!isset($image_file) || $image_file == null){\n\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t$error['error_message'] = $this->file_uploading_settings['file_not_exist'];\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$image_size = getimagesize($image_file);\n\n\t\t\t\t$width = $image_size[0];\n\t\t\t\t$height = $image_size[1];\n\t\t\t\t\n\t\t\t\t//must be greater than a certain dimension\n\t\t\t\tif ($width < $this->file_uploading_settings['min_height_width'] || $height < $this->file_uploading_settings['min_height_width']){\n\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['min_image_size_error'];\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//must be smaller than a certain dimension -> no need to do if config set to 0 -> 0 = unlimited\n\t\t\t\tif ($this->file_uploading_settings['max_width'] > 0){\n\t\t\t\t\tif ($width > $this->file_uploading_settings['max_width']){\n\t\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['max_image_size_error'];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->file_uploading_settings['max_height'] > 0){\n\t\t\t\t\tif ($height > $this->file_uploading_settings['max_height']){\n\t\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['max_image_size_error'];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\n\t\t\treturn $error;\n\n\n\t\t\t\n\t\t}", "public static function checkUserImageUpload($tempfile,$imgheight='',$imgwidth='',$uploadtype ='temp') {\r\n \t if($uploadtype == 'file') \t {\r\n \t$upfilename \t= $tempfile;\r\n \t \t$tempfilename = $tempfile;\r\n \t }\r\n \t else \t {\r\n \t \t \r\n \t \t$upfilename \t= $tempfile['name'];\r\n \t \t$tempfilename = $tempfile['tmp_name'];\r\n \t }\r\n \t \r\n \r\n \tif ($tempfile) \r\n \t{\r\n \t\t$errors = 0;\r\n \t\t//echopre($tempfile);\r\n \t\t$filename \t= stripslashes($upfilename);\r\n \t\t$extension \t= self::getFileExtension($filename);\t// get the file extention\r\n \t\t$extension \t= strtolower($extension);\r\n \t\r\n \t\tif (($extension != \"jpg\") && ($extension != \"jpeg\") && ($extension != \"png\") && ($extension != \"gif\"))\r\n \t\t{ \r\n \t\t\t$errors=1; // Unknown Image extension ';\t \r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\t$size\t=filesize($tempfilename);\r\n \t\t\tif ($size > MAX_UPLOAD_SIZE*1024)\r\n \t\t\t{\r\n \t\t\t\t$errors=2; // \"You have exceeded the size limit\";\r\n \t\t\t}\r\n \t\t\telse \r\n \t\t\t{\r\n \t\t\t\tif($imgheight >0 && $imgwidth > 0)\r\n \t\t\t\t{\r\n\t \t\t\t\tlist($width,$height)=getimagesize($tempfilename);\r\n\t \t\t\t\t//echo $width.':'.$height;\r\n\t \t\t\t\t//echo '<br>'.$imgwidth.':'.$imgheight;\r\n\t \t\t\t\tif( $height < $imgheight || $width < $imgwidth)\r\n\t \t\t\t\t\t$errors = 3;\t\t// image size not matching\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn $errors;\r\n \t}\r\n }", "public function verifyFile(){\n if (isset($_POST[\"submitbutton\"])){//if submit button is pressed\n if ($_FILES[\"fileSelectField\"][\"type\"] != \"application/pdf\"){//checks file type\n return \"File must be a pdf file\";\n }\n else if ($_FILES[\"fileSelectField\"][\"size\"] > 100000){//checks file size\n return \"File is too big\";\n }\n else {//runs function to add file if no problems\n return $this->addFile();\n }\n }\n }", "function validate_picture_file($path) {\n $acceptableTypes = array(IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_GIF);\n $detectedType = exif_imagetype($path); // WARNING: This will only work if the\n // EXIF extension is enabled.\n return in_array($detectedType, $acceptableTypes);\n}", "public function extensionValid() \n\t{\n\t\tif (!in_array($this->extension_of_file, $this->file_types)) //{\n\t\t\tthrow new Exception(\"Invalid file Extension\",5);\n\t\t//}\n\t}", "public function isUploaded() {\n\t\t$this->msg = '';\n\t\t\t//\tcheck if the name of the file uploaded is not available\n\t\tif (!$_FILES[$this->fileName]['name'])\t{\n\t\t\t$this->msg .= 'File name not available';\n\t\t\treturn false;\n\t\t}\n\n\t\t\n\t\t\t// tests for an error in uploading\n\t\tif ($_FILES[$this->fileName]['error']) {\t\n\t\t\tswitch($_FILES[$this->fileName]['error']) {\n\t\t\t\tcase 1: $this->msg .= 'Your image is too big!'; // exceeds PHP\\'s maximun upload size\n\t\t\t\t\treturn false;\n\t\t\t\tcase 2: $this->msg .= 'Your image is too large!'; // File exceeds maximum upload file size set in the form\n\t\t\t\t\treturn false;\n\t\t\t\tcase 3: $this->msg .= 'That only partially worked!'; // File partially uploaded\n\t\t\t\t\treturn false;\n\t\t\t\tcase 4: $this->msg .= 'Your file wasn\\'t uploaded!'; // No file upload\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t// check if file type is invalid\n\t\t$type = $_FILES[$this->fileName]['type'];\t//\tget the type of the uploaded file\n\t\tif (!in_array($type, $this->fileTypes)) {\n\t\t\t$this->msg .= 'Wrong file type';\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\t// check if file did not reach the server\n\t\tif (!is_uploaded_file($_FILES[$this->fileName]['tmp_name'])) {\n\t\t\t$this->msg .= 'File did not reach the temporary location on the server';\n\t\t\treturn false;\n\t\t}\n\t\t$fleName = $_FILES[$this->fileName]['name'];\n\t\t$flePath = $this->folderPath ? $this->folderPath.'/'.$fleName : $fleName;\n\t\t\n\t\t\t// test if a file with the same name exists and rename it using a random generated (uniqid) if it does\n\t\tif (file_exists($flePath)) {\n\t\t\t$newName = uniqid('art').$fleName;\n\t\t\t$flePath = $this->folderPath ? $this->folderPath.'/'.$newName : $newName;\n\t\t}\n\n\t\t\t//move file from temporary location to the path specified and test if it's not successful\n\t\tif (!move_uploaded_file($_FILES[$this->fileName]['tmp_name'], $flePath)) {\t\n\t\t\t$this->msg .= 'Error in moving file to the specified location';\n\t\t\treturn false;\n\t\t}\n\t\t\t// check if new file does not exists in the destination folder\n\t\tif (!file_exists($flePath)) {\n\t\t\t$this->msg .= 'File did not reach the destination folder';\n\t\t\treturn false;\n\t\t}\n\t\t\t\t// all worked fine and returns the filepath\n\t\t\t$this->msg .= 'File '.$_FILES[$this->fileName]['name'].' uploaded successfully ';\n\t\t\treturn $flePath;\n\t\t}", "function check_file_error($file_error) {\nif ($file_error === 0) {\nreturn true;\n}else {\necho \"There is an error uploading the file\";\n}\n}", "public function isValid($file_key)\n\t{\n\t\treturn App_File_Utils::check_type($this->_type, $_FILES[$file_key]['tmp_name']);\n\t}", "function validateMimeType($file_name){\r\n // array of acceptable MIME types\r\n $mime_types = [\r\n 'image/png',\r\n 'image/jpeg'\r\n ];\r\n \r\n // determines MIME type\r\n $type = mime_content_type($file_name);\r\n \r\n // check if MIME type is in array of acceptable types\r\n return in_array($type, $mime_types, true);\r\n}", "public function valid_images($str)\n {\n if (!isset($_FILES['image']) || $_FILES['image']['size'] == 0 || $_FILES['image']['error'] != UPLOAD_ERR_OK) {\n $this->form_validation->set_message('valid_images', 'Image not uploaded.');\n return false;\n }\n\n $imginfo = @getimagesize($_FILES['image']['tmp_name']);\n\n if (!($imginfo[2] == 1 || $imginfo[2] == 2 || $imginfo[2] == 3)) {\n $this->form_validation->set_message('valid_images', 'Only GIF, JPG and PNG Images are accepted');\n return false;\n }\n return true;\n }", "protected function checkFilename(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Filename) && $this->_Filename !== null && $this->_Filename !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Filename} is not a valid value for Filename\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}", "function valid_image($str,$campo) {\n\t\t\n\t\tif($_FILES[$campo]['tmp_name']):\t\t\n\t\t\t/*\n\t \t\t//Check for image upload\n\t\t if(!isset($_FILES['fuente_pantalla'])) {\n\t\t $this->validation->set_message('valid_image', 'Imagen requerida.');\n\t\t return false;\n\t\t }\n\t\t \n\t\t //Check for file size\n\t\t if($_FILES['image']['size'] == 0) {\n\t\t $this->validation->set_message('valid_image', 'Imagen requerida.');\n\t\t return false;\n\t\t }\n\t\t */\t\t\n\t\t //Check for upload errors\n\t\t if($_FILES[$campo]['error'] != UPLOAD_ERR_OK) {\n\t\t $this->CI->form_validation->set_message('valid_image', 'Error al subir el archivo, intente nuevamente.');\n\t\t return false;\n\t\t }\n\t\t \n\t\t //Check for valid image upload\n\t\t $imginfo = getimagesize($_FILES[$campo]['tmp_name']);\n\t\t if(!$imginfo) {\n\t\t $this->CI->form_validation->set_message('valid_image', '&Uacute;nicamente se permiten archivos de imagen.');\n\t\t return false;\n\t\t }\n\t\t \n\t\t //Check for valid image types\n\t\t //if( !($imginfo[2] == 1 || $imginfo[2] == 2 || $imginfo[2] == 3) ) // JPG PNG Y GIF\n\t\t if( !($imginfo['mime'] == 'image/jpeg' ))\n\t\t {\n\t\t $this->CI->form_validation->set_message('valid_image', 'Solo se permiten archivos en formato JPG.');\n\t\t return false;\n\t\t }\n\t\t \n\t\t //Check for existing image\n\t\t /*\n\t\t if(file_exists(SITEPATH.'uploads/images/'.$_FILES['image']['name'])) {\n\t\t $this->validation->set_message('valid_image', 'Image by this name already exists');\n\t\t return false;\n\t\t }*/\n\t endif;\n\t return true;\n}", "function userfile_check()\n\t\t{\n\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('userfile_check', 'The {field} file is required');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "function check_image_type(&$type, &$error, &$error_msg)\n{\n\tglobal $lang;\n\n\tswitch( $type )\n\t{\n\t\tcase 'jpeg':\n\t\tcase 'pjpeg':\n\t\tcase 'jpg':\n\t\t\treturn '.jpg';\n\t\t\tbreak;\n\t\tcase 'gif':\n\t\t\treturn '.gif';\n\t\t\tbreak;\n\t\tcase 'png':\n\t\t\treturn '.png';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$error = true;\n\t\t\t$error_msg = (!empty($error_msg)) ? $error_msg . '<br />' . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];\n\t\t\tbreak;\n\t}\n\n\treturn false;\n}", "public function validate() {\n $error = $this->error;\n switch ($error) {\n case UPLOAD_ERR_PARTIAL :\n case UPLOAD_ERR_NO_TMP_DIR :\n case UPLOAD_ERR_CANT_WRITE :\n $errCode = $this->getConfig(\"UPLOAD_ERROR_SYSTEM\");\n $errMessage = $this->getErrorMessage($errCode);\n throw new TMUploadException($errMessage);\n }\n\n $maxSize = (int) TMConfig::get(\"upload\", \"file_max_size\");\n if ($this->size > $maxSize * 1024) {\n $errCode = $this->getConfig(\"UPLOAD_ERROR_SIZE\");\n $errMessage = $this->getErrorMessage($errCode);\n throw new TMUploadException($errMessage);\n }\n\n $pix = TMUtil::getSuffix($this->name);\n if (!in_array($pix, $this->getValidatedTypes($this->configTypes))) {\n $errCode = $this->getConfig(\"UPLOAD_ERROR_PIX\");\n $errMessage = $this->getErrorMessage($errCode);\n throw new TMUploadException($errMessage);\n }\n }", "function fileUpload($fileName, $fileUploadPath = \"\", $maxSize = 1000000, $allowedFileTypes = array()) {\r\n if ($this->checkValidFileUpload($fileName, $fileUploadPath, $maxSize, $allowedFileTypes)) {\r\n if (!is_dir($fileUploadPath) && $fileUploadPath) {\r\n mkdir($fileUploadPath);\r\n }\r\n $destinationFileName = time() . \"_\" . $fileName[\"name\"];\r\n $destinationPath = $fileUploadPath . $destinationFileName;\r\n if (move_uploaded_file($fileName[\"tmp_name\"], $destinationPath)) {\r\n $destinationPath = $fileUploadPath . $destinationFileName;\r\n $fileExt = $this->getFileExtension($destinationPath);\r\n if (in_array($fileExt, array(\"jpg\", \"gif\", \"png\"))) {\r\n $newFileName = substr($destinationFileName, 0, strlen($destinationFileName) - strlen($fileExt) - 1);\r\n require_once(dirname(__FILE__) . \"/library/abeautifulsite/SimpleImage.php\");\r\n $img = new SimpleImage();\r\n if (isset($this->imageDimensions)) {\r\n foreach ($this->imageDimensions as $width => $height) {\r\n $resizeImg = $newFileName . \"_\" . $width . \"_\" . $height . \".\" . $fileExt;\r\n $newImage = $img->load($destinationPath)->resize($width, $height)->save($fileUploadPath . $resizeImg);\r\n }\r\n }\r\n \r\n if (isset($this->watermark)) {\r\n $img->load($destinationPath)->overlay($this->watermark[\"overlay\"], $this->watermark[\"position\"], $this->watermark[\"opacity\"], $this->watermark[\"xOffset\"], $this->watermark[\"yOffset\"])->save($destinationPath);\r\n }\r\n\r\n if (isset($this->imageFlip)) {\r\n $img->load($destinationPath)->flip($this->imageFlip)->save($destinationPath);\r\n }\r\n \r\n if (isset($this->imageThumbnail)) {\r\n $img->load($destinationPath)->thumbnail($this->imageThumbnail[\"width\"], $this->imageThumbnail[\"height\"], $this->imageThumbnail[\"focal\"])->save($destinationPath);\r\n }\r\n \r\n if (isset($this->imageCrop)) {\r\n $img->load($destinationPath)->crop($this->imageCrop[\"x1\"], $this->imageCrop[\"y1\"], $this->imageCrop[\"x2\"],$this->imageCrop[\"y2\"])->save($destinationPath);\r\n }\r\n\r\n if (isset($this->imageText)) {\r\n $imgText = $this->imageText;\r\n $img->load($destinationPath)->text($imgText[\"text\"], $imgText[\"font_file\"], $imgText[\"font_size\"], $imgText[\"color\"], $imgText[\"position\"], $imgText[\"x_offset\"], $imgText[\"y_offset\"], $imgText[\"stroke_color\"], $imgText[\"stroke_size\"], $imgText[\"alignment\"], $imgText[\"letter_spacing\"])->save($destinationPath);\r\n }\r\n }\r\n return $this->settings[\"uploadURL\"] . $destinationFileName;\r\n } else\r\n return false;\r\n }\r\n\r\n return false;\r\n }", "public function isValid($aValidFileFormats = null, $iMaxFileSize = null);", "function testCompatible(){\n\t\tif($this->$imageAsset[\"type\"] == \"image/jpeg\" || $_FILES[\"image_upload_box\"][\"type\"] == \"image/pjpeg\"){\t\n\t\t\t$this->imgType = 'jpg';\n\t\t}\t\t\n\t\t// if uploaded image was GIF\n\t\tif($this->$imageAsset[\"type\"] == \"image/gif\"){\t\n\t\t\t$this->imgType = 'gif';\n\t\t}\t\n\t\t// if uploaded image was PNG\n\t\tif($this->$imageAsset[\"type\"] == \"image/x-png\"){\n\t\t\t$this->imgType = 'png';\n\t\t}\n\t\telse {\n\t\t\t$this->imgType = 'invalid';\n\t\t}\n\t\t\n\t}", "public function quick_image_upload($tmp_file, $base_filename, $type, $allowed_types, $target_folder = false){\n\t\t\t$errors = $this->check_file_sizes($tmp_file);\n\t\t\tif ($errors['error_exists']){\n\n\t\t\t\treturn $errors;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$mime = $this->get_mime($tmp_file);\n\n\t\t\t\t$errors = $this->check_mime_allowed_general($mime, $allowed_types);\n\t\t\t\tif ($errors['error_exists']){\n\t\t\t\t\treturn $errors;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$errors = $this->check_image_sizes($tmp_file);\n\n\t\t\t\t\tif ($errors['error_exists']){\n\t\t\t\t\t\treturn $errors;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif ($type == 0){\n\t\t\t\t\t\t\t$ext = $this->set_general_file_extension($mime, $allowed_types);\n\t\t\t\t\t\t\t$filename = $this->encrypt_filename($ext);\n\t\t\t\t\t\t\t$filename = $this->check_file_exists_change_filename($filename, $target_folder);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($type == 1){\n\t\t\t\t\t\t\t$filename = $this->sanitize_filename($base_filename);\n\t\t\t\t\t\t\t$filename = $this->check_file_exists_change_filename($filename, $target_folder);\n\t\t\t\t\t\t}\n\n\n\n\n\t\t\t\t\t\t$errors = $this->upload_file($tmp_file, $filename, $target_folder);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//return the error array\n\t\t\t\t\t\tif ($errors['error_exists']){\n\t\t\t\t\t\t\t$errors['filename'] = false;\n\t\t\t\t\t\t\t$errors['filepath'] = false;\n\t\t\t\t\t\t\treturn $errors;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t//add the filename if no error\n\t\t\t\t\t\t\t$errors['filename'] = $filename;\n\t\t\t\t\t\t\t$errors['filepath'] = $target_folder;\n\t\t\t\t\t\t\treturn $errors;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t}", "function checkimage($img)\r\n{\r\n $imageMimeTypes = array(\r\n 'image/png',\r\n 'image/gif',\r\n 'image/jpeg');\r\n\r\n $img = mime_content_type($img);\r\n $imgcheck = false;\r\n if (in_array ($img, $imageMimeTypes))\r\n {\r\n $imgcheck = true;\r\n }\r\n return $imgcheck;\r\n}", "private function isValidImageType(string $file)\r\n {\r\n return in_array(pathinfo($file, PATHINFO_EXTENSION), $this->supported);\r\n }", "function isImage($tempFile) {\n\n // Get the size of the image\n $size = getimagesize($tempFile);\n\n if (isset($size) && $size[0] && $size[1] && $size[0] * $size[1] > 0) {\n return true;\n } else {\n return false;\n }\n\n }", "public function checkCorrectFile( $sName, $is = 'jpg|jpeg|png|gif' ){\n\t\treturn preg_match( '/('.$is.')/i', $this->throwExtOfFile( $sName ) );\n\t}", "public function check_file_sizes($filename){\n\t\t\t$error['error_exists'] = false; \n\t\t\t$error['error_message'] = false; \n\n\t\t\tif (filesize($filename) == null){\n\t\t\t\t$error['error_exists'] = true; \n\t\t\t\t$error['error_message'] = $this->file_uploading_settings['file_not_exist']; \n\n\t\t\t}\n\t\t\telse if (filesize($filename) > $this->file_uploading_settings['max_size']){\n\t\t\t\t$error['error_exists'] = true; \n\t\t\t\t$error['error_message'] = $this->file_uploading_settings['file_too_big'];\n\t\t\t}\n\n\t\t\treturn $error;\n\t\t}", "function file_is_image($filename) {\n return in_array(get_file_extension($filename), get_image_file_types());\n }", "function Is_image($filename){\n \n $size = getimagesize($filename);\nif($size==FALSE){\n $er=FALSE; \n\n}else{\n $er=TRUE; \n}\nreturn $er;\n}", "public static function file_upload_max_size()\n {\n static $max_size = -1;\n\n if ($max_size < 0) {\n // Start with post_max_size.\n $max_size = self::parse_size(ini_get('post_max_size'));\n\n // If upload_max_size is less, then reduce. Except if upload_max_size is\n // zero, which indicates no limit.\n $upload_max = self::parse_size(ini_get('upload_max_filesize'));\n if ($upload_max > 0 && $upload_max < $max_size) {\n $max_size = $upload_max;\n }\n }\n self::throwError(self::d('admin.upload_max', array('size' => $max_size)));\n }", "function validate_image_upload ($error_arr) {\n\t$data['success'] = FALSE;\n\tif($_FILES['photos']['tmp_name'] != '') {\n\t\tif (!isset($_FILES['photos']['error']) || is_array($_FILES['photos']['error'])) {\n\t\t\tthrow new RuntimeException('Invalid parameters.');\n\t\t}\n\t\tswitch ($_FILES['photos']['error']) {\n\t\t case UPLOAD_ERR_OK:\n\t\t break;\n\t\t case UPLOAD_ERR_NO_FILE:\n\t\t \t$data['message'] = $error_arr['image_unspec_error'];\n\t\t case UPLOAD_ERR_INI_SIZE:\n\t\t case UPLOAD_ERR_FORM_SIZE:\n\t\t \t$data['message'] = $error_arr['image_large_error'];\n\t\t default:\n\t\t $data['message'] = $error_arr['upload_image_error'];\n\t\t}\n\t\t$target_dir = \"images/\";\n\t\t$data['path'] = $target_dir . basename($_FILES[\"photos\"][\"name\"]);\n\t\t$data['image_type'] = pathinfo($data['path'], PATHINFO_EXTENSION);\n\t\t// Check if image file is a actual image or fake image\n\t\t$check = getimagesize($_FILES[\"photos\"][\"tmp_name\"]);\n\t\tif($check === false) {\n\t\t $data['message'] = $error_arr['not_an_image_error'];\n\t\t}\n\t\t// Check if file already exists\n\t\tif (file_exists($data['path'])) {\n\t\t $data['message'] = $error_arr['image_exists_error'];\n\t\t}\n\t\t// Check file size, limit at 5MB\n\t\tif ($_FILES[\"photos\"][\"size\"] > $error_arr['max_size_bytes']) {\n\t\t $data['message'] = $error_arr['image_large_error'];\n\t\t}\n\t\t// Allow certain file formats\n\t\tif($data['image_type'] != \"jpg\" && $data['image_type'] != \"png\" && $data['image_type'] != \"jpeg\" && $data['image_type'] != \"gif\") {\n\t\t $data['message'] = \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n\t\t}\n\t\tif(!isset($data['message']) && isset($data['path']) && isset($data['image_type'])) $data['success'] = TRUE;\n\t} else $data['message'] = $error_arr['image_unspec_error'];\n\treturn $data;\n}", "public function fileisinvalid($request,$addeditid=0)\n {\n \n \n //**** image code starts\n \n \n $allowedFileExtAr=array();\n $allowedFileExtAr[]=\"jpg\";\n $allowedFileExtAr[]=\"jpeg\";\n $allowedFileExtAr[]=\"png\";\n \n $filecontrolname=\"image_name\";\n \n \n\t\t\t\t$allowedFileExtSizeAr=array();\n $allowedFileExtSizeAr['jpg']=(5*1024*1024);\n\t\t\t\t$allowedFileExtSizeAr['jpeg']=(5*1024*1024);\n $allowedFileExtSizeAr['png']=(5*1024*1024);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//max_width & max_height ,min_width & min_height,equal_width & equal_height \n\t\t\t\t$allowedFileResolAr=array();\n\t\t\t\t\n\t\t\t\t$allowedFileResolAr['jpeg']=array('min_width'=>537,'min_height'=>507);\n\t\t\t\t$allowedFileResolAr['jpg']=array('min_width'=>537,'min_height'=>507);\n $allowedFileResolAr['png']=array('min_width'=>537,'min_height'=>507);\n $func=\"validatefile\";//validatefile/uploadfile\n \n \n $destinationsourcePath=public_path().\"/upload/venueimage/source-file/\"; \n $chkimgresp=Imageuploadlib::imageupload($request,$filecontrolname,$allowedFileExtAr,$allowedFileExtSizeAr,$allowedFileResolAr,$func,$addeditid,$destinationsourcePath,$errfileAr=array()) ;\n \n \n \n \n \n /* echo \"==chkimg1==><pre>\";\n print_r($chkimgresp);\n echo \"</pre>\"; */ //exit();\n \n \n $invalidresp=false;\n \n $errormsgs=''; $fileuploadednames=array(); $errfileAr=array();\n $totalfileposted=0;\n \n if(!empty($chkimgresp))\n {\n \n \n if(array_key_exists('errormsgs',$chkimgresp))\n {\n $errormsgs=$chkimgresp['errormsgs'];\n }\n \n if(array_key_exists('errfileAr',$chkimgresp))\n {\n $errfileAr=$chkimgresp['errfileAr'];\n }\n \n if(array_key_exists('totalfileposted',$chkimgresp))\n {\n $totalfileposted=$chkimgresp['totalfileposted'];\n }\n \n }\n \n $resparray=array();\n $resparray['errormsgs']=$errormsgs;\n $resparray['errfileAr']=$errfileAr;\n $resparray['totalfileposted']=$totalfileposted;\n \n return $resparray;\n }", "function valid_image($files = null) {\r\n if (isset($files) && !empty($files)) {\r\n $allowedExts = array(\r\n \"gif\",\r\n \"jpeg\",\r\n \"jpg\",\r\n \"png\",\r\n \"GIF\",\r\n \"JPEG\",\r\n \"JPG\",\r\n \"PNG\"\r\n );\r\n $temp = explode(\".\", $files ['name']);\r\n $extension = end($temp);\r\n\r\n if (!in_array($extension, $allowedExts)) {\r\n return 'No';\r\n }\r\n }\r\n return \"Yes\";\r\n }", "private function checkMimeType()\n {\n $allowedTypes = $this->getSetting('allowed_upload_types', true);\n if (is_string($allowedTypes) && strlen($allowedTypes)) {\n $allowedTypes = str_replace(' ', '', $allowedTypes);\n $allowedTypes = explode(',', $allowedTypes);\n }\n if (is_array($allowedTypes)) {\n if (!in_array($this->file->getMimeType(), $allowedTypes)) {\n throw new FileException('File type is not allowed');\n }\n }\n }", "public function checkImageType()\n {\n if (empty($this->checkImageType)) {\n return true;\n }\n\n if (('image' == substr($this->mediaType, 0, strpos($this->mediaType, '/')))\n || (!empty($this->mediaRealType)\n && 'image' == substr($this->mediaRealType, 0, strpos($this->mediaRealType, '/')))\n ) {\n if (!@getimagesize($this->mediaTmpName)) {\n $this->setErrors(\\XoopsLocale::E_INVALID_IMAGE_FILE);\n return false;\n }\n }\n return true;\n }", "function wp_is_file_image( $file ) {\n\tif ( @getimagesize( $file ) )\n\t\treturn true;\n\n\treturn false;\n\n}", "function check_image_type($source_pic)\n{\n $image_info = check_mime_type($source_pic);\n\n switch ($image_info) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }", "function uploadImage($fieldName){\r\n \r\n // Undefined | Multiple Files | $_FILES Corruption Attack\r\n // If this request falls under any of them, treat it invalid.\r\n if ( !isset($_FILES[$fieldName]['error']) || is_array($_FILES[$fieldName]['error']) ) { \r\n throw new RuntimeException('Invalid parameters.');\r\n }\r\n\r\n // Check $_FILES['upfile']['error'] value.\r\n switch ($_FILES[$fieldName]['error']) {\r\n case UPLOAD_ERR_OK:\r\n break;\r\n case UPLOAD_ERR_NO_FILE:\r\n throw new RuntimeException('No file sent.');\r\n case UPLOAD_ERR_INI_SIZE:\r\n case UPLOAD_ERR_FORM_SIZE:\r\n throw new RuntimeException('Exceeded filesize limit.');\r\n default:\r\n throw new RuntimeException('Unknown errors.');\r\n }\r\n \r\n // You should also check filesize here. \r\n if ($_FILES[$fieldName]['size'] > 1000000) {\r\n throw new RuntimeException('Exceeded filesize limit.');\r\n }\r\n\r\n // DO NOT TRUST $_FILES['upfile']['mime'] VALUE !!\r\n // Check MIME Type by yourself.\r\n $finfo = new finfo(FILEINFO_MIME_TYPE);\r\n $validExts = array(\r\n 'jpg' => 'image/jpeg',\r\n 'png' => 'image/png',\r\n 'gif' => 'image/gif'\r\n ); \r\n $ext = array_search( $finfo->file($_FILES[$fieldName]['tmp_name']), $validExts, true );\r\n \r\n \r\n if ( false === $ext ) {\r\n throw new RuntimeException('Invalid file format.');\r\n }\r\n \r\n /* Alternative to getting file extention \r\n $name = $_FILES[\"upfile\"][\"name\"];\r\n $ext = strtolower(end((explode(\".\", $name))));\r\n if (preg_match(\"/^(jpeg|jpg|png|gif)$/\", $ext) == false) {\r\n throw new RuntimeException('Invalid file format.');\r\n }\r\n Alternative END */\r\n\r\n // You should name it uniquely.\r\n // DO NOT USE $_FILES['upfile']['name'] WITHOUT ANY VALIDATION !!\r\n // On this example, obtain safe unique name from its binary data.\r\n \r\n $fileName = sha1_file($_FILES[$fieldName]['tmp_name']); \r\n $location = sprintf('./uploads/%s.%s', $fileName, $ext); \r\n \r\n if (!is_dir('./uploads')) {\r\n mkdir('./uploads');\r\n }\r\n \r\n if ( !move_uploaded_file( $_FILES[$fieldName]['tmp_name'], $location) ) {\r\n throw new RuntimeException('Failed to move uploaded file.');\r\n }\r\n\r\n /* return the file name uploaded */\r\n return $fileName.'.'.$ext;\r\n}", "function validatePhoto(){\n\t\t\tglobal $validForm, $photo_name_Err; // use global versions of these variables\n\t\t\t// check that photo was uploaded without errors\n\t\t\tif(isset($_FILES['photo']) && $_FILES['photo']['error'] == 0){\n\t\t\t\t$allowed = array(\"jpg\" => \"image/jpg\", \"jpeg\" => \"image/jpeg\", \"gif\" => \"image/gif\", \"png\" => \"image/png\");\n\t\t\t\t$photo_name = $_FILES['photo']['name'];\n\t\t\t\t//echo $photo_name;\n\t\t\t\t$photo_type = $_FILES['photo']['type'];\n\n\t\t\t\t// Verify file extension\n\t\t\t\t$ext = pathinfo($photo_name, PATHINFO_EXTENSION);\n\t\t\t\tif(!array_key_exists($ext, $allowed)){\n\t\t\t\t\t//die(\"Error: Please select a valid file format.\");\n\t\t\t\t\t$photo_name_Err = \"*Please select a valid file format.\";\n\t\t\t\t\t$validForm=false;\n\t\t\t\t}\n\t\t\t\t// Verify file type\n\t\t\t\tif(in_array($photo_type, $allowed)){\n\t\t\t\t\t// Check whether file exists before uploading\n\t\t\t\t\tif(file_exists(\"images/\".$_FILES['photo']['name'])){\n\t\t\t\t\t\t//echo $_FILES['photo']['name'].\" already exists.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmove_uploaded_file($_FILES['photo']['tmp_name'], \"images/\".$_FILES['photo']['name']);\n\t\t\t\t\t\t//echo \"Your file was uploaded successfully.\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$displayMsg .= \"<h2>Error: there was a problem uploading your file. Please try again.</h2>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}" ]
[ "0.76163924", "0.75154805", "0.7370217", "0.7330946", "0.7160955", "0.7128784", "0.7041342", "0.702815", "0.7003825", "0.69577986", "0.6933683", "0.6931522", "0.69238645", "0.6886302", "0.68595546", "0.6843471", "0.6783882", "0.6768791", "0.67466944", "0.6723041", "0.6707816", "0.6612674", "0.6550302", "0.654093", "0.64842474", "0.6431223", "0.64290094", "0.6418958", "0.63944864", "0.6372789", "0.6360696", "0.6337927", "0.6322865", "0.62998337", "0.62865907", "0.62756944", "0.6268025", "0.625997", "0.6245459", "0.62323695", "0.6223972", "0.621745", "0.6217441", "0.62124723", "0.621051", "0.6206614", "0.61945575", "0.6191709", "0.6181139", "0.6166549", "0.6163457", "0.6160986", "0.6147857", "0.61409456", "0.61356753", "0.61342543", "0.61139274", "0.6111328", "0.6109968", "0.6102467", "0.60805047", "0.60714126", "0.60697484", "0.6058731", "0.60576373", "0.6038757", "0.6033627", "0.6024421", "0.60233665", "0.6015622", "0.6012127", "0.60120773", "0.6008595", "0.598875", "0.5982581", "0.5963434", "0.59613425", "0.5960573", "0.5945166", "0.5942867", "0.59339106", "0.5931784", "0.59300685", "0.59284544", "0.5927851", "0.5927083", "0.5926026", "0.5925636", "0.5924516", "0.59200263", "0.5917412", "0.59103614", "0.590781", "0.5904394", "0.5895639", "0.5877494", "0.58731425", "0.5869365", "0.5857331", "0.5850086" ]
0.7805798
0
Function to save uploaded image in folder (and display image for testing). $file_input is the file input name on the HTML form.
function Picture_Save_File($file_input, $target_dir) { $message = Photo_Uploaded_Is_Valid($file_input); // voir fonction if ($message === 'OK') { // Check that there is no file with the same name // already exists in the target folder // using file_exists() $target_file = $target_dir.basename($_FILES[$file_input]['name']); if (file_exists($target_file)) { return 'This file already exists'; } // Create the file with move_uploaded_file() if (move_uploaded_file($_FILES[$file_input]['tmp_name'], $target_file)) { // ALL OK display image for testing //echo '<img src="'.$target_file.'">'; return 'ok'; } else { return 'Error in move_upload_file'; } } else { // upload error, invalid image or file too big return $message; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function savetheuploadedfile() {\n\t\t$public_dir = 'public/images/';\n\t\t$baseurl = base_url();\n\t\tif ($_FILES['file']['name']) {\n\t\t\t\tif (!$_FILES['file']['error']) {\n\t\t\t\t\t\t$name = md5(rand(100, 200));\n\t\t\t\t\t\t$ext = explode('.', $_FILES['file']['name']);\n\t\t\t\t\t\t$filename = $name . '.' . $ext[1];\n\t\t\t\t\t\t$destination = $public_dir . $filename; //change path of the folder...\n\t\t\t\t\t\t$location = $_FILES[\"file\"][\"tmp_name\"];\n\t\t\t\t\t\tmove_uploaded_file($location, $destination);\n\t\t\t\t\t\t// echo $destination;\n\n\t\t\t\t\t\techo $baseurl.'/public/images/' . $filename;\n\t\t\t\t} else {\n\t\t\t\t\t\techo $message = 'The following error occured: ' . $_FILES['file']['error'];\n\t\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function save()\n {\n $dir = $this->pathTmpImage;\n\n $files = scandir($dir);\n\n foreach ($files as $file) {\n if ($file == $_POST['image']) { \n copy($this->pathTmpImage . $file, $this->pathResult . $file);\n }\n }\n\n //$this->dbInsert($_POST['image']);\n\n unlink($this->pathTmpImage . $_POST['image']);\n }", "private function saveImage()\n {\n $name = $_FILES['image']['name'];\n $tmp_name = $_FILES['image']['tmp_name'];\n\n return move_uploaded_file($tmp_name, 'images/' . $name);\n }", "public function uploadImageSave($file_image) {\n if (!empty($file_image)) {\n $upload_folder = WWW_ROOT . \"files\" . DS . \"slide-app\";\n $upload_folder_specific = $upload_folder . DS;\n if (!is_dir($upload_folder)) {\n mkdir($upload_folder, 0755, true);\n }\n if (!is_dir($upload_folder_specific)) {\n mkdir($upload_folder_specific, 0755, true);\n }\n $tmp_file = WWW_ROOT . \"tmp\" . DS . $file_image;\n if (file_exists($tmp_file)) {\n $image = new File($tmp_file, true, 0755);\n $file_name = md5(time() + rand(0, 1000));\n $ext = $image->ext();\n $mime_type = $image->mime();\n $size = $image->size();\n $aft_file = $upload_folder_specific . DS . $file_name . \".\" . $ext;\n $image->copy($aft_file);\n array_map('unlink', glob(WWW_ROOT . \"tmp\" . DS . '*'));\n }\n }\n return $file_name . \".\" . $ext;\n }", "function saveImage() {\n $_UPLOADS = $GLOBALS[\"server_upload_folder\"];\n $uploadOk = 1;\n\n $filePath = $_UPLOADS . basename($_FILES[\"image\"][\"name\"]);\n $imageFileType = pathinfo($filePath, PATHINFO_EXTENSION);\n\n // Check if file already exists\n if (file_exists($filePath)) {\n $uploadOk = 0;\n }\n\n // Check file size\n if ($_FILES[\"image\"][\"size\"] > 500000) {\n $uploadOk = 0;\n }\n\n // Allow certain file formats\n if($imageFileType != \"jpg\" && $imageFileType != \"png\" && $imageFileType != \"jpeg\" && $imageFileType != \"gif\" ) {\n $uploadOk = 0;\n }\n\n // If everything is ok, try to upload file\n if($uploadOk == 1) {\n\n if (move_uploaded_file($_FILES[\"image\"][\"tmp_name\"], $filePath)) {\n return $filePath;\n }\n }\n}", "public function uploadImage()\n {\n if ((isset($_FILES['image']['name']))\n && (!empty($_FILES['image']['name']))\n ) {\n try {\n $uploader = new Varien_File_Uploader('image');\n $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));\n $uploader->setAllowRenameFiles(FALSE);\n $uploader->setFilesDispersion(FALSE);\n $path = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'slidermanager';\n $uploader->save($path, $_FILES['image']['name']);\n\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')\n ->addError($e->getMessage());\n }\n\n return $_FILES['image']['name'];\n }\n\n return '';\n }", "public function upload_img()\r\n {\r\n if(!is_dir('./uploads/groups'))mkdir(('./uploads/groups')); \r\n if (!empty($_FILES)) \r\n { \r\n $tempFile = $_FILES['file']['tmp_name']; \r\n\r\n $file_info = explode('.',$_FILES['file']['name']);\r\n $file_ext = $file_info[1];\r\n\r\n $targetPath = './uploads/groups'; \r\n\r\n $newFile = time().'.'.$file_ext;\r\n \r\n $targetFile = $targetPath.$newFile; \r\n \r\n move_uploaded_file($tempFile,$targetFile); \r\n\r\n $this->output->set_output(json_encode($newFile));\r\n }\r\n }", "public function saveImageFromPost(){\n if(!empty($_FILES['images'])) {\n $imageData = $_FILES;\n $tmp_name = $imageData['images']['tmp_name'];\n $file_name = $this->getImageName();\n $upload_dir = DIR_IMAGES_DATA . \"/\" . $file_name;\n move_uploaded_file($tmp_name, $upload_dir);\n return $file_name;\n }else{\n return false;\n }\n }", "public function postProjectImageUpload()\n\t{\n\t\t#Get project id\n\t\t$id = Input::get( \"id\" );\n\t\t$type = Input::get( \"type\" );\n\n\t\t#Move upload file\n\t\t$file = Input::file( 'file' );\n\t\t$file_name = $file->getClientOriginalName();\n\t\t$file_name = preg_replace( '/\\s+/', '', $file_name );\n\t\t$file->move( 'uploads/project_' . $this->_getTypeName( $type ), $file_name );\n\n\t\t//Store image to session\n\t\t$images_arr = Session::has( \"image[{$type}]\" ) ? Session::get( \"image[{$type}]\" ) : array();\n\t\t$image_item = array( 'image' => $file_name );\n\t\tarray_push( $images_arr, $image_item );\n\t\tSession::set( \"image[{$type}]\", $images_arr );\n\n\t\treturn $file_name;\n\t}", "protected function save()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n imagegif($this->image, $this->getPath(true));\n break;\n \n case 'image/jpeg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/jpg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/png':\n imagepng($this->image, $this->getPath(true), round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n \n chmod($this->getPath(true), 0777);\n }", "public function handleuploadAction() {\r\n $allowedExtensions = array(\"png\",\"jpg\",\"jpeg\",\"gif\",\"bmp\");\r\n // max file size in bytes\r\n $sizeLimit = 10 * 1024 * 1024;\r\n \r\n $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);\r\n \r\n $dir = \"img/picture\";\r\n \r\n $result = $uploader->handleUpload($dir);\r\n \r\n $image = \\Nette\\Image::fromFile($dir . \"/\" . $result['filename']);\r\n $image->resize(269, 200, \\Nette\\Image::EXACT);\r\n $image->save($dir . \"/\" . $result['filename']);\r\n \r\n // to pass data through iframe you will need to encode all html tags\r\n echo htmlspecialchars(Zend_Json::encode($result), ENT_NOQUOTES);\r\n $this->_helper->layout->disableLayout();\r\n $this->_helper->viewRenderer->setNoRender(TRUE);\r\n }", "public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }", "public function imageUp($inputFile)\n {\n $imagePath = 'uploads/';\n $extension = $inputFile->getClientOriginalExtension();\n $imageName = uniqid() .'.'. $extension;\n // $fullPathToImage = $imagePath . $imageName;\n $inputFile->move($imagePath, $imageName);\n $this->attributes['img'] = '/uploads/' . $imageName;\n }", "public function save_image_info(){\r\n $old_image_url = $_FILES['member_image']['tmp_name'];\r\n $directory = '../../../mainSite/assets/team_member_image/';\r\n $image_name = $_FILES['member_image']['name'];\r\n $new_img_url = $directory.$image_name;\r\n\r\n $image_type = pathinfo($image_name, PATHINFO_EXTENSION);\r\n $image_size = $_FILES['member_image']['size'];\r\n $check = getimagesize($old_image_url);\r\n\r\n if($check){\r\n if(file_exists($new_img_url)){\r\n die('The file alredy exits! Please Try another one.');\r\n }else{\r\n if ($image_size>5000000){\r\n die('File size is too large! Please upload Small file.');\r\n }else{\r\n if ($image_type != 'jpg' && $image_type != 'png'){\r\n die('File type is not valid! Please upload JPG or PNG file.');\r\n }else{\r\n /*code for move image in our project folder and etc*/\r\n move_uploaded_file($old_image_url, $new_img_url);\r\n return $new_img_url;\r\n }\r\n }\r\n }\r\n }else{\r\n die('The file you Upload is not an image! Please upload a Valid Image.');\r\n }\r\n\r\n }", "function submitImage($userId){\n $target_dir = \"uploads/$userId/\"; //String interpolation is available this way in PHP, but not suggested\n createDirIfNeeded($target_dir);\n $target_file = $target_dir . basename($_FILES[\"fileToUpload\"][\"name\"]);\n $uploadOk = 1;\n $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));\n // Check if image file is a actual image or fake image\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n echo \"File is not an image.\";\n $uploadOk = 0;\n }\n }\n if ($uploadOk == 0) {\n echo \"Sorry, your file was not uploaded.\";\n // if everything is ok, try to upload file\n } else {\n if (move_uploaded_file($_FILES[\"fileToUpload\"][\"tmp_name\"], $target_file)) {\n echo \"The file \". basename( $_FILES[\"fileToUpload\"][\"name\"]). \" has been uploaded.\";\n } else {\n echo \"Sorry, there was an error uploading your file.\";\n }\n }\n }", "public function store(){\n $url_path = 'assets/imgs/' . $_FILES['file']['name'];\n move_uploaded_file($_FILES['file']['tmp_name'], $url_path);\n $_POST['url_image'] = $url_path;\n echo parent::register($_POST) ? header('location: ?controller=admin') : 'Error en el registro';\n }", "function saveImage($j) {\n $target_dir = \"images/\";\n $target = $target_dir . $_FILES[\"userfile\"][\"name\"][$j];\n \n move_uploaded_file($_FILES[\"userfile\"][\"tmp_name\"][$j], $target);\n return 1;\n}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public static function save_file($_file)\n {\n $photo_file = MyUtil::gen_file_name();\n $new_file = $_SERVER['DOCUMENT_ROOT'] . \"/statics/images/upload/$photo_file\";\n if (file_put_contents($new_file, $_file)) {\n $img_type = exif_imagetype($new_file);\n $ext = image_type_to_extension($img_type, TRUE);\n rename($new_file, $new_file . $ext);\n $new_file = $new_file . $ext;\n return $photo_file . $ext;\n }\n }", "public function saveToFile($file_path = \"\") {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n if (!is_dir(dirname($file_path))) {\n $parent_directory = dirname($file_path);\n $mode = 0777;\n $recursive = true;\n mkdir($parent_directory, $mode, $recursive);\n }\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n $file_extension = \"jpg\";\n break;\n case \"image/png\":\n $file_extension = \"png\";\n break;\n case \"image/gif\":\n $file_extension = \"gif\";\n break;\n }\n\n// filling out the file path\n $file_path = sprintf(\"%s.%s\", $file_path, $file_extension);\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n imagejpeg($this->_resource, $file_path);\n break;\n case \"image/png\":\n imagepng($this->_resource, $file_path);\n break;\n case \"image/gif\":\n imagegif($this->_resource, $file_path);\n break;\n }\n\n// assigning the new image file_location attribute\n $this->_file_location = $file_path;\n\n// changing the mode (so that all can make good use of the new image file)\n chmod($this->_file_location, 0777);\n } else {\n trigger_error(\"CAMEMISResizeImage::saveToFile() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "function upload_image ()\n\t{\n\t\tif (!isset($_FILES) || empty($_FILES))\n\t\t\treturn \"img/noImage.jpg\";\n\n\t\t$extentions = array(\"jpg\",\"jpeg\",\"gif\",\"png\");\n\t\t$filetypes = array(\"image/gif\",\"image/jpeg\",\"image/png\",\"image/pjpeg\");\n\n\t\t$extracted_ext = explode(\".\",$_FILES[\"file\"][\"name\"]);\n\t\t$extracted_ext = end($extracted_ext);\n\n\t\tif (!in_array($_FILES[\"file\"][\"type\"], $filetypes) || !in_array($extracted_ext, $extentions))\n\t\t\treturn \"img/noImage.jpg\";\n\n\t\tif (file_exists(\"img/\".$_FILES[\"file\"][\"name\"]))\n\t\t\treturn \"img/\" . $_FILES[\"file\"][\"name\"];\n\n\t\tmove_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"img/\".$_FILES[\"file\"][\"name\"]);\n\n\t\treturn \"img/\" . $_FILES[\"file\"][\"name\"];\n\t}", "public function Upload()\n {\n $uploadedImage = \"\";\n $target_file = $this->target_dir . basename($_FILES[$this->fileuploadname][\"name\"]);\n $uploadOk = 1;\n $imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));\n\n if (isset($_POST[$this->submitname])) {\n $check = getimagesize($_FILES[$this->fileuploadname][\"tmp_name\"]);\n if ($check !== false) {\n $this->message .= \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n $this->message .= \"File is not an image.\";\n $uploadOk = 0;\n }\n }\n\n if (file_exists($target_file)) {\n $this->message .= \"Sorry, file already exists.\";\n $uploadOk = 0;\n }\n\n if ($_FILES[$this->fileuploadname][\"size\"] > $this->maxImageSize) {\n $this->message .= \"Sorry, your file is too large.\";\n $uploadOk = 0;\n }\n\n\n if (!in_array($imageFileType, $this->allowedFileTypes)) {\n $this->message .= \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n }\n\n if ($uploadOk == 0) {\n $this->message .= \"Sorry, your file was not uploaded.\";\n // if everything is ok, try to upload file\n } else {\n if (move_uploaded_file($_FILES[$this->fileuploadname][\"tmp_name\"], $target_file)) {\n $img = basename($_FILES[$this->fileuploadname][\"name\"]);\n $this->message .= \"The file \" . $img . \" has been uploaded.\";\n $uploadedImage = \"<img src='$this->target_dir/$img' >\";\n } else {\n $this->message .= \"Sorry, there was an error uploading your file.\";\n }\n }\n\n return $uploadedImage;\n }", "function storeUploadedFile($tmpFilePath){\r\n \r\n // gets the image type, reads first few bytes of image and returns int that represents jpg or png\r\n $imageTypeInt = exif_imagetype($tmpFilePath);\r\n \r\n // takes int and gets image extension\r\n $extension = image_type_to_extension($imageTypeInt);\r\n \r\n // gets the target directory for upload\r\n $target_dir = \"images/properties/\";\r\n \r\n // generates unique name for file based on microseconds of upload time\r\n // second param makes it more unique adds additional characters on end of returned value\r\n //eg \"/images/properties/8872791982.jpg\"\r\n $newImagePath = $target_dir . uniqid(\"prop\", true) . $extension;\r\n \r\n // takes current image path (in tmp folder) and puts it in new location newImagePath\r\n move_uploaded_file($tmpFilePath, $newImagePath);\r\n \r\n return $newImagePath;\r\n}", "abstract public function save($img, $filename);", "public function save($value){\n $target_path = IMG_PATH.DS.$this->file_name;\n try {\n //move the uploaded file to target path\n move_uploaded_file($value, $target_path);\n return $this->_add_photo();\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function actionUploadImageDepartment()\n {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/department/\" . $filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location, PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\", \"jpeg\", \"png\");\n /* Check file extension */\n if (!in_array(strtolower($imageFileType), $valid_extensions)) {\n $uploadOk = 0;\n }\n if ($uploadOk == 0) {\n echo 0;\n } else {\n /* Upload file */\n if (move_uploaded_file($_FILES['file']['tmp_name'], $location)) {\n echo $filename;\n } else {\n // echo 0;\n }\n }\n }", "public function save()\n {\n $this->validate();\n $this->validate(['image' => 'required|image']);\n\n // try to upload image and resize by ImageSaverController config\n try {\n $imageSaver = new ImageSaverController();\n $this->imagePath = $imageSaver->loadImage($this->image->getRealPath())->saveAllSizes();\n }catch (\\RuntimeException $exception){\n dd($exception);\n }\n\n $this->PostSaver();\n\n $this->resetAll();\n $this->ChangeCreatedMode();\n $this->swAlert([\n 'title' => 'Good job',\n 'text' => 'successfully added',\n 'icon' => 'success'\n ]);\n $this->render();\n }", "public function save()\n {\n\n $photo = $this->flyer->addPhoto($this->makePhoto());\n\n\n // move the photo to the images folder\n $this->file->move($photo->baseDir(), $photo->name);\n\n\n// Image::make($this->path)\n// ->fit(200)\n// ->save($this->thumbnail_path);\n\n // generate a thumbnail\n $this->thumbnail->make($photo->path, $photo->thumbnail_path);\n }", "function uploadFile($name)\n{\n // Gets the paths, full and local directory\n global $image_dir, $image_dir_path;\n if (isset($_FILES[$name])) {\n // Gets the actual file name\n $filename = $_FILES[$name]['name'];\n if (empty($filename)) {\n return;\n }\n // Get the file from the temp folder on the server\n $source = $_FILES[$name]['tmp_name'];\n // Sets the new path - images folder in this directory\n $target = $image_dir_path . '/' . $filename;\n // Moves the file to the target folder\n move_uploaded_file($source, $target);\n // Send file for further processing\n processImage($image_dir_path, $filename);\n // Sets the path for the image for Database storage\n $filepath = $image_dir . '/' . $filename;\n // Returns the path where the file is stored\n return $filepath;\n }\n}", "function saveImage()\n\t{\n\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t/* store a interlaced gif image */\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagegif($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t/* store a progressive jpeg image (with default quality value)*/\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagejpeg($this->ImageStream, $this->sFileLocation, $this->jpegquality);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t/* store a png image */\n\t\t\t\timagepng($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\n\t\t\t\tif (!file_exists($this->sFileLocation)) {\n\t\t\t\t\t$this->printError('file not stored');\n\t\t\t\t}\n\t\t}\n\t}", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function actionUploadImageNews()\n {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/news/\".$filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location,PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\",\"jpeg\",\"png\");\n /* Check file extension */\n if( !in_array(strtolower($imageFileType),$valid_extensions) ) {\n $uploadOk = 0;\n }\n if($uploadOk == 0){\n echo 0;\n }else{\n /* Upload file */\n if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){\n echo $filename;\n\n }else{\n // echo 0;\n }\n }\n }", "public function upload() {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "function file_save($file,$path)\n{\n\t// echo count($file['name']);\n\t\tif(count($file[\"name\"])>0 and $path)\n\t\t\t{\n\t\t\t\t$tempfilepath=$file[\"tmp_name\"];\n\t\t\t\t// echo $tempfilepath;\n\n\t\t\t\tif($tempfilepath != \"\")\n\t\t\t\t{\n\t\t\t\t\t$name=substr(md5(time().\"\".$tempfilepath),20);\n\n\t\t\t\t\t$filename = $file['name'];\n\t\t\t\t\t$ext = pathinfo($filename, PATHINFO_EXTENSION);\n\t\t\t\t\t// echo $tempfilepath.\"\\n\";\n\t\t\t\t\t// echo $path.\"/\".$name.\".\".$ext;\n\t\t\t\t\tif(move_uploaded_file($tempfilepath, $path.\"/\".$name.\".\".$ext)){\n\t\t\t\t\t\tchmod($path.\"/\".$name.\".\".$ext,0777);\n\t\t\t\t\t\t// chown($path.\"/\".$name.\".\".$ext,\"neoned71\");\n\t\t\t\t\t\treturn $name.\".\".$ext;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"upload failed 0\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t// if(move_uploaded_file($tempfilepath,\"question_images/\".$name.\".\".$ext)){\n\t\t\t\t\t// \treturn $name.\".\".$ext;\n\t\t\t\t\t// }\n\t\t\t\t\t// else\n\t\t\t\t\t// {\n\t\t\t\t\t// \techo \"upload failed 0\";\n\t\t\t\t\t// \treturn false;\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo \"upload failed 1\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"upload failed 2\";\n\t\t\t\treturn false;\n\t\t\t}\t\n}", "public function storeMedia($input) {\n $dir = 'images';\n if ($input->hasFile('media')) {\n $image = $input->file('media');\n $name = time().'.'.$image->getClientOriginalExtension();\n $img = Image::make($image);\n // $img = Image::make(Request::file('media'));\n $img->orientate();\n $img->fit(400, 400);\n $img->save(public_path('/images/' . $name));\n\n // $destinationPath = $dir;\n // $image->move($destinationPath, $name);\n }\n $media = new Media;\n $media['path'] = $name;\n\n if (!$media->save()) {\n $errors = $media->getErrors();\n return redirect()->back()->with('errors', $errors)->withInput();\n }\n return $media->id;\n }", "function upload_image()\n {\n $file = $this->request->getFile('image');\n $fileName = $file->getRandomName();\n $file->move('./assets/img/beranda/post/inside', $fileName);\n echo base_url('assets/img/beranda/post/inside') . '/' . $fileName;\n }", "private function _imgSave(){\r\n\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $img = getimagesize($sourcePath);\r\n $new_name = uniqid();\r\n\r\n switch($img['mime']){\r\n case 'image/png':\r\n $new_name .= '.png';\r\n break;\r\n case 'image/jpeg':\r\n $new_name .= '.jpg';\r\n break;\r\n case 'image/gif':\r\n $new_name .= '.gif';\r\n break;\r\n default:\r\n echo \"Only PNG, JPEG or GIF images are allowed!\";\r\n exit;\r\n }\r\n\r\n $targetPath = ROOT.'/site/files/'.$new_name;\r\n $webPath = WEBROOT.'/site/files/'.$new_name;\r\n\r\n if(rename($sourcePath, $targetPath)){\r\n $result->url = $webPath;\r\n $result->size = [$img[0],$img[1]];\r\n $result->alt = 'an image';\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }", "function processAndStoreUploadedFile()\n{\n\t$allowedFileTypes = array(\"image/png\", \"image/jpeg\", \"image/gif\", \"text/plain\", \"application/pdf\");\n\t$allowedExtensions = array('jpg', 'jpeg', 'png', 'gif', 'pdf');\n\t\n\t\n\tif(in_array($_FILES['fileUpload']['type'], $allowedFileTypes))\n {\n \t$dateiname = standardizeFileName($_FILES['fileUpload']['name']);\n \tmove_uploaded_file (\n $_FILES['fileUpload']['tmp_name'] ,\n 'uploadedFiles/'. $dateiname);\n \techo \"Hochladen war erfolgreich <br>\";\n \techo \"<a href='uploadedFiles/\" . $_FILES['fileUpload']['name'] . \"'> uploadedFiles/\" . $_FILES['fileUpload']['name'] . \" </a> <br> <br>\";\n\t}\n\telse echo \"Ungültiger Dateityp\";\t\n}", "protected function saveImage()\n {\n if ( $this->initialImage != $this->image )\n {\n $this->deleteOldImage();\n\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n $imageHandler->save($this->getImagesFolder( TRUE ) . $imageHandler->getBaseFileName() );\n\n $settings = $this->getThumbsSettings();\n\n if ( !empty( $settings ) )\n {\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n\n foreach( $settings as $prefix => $dimensions )\n {\n list( $width, $height ) = $dimensions;\n $imageHandler\n ->thumb( $width, $height )\n ->save( $this->getImagesFolder( TRUE ) . $prefix . $imageHandler->getBaseFileName() );\n }\n }\n\n @unlink( $this->getTempFolder( TRUE ) . $this->image );\n }\n }", "public function save() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n $ext = $this->getImageExt();\n $quality = $this->__imageQuality;\n $dirSavePath = dirname($this->__imageSavePath);\n \n if (empty($this->__imageSavePath) || !is_dir($dirSavePath)) {\n $this->setError(__d('cloggy','Image save path not configured or maybe not exists.'));\n } else { \n \n /*\n * create resized image\n */\n switch($ext) {\n \n case 'jpg':\n case 'jpeg':\n\n if (imagetypes() & IMG_JPG) {\n @imagejpeg($this->__imageResized,$this->__imageSavePath,$quality); \n }\n\n break;\n\n case 'gif':\n\n if (imagetypes() & IMG_GIF) {\n @imagegif($this->__imageResized,$this->__imageSavePath); \n }\n\n break;\n\n case 'png':\n\n $scaleQuality = round($this->__imageQuality/100) * 9;\n $invertScaleQuality = 9 - $scaleQuality;\n\n if (imagetypes() & IMG_PNG) {\n @imagepng($this->__imageResized,$this->__imageSavePath,$invertScaleQuality); \n }\n\n break;\n\n } \n \n } \n \n /*\n * destroy resized image\n */\n if ($this->__imageResized) {\n \n //destroy resized image\n imagedestroy($this->__imageResized);\n \n } \n \n }\n \n }", "public function store_in_database(){\n\tif(isset($_POST['submit'])){\n\t\t$image_path = $_POST['path'];\n\t\tupdate_option('pochomaps_map_image', $image_path);\n\t}\n}", "function display_image($picture){\n\tglobal $uploaddirectory;\nreturn $uploaddirectory . DS . $picture;\n\n}", "public static function UploadFile($folder,$filename){\n// CATALOGUE\n$uploaddir = './ImagesAll/imagesBlackScale/'; //$uploaddir = './imagesBlackScale/';\n$uploadfile = $uploaddir.basename($_FILES['fileme']['name']);\n$url=\"http://example2.esy.es\";\n$imageLoaded=$uploadfile ; // to form['GET'] URL LINK\n\n\n// Copy a file from temporary catalogue for files saving :\nif (copy($_FILES['fileme']['tmp_name'], $uploadfile))\n{\n\n\n\n// ADD picture to DB----------------------------------\n// Path to image\n$pathMe= $uploaddir.\"/\".$_FILES['fileme']['name']; // it is dublicated??\n\n //$sthI = $db->prepare(\"INSERT INTO mvcGallery (mvcGal_user, mvcGal_image) VALUES (:user, :image)\");\n //$sthI->bindValue(':user' , $_SESSION['login']);\n //$sthI->bindValue(':image', $pathMe);\n // $sthI->execute(); \n\n// END ADD PICTURE TO DB-----------------------------\n\n\n\n\n\n\necho \"<h1 style='color:red;font-size:44px;margin: 0 auto;'>UPLOADED SUCCESSFULLY</h1>\";\necho \"<img src=$uploadfile />\";\n\necho \"</br><input type=button value='Back'\nonclick='history.back()'>\";\nheader(\"Location: http://example2.esy.es/mvc/?gdlibrary&loadImage=$imageLoaded&condition=on\"); \n\n\n\n}\nelse { echo \"<h3>ERROR</h3>\"; exit; }\n\n }", "function uploadFile($name) {\r\n // Gets the paths, full and local directory\r\n global $image_dir, $image_dir_path;\r\n if (isset($_FILES[$name])) {\r\n // Gets the actual file name\r\n $filename = $_FILES[$name]['name'];\r\n if (empty($filename)) {\r\n return;\r\n }\r\n // Get the file from the temp folder on the server\r\n $source = $_FILES[$name]['tmp_name'];\r\n // Sets the new path - images folder in this directory\r\n $target = $image_dir_path . '/' . $filename;\r\n // Moves the file to the target folder\r\n move_uploaded_file($source, $target);\r\n // Send file for further processing\r\n processImage($image_dir_path, $filename);\r\n // Sets the path for the image for Database storage\r\n $filepath = $image_dir . '/' . $filename;\r\n // Returns the path where the file is stored\r\n return $filepath;\r\n }\r\n }", "public function uploadFile($input_file,$destinationPath,$file_type = 'image',$fileName){\n if($file_type == 'image'){\n $img = Image::make($input_file->getRealPath());\n $img->resize(100, 100, function ($constraint) {\n $constraint->aspectRatio();\n })->save($destinationPath.'/thumbs/'.$fileName);\n }\n chmod($destinationPath, 0777); //changed to add the zero\n $input_file->move($destinationPath, $fileName); // uploading file to given path\n return $fileName;\n }", "function save($path, $file) {\n // сохраняем миниатюру]\n // создать миниатюру\n // if (!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path.'small/small_'.$file)) {\n // return false;\n // }\n // если всё нормально, то\n // сохраняем оригинальный файл\n if(!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path.$file)){\n return false;\n }\n\n // создать миниатюру\n $image = new SimpleImage();\n $image->load($path.$file);\n $image->resize(400, 200);\n $image->save($path.'small/small_'.$file);\n\n return true;\n }", "private function upload_file_and_get_path(): string\n {\n $this->load->library('upload');\n $image_path = \"\";\n $config['upload_path'] = './static/images/';\n $config['allowed_types'] = 'jpg|jpeg|png|gif|pdf';\n $config['encrypt_name'] = TRUE;\n $this->upload->initialize($config);\n if ($this->upload->do_upload('image_path')) {\n $info = $this->upload->data();\n $image_path = $info['file_name'];\n // delete the images present in table or else with every new upload unwanted files will keep on increasing\n } else {\n echo $this->upload->display_errors();\n return \"\";\n }\n return $image_path;\n }", "function _field_image_upload ($val) {\n\n $name = $this->fname;\n $path = '';\n $max = (!empty($this->attribs['displaysize']))? $this->attribs['displaysize'] : 64;\n\n if (isset($this->attribs['ws_path'])) {\n $path = $this->attribs['ws_path'];\n }\n elseif (defined('SITE_MEDIA_URLPATH')) {\n $path = SITE_MEDIA_URLPATH;\n }\n\n $res = '<div class=\"fieldImageW\">';\n\n if (!empty($val)) {\n $val = preg_replace('/^\\//', '', $val); // rid of a pesky leading slash now\n $url = \"$path/\" . urlencode($val);\n\n if (preg_match('/\\.swf$/', $val)) { // its a F'en Flash - just pop a new friggin windowz\n $res .= \"<span class='ffimg'><a href=\\\"$url\\\" target=\\\"flashWin\\\"><img src=\\\"/gfx/icons/flash.gif\\\"></a></span>\";\n }\n else {\n $size = '';\n $tw = $max;\n $th = $max;\n if (list($w, $h) = @getimagesize(UPLOAD_SAVE_PATH . '/' . $val)) {\n if ($w > $h) {\n $th = floor($h * ($tw / $w));\n }\n else {\n $tw = floor($w * ($th / $h));\n }\n $size = sprintf(\" [%dx%d]\", $w, $h);\n }\n $res .= sprintf('<img src=\"%s\" width=\"%d\" height=\"%d\" title=\"%s%s\">', \n $url, \n $tw,\n $th,\n htmlspecialchars($val),\n $size);\n }\n }\n\n $res .= $this->_field_file($val);\n $res .= \"</div>\";\n return $res;\n }", "public function uploadImage($input, $data)\n {\n try {\n\n $uploader = $this->_fileUploaderFactory->create(['fileId' => $input]);\n $uploader->setAllowRenameFiles(true);\n $uploader->setFilesDispersion(true);\n $uploader->setAllowCreateFolders(true);\n $result = $uploader->save($this->getBaseDir());\n return $result['file'];\n\n } catch (\\Exception $e) {\n if ($e->getCode() != \\Magento\\Framework\\File\\Uploader::TMP_NAME_EMPTY) {\n throw new FrameworkException($e->getMessage());\n } else {\n if (isset($data[$input]['value'])) {\n return $data[$input]['value'];\n }\n }\n }\n return '';\n }", "public function upload()\n {\n if (null === $this->image) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the target filename to move to\n $this->file->move($this->getUploadRootDir(), $this->image->getClientOriginalName());\n\n // set the path property to the filename where you'ved saved the file\n $this->path = $this->image->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function SaveProfileImg() {\n $file_name = $_SESSION['user_id'] . \"-\" . time() . \"-\" . $this->ImageName;\n $file_size = $this->ImageSize;\n $file_tmp = $this->ImageTmpName;\n $tmp = explode('.', $file_name);\n $file_ext = end($tmp);\n $expensions = array(\"jpeg\", \"jpg\", \"png\", \"gif\");\n \n if (in_array($file_ext, $expensions) === false) {\n throw new Exception(\"extension not allowed, please choose a JPEG or PNG or GIF file.\");\n }\n \n if ($file_size > 2097152) {\n throw new Exception('File size must be excately 2 MB');\n }\n \n if (empty($errors) == true) {\n move_uploaded_file($file_tmp, \"data/profile/\" . $file_name);\n return \"data/profile/\" . $file_name;\n } else {\n echo \"Error\";\n }\n }", "public function upload()\n {\n if (null === $this->getImg()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getImg()->move(\n self::SERVER_PATH_TO_PRESS_IMAGE_FOLDER,\n $this->getImg()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->imageUrl = $this->getImg()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setImg(null);\n }", "public function uploadImage()\n {\n if (null === $this->fileimage) {\n return;\n }\n\n $upload = new Upload();\n $this->image = $upload->createName(\n $this->fileimage->getClientOriginalName(),\n $this->getUploadRootDir().'/',\n array('tmp/','miniature/')\n );\n\n $imagine = new Imagine();\n\n /* Tmp */\n $size = new Box(1920,1080);\n $imagine->open($this->fileimage)\n ->thumbnail($size, 'inset')\n ->save($this->getUploadRootDir().'tmp/'.$this->image);\n\n /* Miniature */\n $size = new Box(300,300);\n $imagine->open($this->fileimage)\n ->thumbnail($size, 'outbound')\n ->save($this->getUploadRootDir().'miniature/'.$this->image);\n\n }", "public function upload()\n {\n $path = $this->file_path;\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n\n // Upload file. \n $file_name = strtolower(basename($_FILES['uploaded_file']['name']));\n $file_name = str_replace(' ', '-', $file_name); // Replace spaces with dashes.\n $path = $path . $file_name;\n\n $acceptable = array(\n 'image/jpeg',\n 'image/jpg',\n 'image/gif',\n 'image/png'\n );\n\n if(in_array($_FILES['uploaded_file']['type'], $acceptable)) {\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n\n $file_msg = 'The file '. $path . ' has been uploaded';\n \n // Not ideal but good for now\n \n // Refresh parent on upload.\n echo \"<script>window.parent.location.reload(true);</script>\";\n\n } else {\n\n $file_msg = 'There was a problem with the upload.';\n }\n }\n else {\n\n $file_msg = 'Bad file uploaded.';\n }\n return $file_msg;\n }", "public function addImageAction()\n\t\t{\n\n\t\t\tif(isset($_FILES['image']))\n\t\t\t{\n\t\t\t\t$imagename=$_FILES['image']['name'];\n\t\t\t\t$imagetemp=$_FILES['image']['tmp_name'];\n\t\t\t\t$imagesize=$_FILES['image']['size'];\n\t\t\t\t$imageext=pathinfo($imagename, PATHINFO_EXTENSION);\n\t\t\t\t$imagepath='Images/Projects/'.$imagename;\n\n\t\t\t\t$arrayext=array('jpg','JPG','jpeg','JPEG','png','PNG');\n\n\t\t\t\tif(in_array($imageext, $arrayext))\n\t\t\t\t{\n\t\t\t\t\tmove_uploaded_file($imagetemp, $imagepath);\n\n\t\t\t\t\techo $imagename;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function actionUpload()\n {\n if (isset($_GET['department_id_from_url'])) {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/\".$_GET['department_id_from_url'].\"/\" . $filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location, PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\", \"jpeg\", \"png\");\n /* Check file extension */\n if (!in_array(strtolower($imageFileType), $valid_extensions)) {\n $uploadOk = 0;\n echo 0;\n }\n if ($uploadOk == 0) {\n echo 0;\n } else {\n /* Upload file */\n if (move_uploaded_file($_FILES['file']['tmp_name'], $location)) {\n echo $filename;\n } else {\n echo 0;\n }\n }\n }\n }", "public function storeimage(Request $request)\n {\n $this->authorize('isAdmin');\n if($request->file('file'))\n {\n $image = $request->file('file');\n $name = \"ortm_\".time().'.'.$image->getClientOriginalExtension();\n\n $thumbnailImage = Images::make($image)->resize(200, 200)->save(public_path('/img/ourteam/thumbs/' . $name));\n\n $watermark = Images::make(public_path('/img/watermark.png'));\n $Image = Images::make($image)->insert($watermark, 'bottom-right', 10, 10)->save(public_path('/img/ourteam/' . $name));\n\n //$image->move(public_path().'/img/social/', $name);\n }\n\n $image= new Image();\n $image->image_name = $name;\n $image->save();\n\n return response()->json([\n 'data' => $name\n ], 200);\n }", "function display_image($picture) {\n return \"uploads\" . DS . $picture;\n}", "private function saveImage($file, $var_image){\n\n //create instance of image from temp upload\n $image = \\Image::make($file->getRealPath());\n\n //save image with thumbnail\n $image->save(public_path() . '/imgs/library/' . $var_image) \n ->resize(200, 200)\n ->save(public_path() . '/imgs/library/thumbnails/thumb-' . $var_image);\n }", "protected function _banner_image_upload($file, $ext = null, $directory = null){ \r\n \r\n if($ext == 'image/png'){\r\n $ext = 'png';\r\n }\r\n else{\r\n $ext = 'jpg';\r\n }\r\n \r\n if($directory == null){\r\n $directory = 'media/uploads';\r\n }\r\n \r\n //Случайное значение\r\n $symbols = '0123456789abcdefghijklmopqrstuvwxyz';\r\n \r\n $filename = '';\r\n \r\n for($i=0; $i < 7; $i++){\r\n \r\n $filename .= rand(1, strlen($symbols));\r\n } \r\n \r\n $img = Image::factory($file);\r\n \r\n if($img->width > 960){\r\n $img->resize(960);\r\n }\r\n \r\n $img->save(\"$directory/$filename.$ext\"); \r\n \r\n return \"$filename.$ext\"; \r\n \r\n }", "function imageSave($property, UploadedFile $file);", "public function saveImage(Request $request) {\n\t\t// Validation: require image file, specify maximum size in kilobytes.\n\t\t$request->validate([\n\t\t\tProduct::IMAGE_INPUT_NAME => ['mimes:jpeg,png', 'max:1024']\n\t\t]);\n\t\t// Get image file.\n\t\t$image = $request->file(Product::IMAGE_INPUT_NAME);\n\t\tif ($image) {\n\t\t\t// Make an image name based on product name, date and time.\n\t\t\t$name = sprintf('%s_%s', Str::slug($request->input('name'), '_'), date('Ymd_His'));\n\t\t\t// Save uploaded image.\n\t\t\t$path = $this->storeUploadedFile($image, 'public', self::IMAGE_DIRECTORY, $name);\n\t\t\t// Save image file name in the property.\n\t\t\t$this->picture = basename($path);\n\t\t\t// Return result: file is saved.\n\t\t\treturn true;\n\t\t}\n\t\t// Return default value.\n\t\treturn false;\n\t}", "public function upload()\n {\n $callback = 'null';\n $url = '';\n $get = array();\n \n // for form action, pull CKEditorFuncNum from GET string. e.g., 4 from\n // /form/upload?CKEditor=content&CKEditorFuncNum=4&langCode=en\n // Convert GET parameters to PHP variables\n $qry = $_SERVER['REQUEST_URI'];\n parse_str(substr($qry, strpos($qry, '?') + 1), $get);\n \n if (!isset($_POST) || !isset($get['CKEditorFuncNum'])) {\n $msg = 'CKEditor instance not defined. Cannot upload image.';\n } else {\n $callback = $get['CKEditorFuncNum'];\n \n try {\n $url = $this->_move_image($_FILES['upload']);\n $msg = \"File uploaded successfully to: {$url}\";\n \n // Persist additions to file manager CMS here.\n \n } catch (Exception $e) {\n $url = '';\n $msg = $e->getMessage();\n }\n }\n \n // Callback function that will insert image into the correct CKEditor instance\n $output = '<html><body><script type=\"text/javascript\">' .\n 'window.parent.CKEDITOR.tools.callFunction(' .\n $callback .\n ', \"' .\n $url .\n '\", \"' .\n $msg .\n '\");</script></body></html>';\n \n echo $output;\n }", "function updateImg(){\n $image = str_replace('data:image/png;base64,', '', $_POST['image']);\n $image = str_replace(' ', '+', $image);\n // Decode the Base64 encoded Image\n $data = base64_decode($image);\n // Create Image path with Image name and Extension\n $file = '../images/' . \"MyImage\" . '.jpg';\n // Save Image in the Image Directory\n $success = file_put_contents($file, $data);\n}", "function UploadImage($field){\n $path = \"uploads/\".$_SESSION[\"user\"][\"Usuario\"].\"/\";\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n $originalName = basename($_FILES[$field][\"name\"]);\n $originalName = explode(\".\", $originalName);\n $fileName = $_SESSION[\"user\"][\"Usuario\"].date(\"dmyHis\").\".\".$originalName[count($originalName)-1];\n $file = $path.$fileName;\n if(move_uploaded_file($_FILES[$field][\"tmp_name\"], $file)){\n return $file;\n }\n else{\n return \"\";\n }\n\n}", "public function store(UploadedFile $file, string $folder): string;", "private function save()\n {\n $this->collage->setImageFormat('jpeg');\n return $this->collage->writeImage($this->name);\n }", "public function upload(){\n if( NULL === $this->getFile()){\n return;\n }\n $filename= $this->getFile()->getClientOriginalName();\n\n // Move to the target directory\n \n $this->getFile()->move(\n $this->getAbsolutePath(), \n $filename);\n\n //Set the logo\n $this->setFilename($filename);\n\n $this->setFile();\n\n }", "function savePreviewImage($filename, $destinationFile){\n\t\t $this->resizeSaveImage($filename, $destinationFile, self::previewWidth);\n\t }", "public function actionUpload()\n\t{\n\t\t$allowedExtensions = array('jpeg','jpg','bmp','png','tif','tiff');\n\t\t// max file size in bytes\n\t\t// this requires server settings as well: post_max_size, upload_max_filesize\n\t\t$sizeLimit = 20 * 1024 * 1024;\n\t\t\n\t\t$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);\n\t\t\n\t\t// the temporary filename is based on uniqiq() which generates unique strings based on the time in microseconds\n\t\t$temporaryFileName = uniqid();\n\t\t$ext = pathinfo($_GET['qqfile'],PATHINFO_EXTENSION);\n\t\t$originalFilename = pathinfo($_GET['qqfile'],PATHINFO_BASENAME);\n\t\t\n\t\t$result = $uploader->handleUpload(Image::FULLIMAGETEMPPATH,$temporaryFileName, $ext);\n\t\t// to pass data through iframe you will need to encode all html tags\n\t\t\n\t\t/*\n\t\t * If the qqFileUploader in extensions is OK with the file, it will return a 'success' = true\n\t\t * this checks the result of the qqFileUploader, which means that the file was correctly uploaded\n\t\t * Else an error is printed.\n\t\t */\n\t\tif(isset($result[\"success\"]))\n\t\t{\n\t\t\t// if the cdbox value is defined, the highest CD will not be evaluated, but rather the user defined is used\n\t\t\t// allowes the user to override the CD where images are placed, should the user know how to use the _GET cdbox\n\t\t\tif(isset($_GET['cdbox']))\n\t\t\t{\n\t\t\t\t// the next cd and id values are created based on the function in the model\n\t\t\t\t// the CD and ID values are the next highest, eg id1000->id1001, on the highest cd value\n\t\t\t\t$nextCdId = Image::model()->nextCdId($_GET['cdbox']);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$nextCdId = Image::model()->nextCdId(false);\n\t\t\t}\n\t\t\t\n\t\t\t// new Image object\n\t\t\t$insertImage = new Image;\n\t\t\t// temporary image description to make it easy to find images with missing metadata\n\t\t\t// removed, users did not understand what it was.\n\t\t\t// $insertImage->kuvateksti = 'täydentämätön lisätty ' . date('r') . ' alkuperäinen tiedostonimi ' . $originalFilename;\n\t\t\t$insertImage->cd = $nextCdId['cd'];\t\t\t\n\t\t\t$insertImage->id = $nextCdId['id'];\n\t\t\t\n\t\t\t// inserts 'e' \"boolean\" value to all the tag fields\n\t\t\t$tags=Image::model()->tags();\n\t\t\tforeach($tags as $tag)\n\t\t\t{\n\t\t\t\t$insertImage->$tag='e';\n\t\t\t}\n\t\t\t// saves the file extension, based on the $_GET['qqfile']\n\t\t\t$insertImage->tiedostotyyppi=strtolower($ext);\n\n\t\t\t$exif = exif_read_data(Image::FULLIMAGETEMPPATH . $temporaryFileName . '.' . $ext, 'IFD0');\n\t\t\t// echo('{error:\"Exif komponenttia ei voitu lukea:\"}');\t\t\n\t\t\t\t\t\n\t\t\tif (isset($exif['DateTimeOriginal']))\n\t\t\t{\n\t\t\t\t// quick parse so it fits the database\n\t\t\t\t$exifDate = $exif['DateTimeOriginal'];\n \t\t$insertImage->pvm = substr($exifDate,0,4) . substr($exifDate,5,2) . substr($exifDate,8,2);\n \t\t$insertImage->aikavarma = 'k';\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t// blank date is needed so the image is not filtered out as deleted\n\t\t\t\t$insertImage->pvm = '00000000';\n\t\t\t}\n\t\t\t\n\t\t\t// saves the metadata to the database\n\t\t\t$insertImage->save();\n\t\t\t\n\t\t\t/*\n\t\t\t * for some reason this doesn't work;\n\t\t\t * $imageid = $insertImage->imageid; so this is a workaround.\n\t\t\t * It's probably a bug it doesn't work so if there's a later version, it's worth trying if it works.\n\t\t\t */\n\t\t\t$temp = Image::model()->findBySql(\"SELECT * FROM diat WHERE id = '\" . $nextCdId['id'] . \"' AND cd = '\" . $nextCdId['cd'] . \"';\");\n\t\t\t$this->actionAddToBasket($temp->imageid);\n\t\t\tunset($temp);\n\n\t\t\t// if the directory doesn't exist, it's created, the first '' is the cd base directory, eg /kuvat/9006/\n\t\t\t$subdirs = array('', '/96x64', '/192x128', '/384x256', '/768x512');\n\t\t\tforeach ($subdirs as $subdir)\n\t\t\t{\n\t\t\t\tif(!file_exists(Image::FULLIMAGEPATH . $nextCdId['cd'] . $subdir))\n\t\t\t\t{\n\t\t\t\t\tmkdir(Image::FULLIMAGEPATH . $nextCdId['cd'] . $subdir);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Moves the image to the proper location. \n\t\t\trename(\n\t\t\t\tImage::FULLIMAGETEMPPATH . $temporaryFileName . '.' . $ext, \n\t\t\t\t$insertImage->getImageFile('full', false, Image::FULLIMAGEPATH)\n\t\t\t);\n\t\t\t\n\t\t\t$insertImage->generateThumbnails();\n\t\t\t\t\n\t\t\t// success true JSON for the javascript upload plugin so it can se it's css correctly\n\t\t\techo('{success:true}');\n\t\t}\n\t\telse \n\t\t{\n\t\t\techo('{error:\"' . $result[\"error\"] . '\"}');\n\t\t}\n\t}", "function foundbug_admin_form_submit($form, &$form_state) {\n\n\n if (($form_state['values']['foundbug_file_picture']['fid'] != 0)) {\n variable_set('foundbug_upload_fid', $form_state['values']['foundbug_file_picture']['fid']);\n variable_set('foundbug_imgpath', '<img src=\"' . file_create_url(file_load($form_state['values']['foundbug_file_picture']['fid'])->uri) . '\">');\n $form_state['values']['foundbug_imgpath'] = file_create_url(file_load($form_state['values']['foundbug_file_picture']['fid'])->uri);\n $file = file_load($form_state['values']['foundbug_file_picture']['fid']);\n if (!empty($file)) {\n $file->status = FILE_STATUS_PERMANENT;\n file_save($file);\n }\n }\n\n\n if ($form_state['values']['foundbug_offset_y'] > 50) {\n $form_state['values']['foundbug_offset_y'] = 50;\n }\n if ($form_state['values']['foundbug_offset_y'] < 0) {\n $form_state['values']['foundbug_offset_y'] = 0;\n }\n}", "function upload_banner() {\n $destPath = 'assets/img/uploads/progression';\n #Find and move our file\n $destFile = $_SERVER['DOCUMENT_ROOT'].\"/\".$destPath.\"/\".basename($_FILES['img']['name']);\n $tmpFile = $_FILES['img']['tmp_name'];\n if (move_uploaded_file($tmpFile, $destFile)){\n return $destPath.\"/\".basename($_FILES['img']['name']);\n } else {\n die(\"File Moving Failed.\");\n }\n }", "public function storeImage(UploadedFile $file)\n {\n $filename = md5(time().$file->getClientOriginalName()).'.'.$file->getClientOriginalExtension();\n $file->move(Config::get('assets.images'),$filename);\n\n $i = new ImageEntry();\n $i->path = $filename;\n $i->uploader = LoginController::currentUser()->id;\n $i->save();\n return $i;\n }", "public function saveToDisk(uploadedFile $image)\n {\n $uploadDirectory = 'uploads/images';\n $path = $this->kernel->getProjectDir().'/public/'.$uploadDirectory;\n\n $imageName = uniqid().'.'.$image->guessExtension();\n\n $image->move($path, $imageName);\n\n return '/'.$uploadDirectory.'/'.$imageName;\n }", "protected function saveImage(UploadedFile $image , string $file): string\n {\n $path = $image->store('public/images/' . $file);\n return str_replace('public/' , 'storage/' , $path);\n }", "function upload_testimonial_image() {\n if ($_FILES['testimonial_image']['size'] > 0) {\n $dir = '../images/testimonial_images';\n $filename1 = $_FILES['testimonial_image']['name'];\n $srcfile = $_FILES['testimonial_image']['tmp_name'];\n $targetfile = $dir . '/' . $filename1;\n if (move_uploaded_file($srcfile, $targetfile)) {\n return $filename1;\n } else {\n return $filename1;\n }\n }\n }", "public function writeimg() {\n\t\t$data = Input::all();\n\t\t$img = $data['imgdata'];\n\t\t$student_id = $data['student_id'];\n\t\t$img = str_replace('data:image/png;base64,', '', $img);\n\t\t$img = str_replace(' ', '+', $img);\n\t\t$imgdat = base64_decode($img);\n\t\t$myPublicFolder = public_path();\n\t\t$savePath = $myPublicFolder.\"/photo\";\n\t\t$path = $savePath.\"/$student_id.png\";\n\t\tFile::delete($path);\n\t\tFile::put($path , $imgdat);\n\t\t$last_add = Student::orderby('id', 'desc')->first();\n\t\tStudent::where('student_id', '=', $student_id)->update(array('pic' => \"$student_id.png\"));\n\t\treturn View::make('finish', array('imgid' => Student::where('student_id', '=', $student_id)->firstOrFail()->group));\n\t}", "public function upload()\n {\n if ($this->validate()) {\n $this->iconFile->saveAs('uploads/' . $this->iconFile->baseName . '.' . $this->iconFile->extension);\n return 'uploads/' . $this->iconFile->baseName . '.' . $this->iconFile->extension;\n } else {\n return false;\n }\n }", "public function imagePath(){\n return $this->upload_directory.DS.$this->filename;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->backgroundImage = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function uploads() {\n $this->Authorization->authorize($this->Settings->newEmptyEntity(), 'create');\n if ($this->request->is(\"Ajax\")) {\n $is_dest = \"img/tmp/\";\n if (!file_exists($is_dest)) {\n //mkdir($is_dest, 0777, true);\n $dir = new Folder(WWW_ROOT . 'img/tmp/', true, 0755);\n $is_dest = $dir->path;\n }\n $fileData = $this->request->getData('file');\n if (strlen($fileData->getClientFilename()) > 1) {\n $ext = pathinfo($fileData->getClientFilename(), PATHINFO_EXTENSION);\n $allowedExt = array('gif', 'jpeg', 'png', 'jpg', 'tif', 'bmp', 'ico');\n if ($this->request->getData('allow_ext')) {\n $allowedExt = explode(\",\", $this->request->getData('allow_ext'));\n }\n if (in_array(strtolower($ext), $allowedExt)) {\n $upload_img = $fileData->getClientFilename();\n $ran = time();\n $upload_img = $ran . \"_\" . $fileData->getClientFilename();\n if (strlen($upload_img) > 100) {\n $upload_img = $ran . \"_\" . rand() . \".\" . $ext;\n }\n $upload_img = str_replace(' ', '_', $upload_img);\n $fileData->moveTo($is_dest . $upload_img);\n $data['filename'] = $upload_img;\n $data['image_path'] = $this->request->getAttribute(\"webroot\") . \"img/tmp/\" . $upload_img;\n $data['success'] = true;\n $data['message'] = \"file successfully uploaded!\";\n } else {\n $data['success'] = false;\n $data['message'] = \"invalid file type!\";\n }\n } else {\n $data['success'] = false;\n $data['message'] = \"invalid file!\";\n }\n }\n $this->set($data);\n $this->viewBuilder()->setOption('serialize', ['filename', 'image_path','success', 'message']);\n }", "public function storeAs(UploadedFile $file, string $folder, $filename = null): string;", "public function saveimageAction()\n {\n $response = $this->getResponse();\n\n $userid= $this->params()->fromPost('userid');\n $createdTime= $this->params()->fromPost('createdtime');\n $imageType = $this->params()->fromPost('imagetype');\n $imageType = substr($imageType, -3, 3);\n $AVAorCOV = $this->params()->fromPost('albumtype');\n\n $documentService = $this->getDocumentService();\n\n $successModel = new SuccessModel();\n $result = $successModel->saveNewImageAvatar($userid, $createdTime,$documentService, $imageType, $AVAorCOV );\n\n if($result)\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 1,\n )));\n }\n else\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 0,\n )));\n }\n }", "function uploadImage(){\n\tif((!empty($_FILES[\"uploaded_file\"])) && ($_FILES['uploaded_file']['error'] == 0)) {\n\t $filename = basename($_FILES['uploaded_file']['name']);\n\t $ext = substr($filename, strrpos($filename, '.') + 1);\n\t if(($ext == \"jpg\" && $_FILES[\"uploaded_file\"][\"type\"] == 'image/jpeg') || ($ext == \"png\" && $_FILES[\"uploaded_file\"][\"type\"] == 'image/png') || ($ext == \"gif\" && $_FILES[\"uploaded_file\"][\"type\"] == 'image/gif')){ \n\t \t$temp = explode(\".\",$_FILES[\"uploaded_file\"][\"name\"]);\n\t \t$newfilename = NewGuid() . '.' .end($temp);\n\t\tmove_uploaded_file($_FILES[\"uploaded_file\"][\"tmp_name\"], ROOT_PATH . '/img/upload/' . $newfilename);\n\t\treturn $newfilename;\n\t }\n\t else{\n\t \treturn '';\n\t }\n\t}\n\treturn '';\n}", "function imageHandler($parametre){\r\n $type = end(explode(\".\", $parametre['name']));\r\n $name = explode(\".\", $parametre['name'])[0];\r\n $path = $parametre['tmp_name'];\r\n $newPath = \"C:\\\\xampp\\htdocs\\Kit-up\\assets\\books\\sales\";\r\n // echo $newPath;\r\n $allow = ['jpg', 'jpeg', 'png'];\r\n $newName = \"\";\r\n if(in_array($type,$allow)){\r\n $newName = md5(uniqid(mt_rand(), true)) . \".\" . $type;\r\n move_uploaded_file($path, $newPath.'\\\\'.$newName);\r\n return $newPath.'\\\\'.$newName ;\r\n }else{\r\n echo \"Sorry. Not supported type!\";\r\n }\r\n }", "private function savePhoto()\n {\n $image = Image::make($this->filePath);\n\n File::exists($this->sanghaPhotosPath()) or File::makeDirectory($this->sanghaPhotosPath());\n\n $image->resize(400, null, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($this->sanghaPhotosPath() . $this->fileName)\n ->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n })\n ->save($this->sanghaPhotosPath() . 'tn_' . $this->fileName);\n\n }", "public function uploadImage()\r\n {\r\n /*\r\n * Response codes\r\n * 000 - Нет ошибок\r\n * 001 - Нет данных\r\n * 002 - Ошибка получения параметров файла\r\n * 003 - Ошибка получения пути файла\r\n * 004 - Ошибка перемещения файла\r\n * 005 - Требования не соблюдены\r\n * 006 - Нет папки салона\r\n */\r\n if (isset($_POST) &&\r\n isset($_FILES) &&\r\n array_key_exists('upload', $_FILES) &&\r\n count($_FILES['upload']) > 0 &&\r\n array_key_exists('slug', $_POST) &&\r\n array_key_exists('img_name', $_POST) &&\r\n array_key_exists('type', $_POST)\r\n ) {\r\n $type = $_POST['type'];\r\n if ($this->authentication->has_permission($type . '_upload')) {\r\n $img_name = $_POST['img_name'];\r\n $tmpFilePath = $_FILES['upload']['tmp_name'][0];\r\n $tmpFileType = $_FILES['upload']['type'][0];\r\n $tmpFileExtension = pathinfo($_FILES['upload']['name'][0], PATHINFO_EXTENSION);\r\n $tmpFileSize = $_FILES['upload']['size'][0];\r\n $tmpImageInfo = getimagesize($_FILES['upload']['tmp_name'][0]);\r\n if (array_key_exists('img_slug', $_POST)) {\r\n $fileParams = $this->FieldsModel->getFile($_POST['img_slug'], $_POST['img_slug']);\r\n } else {\r\n $fileParams = $this->FieldsModel->getFile($type, $img_name);\r\n }\r\n if ($fileParams) {\r\n if (\r\n $tmpFileType != $fileParams['mime'] ||\r\n $tmpImageInfo['mime'] != $fileParams['mime'] ||\r\n $tmpFileExtension != $fileParams['ext'] ||\r\n $tmpFileSize > $fileParams['max_size'] ||\r\n $tmpImageInfo[0] > $fileParams['max_width'] ||\r\n $tmpImageInfo[0] < $fileParams['min_width'] ||\r\n $tmpImageInfo[1] > $fileParams['max_height'] ||\r\n $tmpImageInfo[1] < $fileParams['min_height']\r\n ) {\r\n if ($tmpFileExtension === 'svg') {\r\n //Do nothing\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не удовлетворяет требованиям.', 'code' => '005', 'fileparams' => $fileParams));\r\n return;\r\n }\r\n }\r\n // Make sure we have a file path\r\n if ($tmpFilePath != '') {\r\n // Setup new file path\r\n if (!file_exists('./media/' . $_POST['type'] . '/' . $_POST['slug'] . '/')) {\r\n mkdir('./media/' . $_POST['type'] . '/' . $_POST['slug']);\r\n //echo json_encode(array('status' => 'fail', 'message' => 'Салон не сконфигурирован. Обратитесь к поставщику услуг.', 'code' => '006'));\r\n //return;\r\n }\r\n $newFilePath = './media/' . $_POST['type'] . '/' . $_POST['slug'] . '/' . $_POST['img_name'] . '.' . $tmpFileExtension;\r\n // Upload the file into the temp dir\r\n if (move_uploaded_file($tmpFilePath, $newFilePath)) {\r\n // Create path to update image in frontend\r\n $path = base_url() . 'media/' . $_POST['type'] . '/' . $_POST['slug'] . '/' . $_POST['img_name'] . '.' . $tmpFileExtension;\r\n echo json_encode(array('status' => 'ok', 'message' => 'Изображение загружено.', 'code' => '000', 'path' => $path));\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '004'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '003'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '002'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, у вас нет прав!', 'code' => '999'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '001'));\r\n }\r\n }", "public static function saveOriginImage($file) {\n\t\t$save_dir = Yii::getAlias('@runtime' . DIRECTORY_SEPARATOR . self::$file_name);\n\t\t// Yii::info(\"Image save origin path :: \");\n\t\t// Yii::info($save_dir);\n\n\t\t$file->saveAs($save_dir, true);\n\t\treturn $save_dir;\n\t}", "function Do_save_logo()\n\t{\n\t\t\n\t\t//检查传过来的图片信息是否正确\n\t\t$inputname = 'logo_pic';\n\t\t$files_error_code = $_FILES[$inputname]['error'];\n\t\t//error code等于4,代表没有选择文件。\n\t\tif($files_error_code != '4')//代表肯定是上传图片了\n\t\t{\n\t\t\tif($files_error_code>0)\n\t\t\t{\n\t\t\t\techo '<script type=\"text/javascript\">';\n\t\t\t\techo 'window.parent.afterupload(\"err\",\"logo图片上传失败!请重新上传!\"); ';\n\t\t\t\techo '</script>';\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse //error code为0 ,代表上传成功。\n\t\t\t{\n\t\t\t\t//检查上传图片的大小,不能超出1M。\n\t\t\t\t$maxfilesize = 1*1024*1024;//1M换成字节。\n\t\t\t\tif($_FILES[$inputname][\"size\"] > $maxfilesize)\n\t\t\t\t{\n\t\t\t\t\techo '<script type=\"text/javascript\">';\n\t\t\t\t\techo 'window.parent.afterupload(\"err\",\"上传的logo图片大小不能超过1M,请重新上传。\"); ';\n\t\t\t\t\techo '</script>';\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//检查上传图片的格式,jpg、png、gif。\n\t\t\t\t$source_info = getimagesize($_FILES[$inputname][\"tmp_name\"]);\n\t\t\t\tif($source_info[2] != 1 && $source_info[2] != 2 && $source_info[2] != 3)//1代表gif,2代表jpg,3代表png\n\t\t\t\t{\n\t\t\t\t\techo '<script type=\"text/javascript\">';\n\t\t\t\t\techo 'window.parent.afterupload(\"err\",\"图片格式出错,请重新选择图片。\"); ';\n\t\t\t\t\techo '</script>';\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//能走到这里,说明通过了各项检查。\n\t\t\t\t//把上传的logo图片移到相应文件夹中。\n// \t\t\t\t$pimage_path = 'attachment_frontweb/logo_pic/';\n\n\t\t\t\t\n\t\t\t\t$templatename = getConfKV('template_name');//得到当前模板的名称。\n\t\t\t\t$pimage_path = 'templates/'.$templatename.'/images/attachment/logo_pic/';\n\t\t\t\t\n\t\t\t\tif(!is_dir($pimage_path))\n\t\t\t\t{\n\t\t\t\t\tmkdir($pimage_path,0777,true);\n\t\t\t\t}\n\t\t\t\tif(!is_dir($pimage_path))\n\t\t\t\t{\n\t\t\t\t\techo '<script type=\"text/javascript\">';\n\t\t\t\t\techo 'window.parent.afterupload(\"err\",\"logo图片目录创建失败,请重试!\"); ';\n\t\t\t\t\techo '</script>';\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\t//$ok_upload_img里保存的是检查合格的主图编号:0~7。也可能为空\n\t\t\t\t\n// \t\t\t\t//获得文件扩展名\n// \t\t\t\t$temp_arr = explode(\".\", $_FILES[$inputname][\"name\"]);\n// \t\t\t\t$file_ext = array_pop($temp_arr);\n// \t\t\t\t$file_ext = trim($file_ext);\n// \t\t\t\t$file_ext = strtolower($file_ext);\n\t\t\t\t\n// \t\t\t\t$image_full_name = $pimage_path . 'logo' . '.' . $file_ext;\n\t\t\t\t$image_full_name = $pimage_path . 'logo' . '.' . 'jpg';//不管上传的是gif、png还是jpg,统统用jpg为后缀。只有这样才不会有1.jpg、1.png、1.gif同时存在于文件夹中。\n\t\t\t\t\n\t\t\t\tmove_uploaded_file($_FILES[$inputname][\"tmp_name\"],$image_full_name);\n\t\t\t\t\n\t\t\t\techo '<script type=\"text/javascript\">';\n\t\t\t\techo 'window.parent.afterupload(\"succ\",\"\"); ';\n\t\t\t\techo '</script>';\n\t\t\t\texit();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse \n\t\t{\n\t\t\t//$files_error_code == '4'代表没有上传图片\n\t\t\techo '<script type=\"text/javascript\">';\n\t\t\techo 'window.parent.afterupload(\"err\",\"请选择图片!\"); ';\n\t\t\techo '</script>';\n\t\t\texit();\n\t\t}\n\t}", "public function uploadImage()\n {\n $file = array('image' => \\Input::file('image'));\n // setting up rules\n $rules = array('image' => 'required',); //mimes:jpeg,bmp,png and for max size max:10000\n // doing the validation, passing post data, rules and the messages\n $validator = Validator::make($file, $rules);\n if ($validator->fails()) {\n // send back to the page with the input data and errors\n return Redirect::back()->withInput()->withErrors($validator);\n }\n else {\n // checking file is valid.\n if (Input::file('image')->isValid()) {\n $destinationPath = 'temp'; // upload path\n $extension = Input::file('image')->getClientOriginalExtension(); // getting image extension\n $fileName = rand(11111, 99999) . '.' . $extension; // renaming image\n Input::file('image')->move($destinationPath, $fileName); // uploading file to given path\n // sending back with message\n Session::flash('success', 'Upload successfully');\n return Redirect::to('upload');\n } else {\n // sending back with error message.\n Session::flash('error', 'uploaded file is not valid');\n return Redirect::to('upload');\n }\n }\n }", "function upload_image($parent_id){\n\t\tif(!is_numeric($parent_id)){\n\t\t\tredirect('site_security/not_allowed');\n\t\t}\n\t\t$this->load->library('session');\n // security form\n\t\t$this->load->module('site_security');\n\t\t$this->site_security->_make_sure_is_admin();\n // get id\n\n\t\t$data['parent_id'] = $parent_id;\n\t\t$data['flash'] = $this->session->flashdata('item');\n\n\t // submit handler\n\n\t\t$data['headline'] = 'upload image';\n //$data['stor_items'] = 'stor_items';\n\t\t$data['view_file'] = 'upload_image';\n\t\t$this->load->module('templates');\n\t\t$this->templates->admin($data);\n\t}", "public function it_shows_file_input_type_on_image()\n {\n // configure\n $inputs = [\n [\n 'type' => 'image',\n 'name' => 'logo',\n 'label' => 'Upload Logo'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('type=\"file\"', false);\n }", "public function action_image()\n\t{\n\t\t//Image::load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')->preset('mypreset', DOCROOT.'/files/04_2021/ea7e8ed4bc9d6f7c03f5f374e30b183b.png');\n\t\t$image = Image::forge();\n\n\t\t// Or with optional config\n\t\t$image = Image::forge(array(\n\t\t\t\t'quality' => 80\n\t\t));\n\t\t$image->load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->rounded(100)\n\t\t\t\t\t->output();\n\t\t// Upload an image and pass it directly into the Image::load method.\n\t\tUpload::process(array(\n\t\t\t'path' => DOCROOT.DS.'files'\n\t\t));\n\n\t\tif (Upload::is_valid())\n\t\t{\n\t\t\t$data = Upload::get_files(0);\n\n\t\t\t// Using the file upload data, we can force the image's extension\n\t\t\t// via $force_extension\n\t\t\tImage::load($data['file'], false, $data['extension'])\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->save('image');\n\t\t} \n\t}" ]
[ "0.68281496", "0.6510763", "0.6353013", "0.63384074", "0.6251029", "0.622962", "0.6216302", "0.6200369", "0.6160553", "0.6132774", "0.61121356", "0.6107005", "0.6081792", "0.6079462", "0.60745174", "0.60721964", "0.60607755", "0.6048333", "0.6048333", "0.6035969", "0.60334194", "0.6029191", "0.6029191", "0.6029191", "0.6029191", "0.6029191", "0.6029191", "0.6022143", "0.5976818", "0.59738183", "0.5971398", "0.59666765", "0.5948495", "0.5947757", "0.5945047", "0.5943091", "0.5935809", "0.5916316", "0.589391", "0.58933413", "0.58746463", "0.5860694", "0.5857665", "0.5847062", "0.58257407", "0.58228576", "0.5798372", "0.57970256", "0.57968044", "0.5790981", "0.5789963", "0.5784506", "0.5782223", "0.5778278", "0.5771188", "0.5763689", "0.5763186", "0.5759663", "0.57548356", "0.57545626", "0.5754375", "0.57515806", "0.574119", "0.57400995", "0.5739086", "0.57349545", "0.5729646", "0.5729214", "0.5714212", "0.5701056", "0.56975967", "0.56886667", "0.5686012", "0.56855786", "0.5671171", "0.5658662", "0.5658303", "0.56580305", "0.565671", "0.56480294", "0.56421274", "0.56408656", "0.56368154", "0.5636122", "0.56280535", "0.5625106", "0.56247514", "0.5622178", "0.56201655", "0.5619299", "0.5618776", "0.56181425", "0.5617648", "0.56159997", "0.5614925", "0.5608023", "0.55924445", "0.558843", "0.5587534", "0.55854064" ]
0.6916206
0
Display a listing of the resource.
public function index() { $downs = Downpayment::orderBy('int_down_percentage')->get(); return view('maintenance.downpayment.index')->with('downs', $downs); }
{ "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